[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mapbox--robosat":3,"tool-mapbox--robosat":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":75,"owner_website":80,"owner_url":81,"languages":82,"stars":99,"forks":100,"last_commit_at":101,"license":102,"difficulty_score":103,"env_os":104,"env_gpu":105,"env_ram":106,"env_deps":107,"category_tags":115,"github_topics":116,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":122,"updated_at":123,"faqs":124,"releases":157},2206,"mapbox\u002Frobosat","robosat"," Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds","RoboSat 是一个基于 Python 开发的端到端自动化流程，专门用于从航空和卫星影像中提取地理特征。它能够精准识别并分割出建筑物、停车场、道路、水域及云层等视觉可辨别的要素，将复杂的图像数据转化为简洁的几何矢量信息（如 GeoJSON）。\n\n该工具主要解决了传统人工绘制地图效率低下且成本高昂的痛点，通过深度学习技术实现了大规模地理数据的自动化生产。其核心工作流涵盖数据准备、模型训练到后处理的全过程：支持自动下载影像并利用开放街道地图（OpenStreetMap）生成训练掩膜，采用全卷积神经网络进行语义分割，最后将分割结果优化为干净的地理多边形。此外，RoboSat 巧妙利用“滑动地图”瓦片格式，有效屏蔽了地理参考图像的复杂性，使处理流程更加标准化。\n\n需要注意的是，该项目目前已由原维护者 Mapbox 停止主动开发和维护，但其架构设计仍具有重要的参考价值。RoboSat 非常适合具备一定编程基础的开发者、遥感领域的研究人员以及需要处理地理空间数据的工程师使用。对于希望探索如何利用 AI 技术从卫星图中自动提取建筑轮廓或路网的用户来说，它提供了一个完整且可扩展的技术范本。","**Note: Robosat is neither maintained not actively developed any longer by Mapbox. See [this issue](https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F184).  \nThe main developers ([@daniel-j-h](https:\u002F\u002Fgithub.com\u002Fdaniel-j-h), [@bkowshik](https:\u002F\u002Fgithub.com\u002Fbkowshik)) are no longer with Mapbox.**\n\n\u003Ch1 align='center'>RoboSat\u003C\u002Fh1>\n\n\u003Cp align=center>\n  Generic ecosystem for feature extraction from aerial and satellite imagery\n\n  \u003Cimg src=\"assets\u002Fbuildings.png\" alt=\"RoboSat pipeline extracting buildings from aerial imagery\" \u002F>\n  \u003Ci>Berlin aerial imagery, segmentation mask, building outlines, simplified GeoJSON polygons\u003C\u002Fi>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002Fmapbox\u002Frobosat\">\u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002Fmapbox\u002Frobosat.svg?branch=master\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Installation](#installation)\n3. [Usage](#usage)\n    - [extract](#rs-extract)\n    - [cover](#rs-cover)\n    - [download](#rs-download)\n    - [rasterize](#rs-rasterize)\n    - [train](#rs-train)\n    - [export](#rs-export)\n    - [predict](#rs-predict)\n    - [mask](#rs-mask)\n    - [features](#rs-features)\n    - [merge](#rs-merge)\n    - [dedupe](#rs-dedupe)\n    - [serve](#rs-serve)\n    - [weights](#rs-weights)\n    - [compare](#rs-compare)\n    - [subset](#rs-subset)\n4. [Extending](#extending)\n    - [Bring your own imagery](#bring-your-own-imagery)\n    - [Bring your own masks](#bring-your-own-masks)\n    - [Add support for feature in pre-processing](#add-support-for-feature-in-pre-processing)\n    - [Add support for feature in post-processing](#add-support-for-feature-in-post-processing)\n5. [Contributing](#contributing)\n6. [License](#license)\n\n\n## Overview\n\nRoboSat is an end-to-end pipeline written in Python 3 for feature extraction from aerial and satellite imagery.\nFeatures can be anything visually distinguishable in the imagery for example: buildings, parking lots, roads, or cars.\n\nHave a look at\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F44145) where we first introduced RoboSat and show some results\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F44321) where we extract building footprints based on drone imagery in Tanzania\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F45042) where we summarize the v1.1 release\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F368726) where we summarize the v1.2 release\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F368771) where we run robosat v1.2 on aerial imagery for Bavaria, Germany\n- [this OpenStreetMap diary post](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fmaning\u002Fdiary\u002F44462) where [Maning](https:\u002F\u002Fgithub.com\u002Fmaning) runs robosat on imagery from the Philippines\n\nThe tools RoboSat comes with can be categorized as follows:\n- data preparation: creating a dataset for training feature extraction models\n- training and modeling: segmentation models for feature extraction in images\n- post-processing: turning segmentation results into cleaned and simple geometries\n\nTools work with the [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) tile format to abstract away geo-referenced imagery behind tiles of the same size.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_acf6f09b9dd0.png)\n\nThe data preparation tools help you with getting started creating a dataset for training feature extraction models.\nSuch a dataset consists of aerial or satellite imagery and corresponding masks for the features you want to extract.\nWe provide convenient tools to automatically create these datasets downloading aerial imagery from the [Mapbox](mapbox.com) Maps API and generating masks from [OpenStreetMap](openstreetmap.org) geometries but we are not bound to these sources.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_c9e53b8c3a11.png)\n\nThe modelling tools help you with training fully convolutional neural nets for segmentation.\nWe recommend using (potentially multiple) GPUs for these tools: we are running RoboSat on AWS p2\u002Fp3 instances and GTX 1080 TI GPUs.\nAfter you trained a model you can save its checkpoint and run prediction either on GPUs or CPUs.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_4a8f65021d29.png)\n\nThe post-processing tools help you with cleaning up the segmentation model's results.\nThey are responsible for denoising, simplifying geometries, transforming from pixels in Slippy Map tiles to world coordinates (GeoJSON features), and properly handling tile boundaries.\n\nIf this sounds almost like what you need, see the [extending section](#extending) for more details about extending RoboSat.\nIf you want to contribute, see the [contributing section](#contributing) for more details about getting involved with RoboSat.\n\n\n## Installation\n\nWe provide pre-built Docker images for both CPU as well as GPU environments on Docker Hub in [mapbox\u002Frobosat](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmapbox\u002Frobosat\u002Ftags\u002F).\n\nUsing a CPU container to show all available sub-commands\n\n    docker run -it --rm -v $PWD:\u002Fdata --ipc=host --network=host mapbox\u002Frobosat:latest-cpu --help\n\nUsing a GPU container (requires [nvidia-docker](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker) on the host) to train a model\n\n    docker run --runtime=nvidia -it --rm -v $PWD:\u002Fdata --ipc=host mapbox\u002Frobosat:latest-gpu train --model \u002Fdata\u002Fmodel.toml --dataset \u002Fdata\u002Fdataset.toml --workers 4\n\nArguments\n- `--runtime=nvidia` enables the nvidia-docker runtime for access to host GPUs\n- `--ipc=host`  is required for shared memory communication between workers\n- `--network=host`  is required for network communication in the download tool\n- `-v $PWD:\u002Fdata` makes the current directory on the host accessible at `\u002Fdata` in the container\n\nFor installation from source (requires installing dependencies) see the Dockerfiles in the [`docker\u002F`](docker) directory.\n\n\n## Usage\n\nThe following describes the tools making up the RoboSat pipeline.\nAll tools can be invoked via\n\n    .\u002Frs \u003Ctool> \u003Cargs>\n\nAlso see the sub-command help available via\n\n    .\u002Frs --help\n    .\u002Frs \u003Ctool> --help\n\nMost tools take a dataset or model configuration file. See examples in the [`configs`](.\u002Fconfig) directory.\nYou will need to adapt these configuration files to your own dataset, for example setting your tile resolution (e.g. 256x256 pixel).\nYou will also need to adapt these configuration files to your specific deployment setup, for example using CUDA and setting batch sizes.\n\n\n### rs extract\n\nExtracts GeoJSON features from OpenStreetMap to build a training set from.\n\nThe result of `rs extract` is a GeoJSON file with the extracted feature geometries.\n\nThe `rs extract` tool walks OpenStreetMap `.osm.pbf` base map files (e.g. from [Geofabrik](http:\u002F\u002Fdownload.geofabrik.de)) and gathers feature geometries.\nThese features are for example polygons for parking lots, buildings, or roads.\n\n\n### rs cover\n\nGenerates a list of tiles covering GeoJSON features to build a training set from.\n\nThe result of `rs cover` is a file with tiles in `(x, y, z)` [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) tile format covering GeoJSON features.\n\nThe `rs cover` tool reads in the GeoJSON features generated by `rs extract` and generates a list of tiles covering the feature geometries.\n\n\n### rs download\n\nDownloads aerial or satellite imagery from a Slippy Map endpoint (e.g. the Mapbox Maps API) based on a list of tiles.\n\nThe result of `rs download` is a Slippy Map directory with aerial or satellite images - the training set's images you will need for the model to learn on.\n\nThe `rs download` tool downloads images for a list of tiles in `(x, y, z)` [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) tile format generated by `rs cover`.\n\nThe `rs download` tool expects a Slippy Map endpoint where placeholders for `{x}`, `{y}`, and `{z}` are formatted with each tile's ids.\nFor example, for the Mapbox Maps API: `https:\u002F\u002Fapi.mapbox.com\u002Fv4\u002Fmapbox.satellite\u002F{z}\u002F{x}\u002F{y}@2x.webp?access_token=TOKEN`.\n\n\n### rs rasterize\n\nRasterizes GeoJSON features into mask images based on a list of tiles.\n\nThe result of `rs rasterize` is a Slippy Map directory with masks - the training set's masks you will need for the model to learn on.\n\nThe `rs rasterize` tool reads in GeoJSON features and rasterizes them into single-channel masks with a color palette attached for quick visual inspection.\n\n\n### rs train\n\nTrains a model on a training set made up of `(image, mask)` pairs.\n\nThe result of `rs train` is a checkpoint containing weights for the trained model.\n\nThe `rs train` tool trains a fully convolutional neural net for semantic segmentation on a dataset with `(image, mask)` pairs generated by `rs download` and `rs rasterize`.\nWe recommend using a GPU for training: we are working with the AWS p2 instances and GTX 1080 TI GPUs.\n\nBefore you can start training you need the following.\n\n- You need a dataset which you should split into three parts: training and validation for `rs train` to train on and to calculate validation metrics on and a hold-out dataset for final model evaluation. The dataset's directory need to look like the following.\n\n      dataset\n      ├── training\n      │   ├── images\n      │   └── labels\n      └── validation\n          ├── images\n          └── labels\n\n- You need to calculate label class weights with `rs weights` on the training set's labels\n\n- You need to add the path to the dataset's directory and the calculated class weights and statistics to the dataset config.\n\n\n### rs export\n\nExports a trained model in [ONNX](https:\u002F\u002Fonnx.ai\u002F) format for prediction across different backends (like Caffe2, TensorFlow).\n\nThe result of `rs export` is an ONNX GraphProto `.pb` file which can be used with the ONNX ecosystem.\n\nNote: the `rs predict` tool works with `.pth` checkpoints. In contrast to these `.pth` checkpoints the ONNX models neither depend on PyTorch or the Python code for the model class and can be used e.g. in resource constrained environments like AWS Lambda.\n\n\n### rs predict\n\nPredicts class probabilities for each image tile in a Slippy Map directory structure.\n\nThe result of `rs predict` is a Slippy Map directory with a class probability encoded in a `.png` file per tile.\n\nThe `rs predict` tool loads the checkpoint weights generated by `rs train` and predicts semantic segmentation class probabilities for a Slippy Map dataset consisting of image tiles.\n\n\n### rs masks\n\nGenerates segmentation masks for each class probability `.png` file in a Slippy Map directory structure.\n\nThe result of `rs masks` is a Slippy Map directory with one single-channel image per tile with a color palette attached for quick visual inspection.\n\nThe `rs masks` tool loads in the `.png` tile segmentation class probabilities generated by `rs predict` and turns them into segmentation masks.\nYou can merge multiple Slippy Map directories with class probabilities into a single mask using this tool in case you want to make use of an ensemble of models.\n\n\n### rs features\n\nExtracts simplified GeoJSON features for segmentation masks in a Slippy Map directory structure.\n\nThe result of `rs features` is a GeoJSON file with the extracted simplified features.\n\nThe `rs features` tool loads the segmentation masks generated by `rs masks` and turns them into simplified GeoJSON features.\n\n\n### rs merge\n\nMerges close adjacent GeoJSON features into single features.\n\nThe result of `rs merge` is a GeoJSON file with the merged features.\n\nThe `rs merge` tool loads GeoJSON features and depending on a threshold merges adjacent geometries together.\n\n\n### rs dedupe\n\nDeduplicates predicted features against existing OpenStreetMap features.\n\nThe result of `rs dedupe` is a GeoJSON file with predicted features which are not in OpenStreetMap.\n\nThe `rs dedupe` deduplicates predicted features against OpenStreetMap.\n\nNote: `rs extract` to generate a GeoJSON file with OpenStreetMap features.\n\n\n### rs serve\n\nServes tile masks by providing an on-demand segmentation tileserver.\n\nThe `rs serve` tool implements a Slippy Map raster tileserver requesting satellite tiles and applying the segmentation model on the fly.\n\nNotes: useful for visually inspecting the raw segmentation masks on the fly; for serious use-cases use `rs predict` and similar.\n\n\n### rs weights\n\nCalculates class weights for a Slippy Map directory with masks.\n\nThe result of `rs weights` is a list of class weights useful for `rs train` to adjust the loss based on the class distribution in the masks.\n\nThe `rs weights` tool computes the pixel-wise class distribution on the training dataset's masks and outputs weights for training.\n\n\n### rs compare\n\nPrepares images, labels and predicted masks, side-by-side for visual comparison.\n\nThe result of `rs compare` is a Slippy Map directory with images that have the raw image on the left, the label in the middle and the prediction on the right.\n\n\n### rs subset\n\nFilters a Slippy Map directory based on a list of tile ids.\n\nThe result of `rs subset` is a Slippy Map directory filtered by tile ids.\n\nThe main use-case for this tool is hard-negative mining where we want to filter false positives from a prediction run.\n\n\n## Extending\n\nThere are multiple ways to extend RoboSat for your specific use-cases.\nBy default we use [Mapbox](mapbox.com) aerial imagery from the Maps API and feature masks generated from [OpenStreetMap](openstreetmap.org) geometries.\nIf you want to bring your own imagery, masks, or features to extract, the following will get you started.\n\n### Bring your own imagery\n\nRoboSat's main abstraction is the [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) tile format.\nAs long as your imagery is geo-referenced and you can convert it to a Slippy Map directory structure to point the command lines to, you are good to go.\nMake sure imagery and masks are properly aligned.\n\n### Bring your own masks\n\nRoboSat's main abstraction is the [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) tile format.\nAs long as you can convert your masks to a Slippy Map directory structure to point the command lines to, you are good to go.\nMasks have to be single-channel `.png` files with class indices starting from zero.\nMake sure imagery and masks are properly aligned.\n\n### Add support for feature in pre-processing\n\nPre-processing (`rs extract`) is responsible for turning OpenStreetMap geometries and tags into polygon feature masks.\nIf you want to add a new feature based on geometries in OpenStreetMap you have to:\n- Implement an [osmium](https:\u002F\u002Fdocs.osmcode.org\u002Fpyosmium\u002Flatest\u002F) handler which turns OpenStreetMap geometries into polygons; see [`robosat\u002Fosm\u002F`](.\u002Frobosat\u002Fosm\u002F) for existing handlers.\n- Import and register your handler in [`robosat\u002Ftools\u002Fextract.py`](.\u002Frobosat\u002Ftools\u002Fextract.py).\n\nAnd that's it! From there on the pipeline is fully generic.\n\n### Add support for feature in post-processing\n\nPost-processing (`rs features`) is responsible for turning segmentation masks into simplified GeoJSON features.\nIf you want to add custom post-processing for segmentation masks you have to:\n- Implement a featurize handler turning masks into GeoJSON features; see [`robosat\u002Ffeatures\u002F`](.\u002Frobosat\u002Ffeatures\u002F) for existing handlers.\n- Import and register your handler in [`robosat\u002Ftools\u002Ffeatures.py`](.\u002Frobosat\u002Ftools\u002Ffeatures.py).\n\nAnd that's it! From there on the pipeline is fully generic.\n\n\n## Contributing\n\nWe are thankful for contributions and are happy to help; that said there are some constraints to take into account:\n- For non-trivial changes you should open a ticket first to outline and discuss ideas and implementation sketches. If you just send us a pull request with thousands of lines of changes we most likely won't accept your changeset.\n- We follow the 80\u002F20 rule where 80% of the effects come from 20% of the causes: we strive for simplicity and maintainability over pixel-perfect results. If you can improve the model's accuracy by two percent points but have to add thousands of lines of code we most likely won't accept your changeset.\n- We take responsibility for changesets going into master: as soon as your changeset gets approved it is on us to maintain and debug it. If your changeset can not be tested, or maintained in the future by the core developers we most likely won't accept your changeset.\n\n\n## License\n\nCopyright (c) 2018 Mapbox\n\nDistributed under the MIT License (MIT).\n","**注意：Robosat 已不再由 Mapbox 维护或积极开发。请参阅[此问题](https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F184)。  \n主要开发者（[@daniel-j-h](https:\u002F\u002Fgithub.com\u002Fdaniel-j-h)，[@bkowshik](https:\u002F\u002Fgithub.com\u002Fbkowshik)）已离开 Mapbox。**\n\n\u003Ch1 align='center'>RoboSat\u003C\u002Fh1>\n\n\u003Cp align=center>\n  用于从航空和卫星影像中提取特征的通用生态系统\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_5cb0408e7145.png\" alt=\"RoboSat 流程从航空影像中提取建筑物\" \u002F>\n  \u003Ci>柏林航空影像、分割掩膜、建筑物轮廓线、简化的 GeoJSON 多边形\u003C\u002Fi>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002Fmapbox\u002Frobosat\">\u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002Fmapbox\u002Frobosat.svg?branch=master\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\n\n## 目录\n\n1. [概述](#overview)\n2. [安装](#installation)\n3. [使用](#usage)\n    - [extract](#rs-extract)\n    - [cover](#rs-cover)\n    - [download](#rs-download)\n    - [rasterize](#rs-rasterize)\n    - [train](#rs-train)\n    - [export](#rs-export)\n    - [predict](#rs-predict)\n    - [mask](#rs-mask)\n    - [features](#rs-features)\n    - [merge](#rs-merge)\n    - [dedupe](#rs-dedupe)\n    - [serve](#rs-serve)\n    - [weights](#rs-weights)\n    - [compare](#rs-compare)\n    - [subset](#rs-subset)\n4. [扩展](#extending)\n    - [使用自有影像](#bring-your-own-imagery)\n    - [使用自有掩膜](#bring-your-own-masks)\n    - [在预处理中添加对新特征的支持](#add-support-for-feature-in-pre-processing)\n    - [在后处理中添加对新特征的支持](#add-support-for-feature-in-post-processing)\n5. [贡献](#contributing)\n6. [许可证](#license)\n\n\n## 概述\n\nRoboSat 是一个用 Python 3 编写的端到端流程，用于从航空和卫星影像中提取特征。  \n这些特征可以是影像中任何视觉上可区分的对象，例如建筑物、停车场、道路或汽车。\n\n请查看：\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F44145)，我们首次介绍了 RoboSat 并展示了一些结果；\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F44321)，我们基于坦桑尼亚的无人机影像提取了建筑物轮廓；\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F45042)，我们总结了 v1.1 版本的发布；\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F368726)，我们总结了 v1.2 版本的发布；\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fdaniel-j-h\u002Fdiary\u002F368771)，我们使用 RoboSat v1.2 对德国巴伐利亚的航空影像进行了处理；\n- [这篇 OpenStreetMap 日记文章](https:\u002F\u002Fwww.openstreetmap.org\u002Fuser\u002Fmaning\u002Fdiary\u002F44462)，[Maning](https:\u002F\u002Fgithub.com\u002Fmaning) 使用 RoboSat 处理了来自菲律宾的影像。\n\nRoboSat 提供的工具可分为以下几类：\n- 数据准备：创建用于训练特征提取模型的数据集；\n- 训练与建模：用于图像中特征提取的分割模型；\n- 后处理：将分割结果转换为干净且简单的几何图形。\n\n这些工具使用 [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 的瓦片格式，将地理参考影像抽象为大小相同的瓦片。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_acf6f09b9dd0.png)\n\n数据准备工具帮助您开始创建用于训练特征提取模型的数据集。  \n此类数据集由航空或卫星影像以及您希望提取的特征对应的掩膜组成。  \n我们提供了便捷的工具来自动创建这些数据集，即从 [Mapbox](mapbox.com) Maps API 下载航空影像，并从 [OpenStreetMap](openstreetmap.org) 几何数据中生成掩膜，但并不局限于这些数据源。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_c9e53b8c3a11.png)\n\n建模工具帮助您训练用于分割的全卷积神经网络。  \n我们建议使用（可能多个）GPU 来运行这些工具：我们已经在 AWS p2\u002Fp3 实例和 GTX 1080 TI GPU 上运行 RoboSat。  \n训练好模型后，您可以保存其检查点，并在 GPU 或 CPU 上进行预测。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_readme_4a8f65021d29.png)\n\n后处理工具帮助您清理分割模型的结果。  \n它们负责去噪、简化几何形状、将 Slippy Map 瓦片中的像素坐标转换为世界坐标（GeoJSON 特征），以及正确处理瓦片边界。\n\n如果您觉得这几乎就是您所需要的，请参阅[扩展部分](#extending)，了解更多关于扩展 RoboSat 的信息。  \n如果您想参与贡献，请参阅[贡献部分](#contributing)，了解如何参与 RoboSat 的开发。\n\n\n## 安装\n\n我们在 Docker Hub 的 [mapbox\u002Frobosat](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmapbox\u002Frobosat\u002Ftags\u002F) 中提供了适用于 CPU 和 GPU 环境的预构建 Docker 镜像。\n\n使用 CPU 容器显示所有可用子命令：\n\n    docker run -it --rm -v $PWD:\u002Fdata --ipc=host --network=host mapbox\u002Frobosat:latest-cpu --help\n\n使用 GPU 容器（需要主机上安装 [nvidia-docker](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker)）训练模型：\n\n    docker run --runtime=nvidia -it --rm -v $PWD:\u002Fdata --ipc=host mapbox\u002Frobosat:latest-gpu train --model \u002Fdata\u002Fmodel.toml --dataset \u002Fdata\u002Fdataset.toml --workers 4\n\n参数说明：\n- `--runtime=nvidia` 启用 nvidia-docker 运行时，以访问主机上的 GPU；\n- `--ipc=host` 是工作进程之间共享内存通信所必需的；\n- `--network=host` 是下载工具进行网络通信所必需的；\n- `-v $PWD:\u002Fdata` 将主机上的当前目录挂载到容器内的 `\u002Fdata` 路径下。\n\n如需从源代码安装（需先安装依赖项），请参阅 [`docker\u002F`](docker) 目录中的 Dockerfile。\n\n\n## 使用\n\n以下介绍构成 RoboSat 流程的各个工具。  \n所有工具均可通过以下方式调用：\n\n    .\u002Frs \u003Ctool> \u003Cargs>\n\n您还可以通过以下命令查看各子命令的帮助信息：\n\n    .\u002Frs --help\n    .\u002Frs \u003Ctool> --help\n\n大多数工具都需要一个数据集或模型配置文件。示例可在 [`configs`](.\u002Fconfig) 目录中找到。  \n您需要根据自己的数据集调整这些配置文件，例如设置瓦片分辨率（如 256x256 像素）。  \n此外，您还需要根据具体的部署环境调整这些配置文件，例如使用 CUDA 并设置批处理大小。\n\n\n### rs extract\n\n从 OpenStreetMap 中提取 GeoJSON 特征，以构建训练数据集。\n\n`rs extract` 的结果是一个包含提取特征几何的 GeoJSON 文件。\n\n`rs extract` 工具会遍历 OpenStreetMap `.osm.pbf` 基础地图文件（例如来自 [Geofabrik](http:\u002F\u002Fdownload.geofabrik.de)），并收集特征几何。  \n这些特征包括停车场、建筑物或道路等多边形。\n\n### rs cover\n\n生成覆盖 GeoJSON 特征的瓦片列表，用于构建训练集。\n\n`rs cover` 的输出是一个文件，其中包含以 `(x, y, z)` [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 瓦片格式表示的、覆盖 GeoJSON 特征的瓦片。\n\n`rs cover` 工具会读取由 `rs extract` 生成的 GeoJSON 特征，并生成一个覆盖这些特征几何体的瓦片列表。\n\n\n### rs download\n\n根据瓦片列表从 Slippy Map 端点（例如 Mapbox Maps API）下载航空或卫星影像。\n\n`rs download` 的输出是一个包含航空或卫星图像的 Slippy Map 目录——这是模型训练所需的训练集图像。\n\n`rs download` 工具会下载由 `rs cover` 生成的、以 `(x, y, z)` [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 瓦片格式表示的瓦片列表对应的图像。\n\n`rs download` 工具需要一个 Slippy Map 端点，该端点中的 `{x}`、`{y}` 和 `{z}` 占位符应使用每个瓦片的 ID 进行格式化。\n例如，对于 Mapbox Maps API：`https:\u002F\u002Fapi.mapbox.com\u002Fv4\u002Fmapbox.satellite\u002F{z}\u002F{x}\u002F{y}@2x.webp?access_token=TOKEN`。\n\n\n### rs rasterize\n\n根据瓦片列表将 GeoJSON 特征栅格化为掩码图像。\n\n`rs rasterize` 的输出是一个包含掩码的 Slippy Map 目录——这是模型训练所需的训练集掩码。\n\n`rs rasterize` 工具会读取 GeoJSON 特征，并将其栅格化为单通道掩码，同时附带调色板以便快速目视检查。\n\n\n### rs train\n\n在由 `(image, mask)` 对组成的训练集上训练模型。\n\n`rs train` 的输出是一个包含已训练模型权重的检查点。\n\n`rs train` 工具会在由 `rs download` 和 `rs rasterize` 生成的 `(image, mask)` 数据集上训练一个用于语义分割的全卷积神经网络。\n我们建议使用 GPU 进行训练：我们正在使用 AWS p2 实例和 GTX 1080 TI 显卡。\n\n在开始训练之前，您需要准备以下内容。\n\n- 您需要一个数据集，将其分为三部分：用于 `rs train` 训练和计算验证指标的训练集和验证集，以及用于最终模型评估的保留数据集。数据集目录应如下所示：\n\n      dataset\n      ├── training\n      │   ├── images\n      │   └── labels\n      └── validation\n          ├── images\n          └── labels\n\n- 您需要使用 `rs weights` 在训练集的标签上计算类别权重。\n\n- 您需要将数据集目录路径以及计算出的类别权重和统计信息添加到数据集配置中。\n\n\n### rs export\n\n将训练好的模型导出为 [ONNX](https:\u002F\u002Fonnx.ai\u002F) 格式，以便在不同后端（如 Caffe2、TensorFlow）上进行预测。\n\n`rs export` 的输出是一个 ONNX GraphProto `.pb` 文件，可用于 ONNX 生态系统。\n\n注意：`rs predict` 工具使用 `.pth` 检查点。与这些 `.pth` 检查点不同，ONNX 模型不依赖 PyTorch 或模型类的 Python 代码，因此可以在资源受限的环境（如 AWS Lambda）中使用。\n\n\n### rs predict\n\n对 Slippy Map 目录结构中的每个图像瓦片预测类别概率。\n\n`rs predict` 的输出是一个 Slippy Map 目录，其中每个瓦片都包含一个编码了类别概率的 `.png` 文件。\n\n`rs predict` 工具会加载由 `rs train` 生成的检查点权重，并对由图像瓦片组成的 Slippy Map 数据集进行语义分割类别概率预测。\n\n\n### rs masks\n\n为 Slippy Map 目录结构中的每个包含类别概率的 `.png` 文件生成分割掩码。\n\n`rs masks` 的输出是一个 Slippy Map 目录，其中每个瓦片都有一张带有调色板的单通道图像，便于快速目视检查。\n\n`rs masks` 工具会加载由 `rs predict` 生成的 `.png` 瓦片分割类别概率，并将其转换为分割掩码。\n如果您希望使用多个模型的集成，可以使用此工具将包含类别概率的多个 Slippy Map 目录合并为一个掩码。\n\n\n### rs features\n\n提取 Slippy Map 目录结构中用于分割掩码的简化 GeoJSON 特征。\n\n`rs features` 的输出是一个包含提取的简化特征的 GeoJSON 文件。\n\n`rs features` 工具会加载由 `rs masks` 生成的分割掩码，并将其转换为简化的 GeoJSON 特征。\n\n\n### rs merge\n\n将彼此靠近的相邻 GeoJSON 特征合并为单个特征。\n\n`rs merge` 的输出是一个包含合并后特征的 GeoJSON 文件。\n\n`rs merge` 工具会加载 GeoJSON 特征，并根据阈值将相邻的几何体合并在一起。\n\n\n### rs dedupe\n\n将预测的特征与现有的 OpenStreetMap 特征去重。\n\n`rs dedupe` 的输出是一个包含不在 OpenStreetMap 中的预测特征的 GeoJSON 文件。\n\n`rs dedupe` 会将预测的特征与 OpenStreetMap 进行去重。\n注：使用 `rs extract` 可以生成包含 OpenStreetMap 特征的 GeoJSON 文件。\n\n\n### rs serve\n\n通过提供按需分割瓦片服务器来服务瓦片掩码。\n\n`rs serve` 工具实现了一个 Slippy Map 栅格瓦片服务器，该服务器请求卫星瓦片并实时应用分割模型。\n\n注：这对于实时目视检查原始分割掩码很有用；对于实际应用场景，请使用 `rs predict` 等工具。\n\n\n### rs weights\n\n计算包含掩码的 Slippy Map 目录的类别权重。\n\n`rs weights` 的输出是一个类别权重列表，可用于 `rs train` 根据掩码中的类别分布调整损失函数。\n\n\n### rs compare\n\n准备图像、标签和预测掩码，以便并排进行目视比较。\n\n`rs compare` 的输出是一个 Slippy Map 目录，其中左侧是原始图像，中间是标签，右侧是预测结果。\n\n\n### rs subset\n\n根据瓦片 ID 列表筛选 Slippy Map 目录。\n\n`rs subset` 的输出是一个按瓦片 ID 筛选后的 Slippy Map 目录。\n\n该工具的主要用途是硬负样本挖掘，即从一次预测运行中筛选出假阳性样本。\n\n\n## 扩展\n\n有多种方式可以针对您的特定用例扩展 RoboSat。\n默认情况下，我们使用来自 Maps API 的 [Mapbox](mapbox.com) 航空影像，以及基于 [OpenStreetMap](openstreetmap.org) 几何体生成的特征掩码。\n如果您想引入自己的影像、掩码或要提取的特征，以下内容将帮助您入门。\n\n### 引入您自己的影像\n\nRoboSat 的主要抽象是 [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 瓦片格式。\n只要您的影像具有地理参考，并且可以将其转换为 Slippy Map 目录结构以供命令行指向，您就可以开始使用。\n请确保影像和掩码正确对齐。\n\n### 请自备口罩\n\nRoboSat 的主要抽象是 [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 平铺格式。\n只要能将你的掩码转换为 Slippy Map 目录结构，并让命令行指向该结构，就可以开始使用了。\n掩码必须是单通道 `.png` 文件，类索引从零开始。\n请确保影像和掩码正确对齐。\n\n### 在预处理中添加对新要素的支持\n\n预处理（`rs extract`）负责将 OpenStreetMap 的几何和标签转换为多边形要素掩码。\n如果你想基于 OpenStreetMap 中的几何添加一个新要素，你需要：\n- 实现一个 [osmium](https:\u002F\u002Fdocs.osmcode.org\u002Fpyosmium\u002Flatest\u002F) 处理器，将 OpenStreetMap 的几何转换为多边形；现有处理器可参见 [`robosat\u002Fosm\u002F`](.\u002Frobosat\u002Fosm\u002F)。\n- 将你的处理器导入并注册到 [`robosat\u002Ftools\u002Fextract.py`](.\u002Frobosat\u002Ftools\u002Fextract.py) 中。\n\n仅此而已！此后整个流水线都是通用的。\n\n### 在后处理中添加对新要素的支持\n\n后处理（`rs features`）负责将分割掩码转换为简化的 GeoJSON 要素。\n如果你想为分割掩码添加自定义后处理，你需要：\n- 实现一个要素化处理器，将掩码转换为 GeoJSON 要素；现有处理器可参见 [`robosat\u002Ffeatures\u002F`](.\u002Frobosat\u002Ffeatures\u002F)。\n- 将你的处理器导入并注册到 [`robosat\u002Ftools\u002Ffeatures.py`](.\u002Frobosat\u002Ftools\u002Ffeatures.py) 中。\n\n仅此而已！此后整个流水线都是通用的。\n\n\n## 贡献说明\n\n我们非常感谢大家的贡献，并乐于提供帮助；不过也需要注意以下几点限制：\n- 对于非 trivial 的更改，你应该先创建一个 issue 来概述和讨论你的想法及实现草图。如果你直接提交包含数千行代码的 pull request，我们很可能不会接受你的更改集。\n- 我们遵循 80\u002F20 法则，即 80% 的效果来自 20% 的原因：我们更注重简洁性和可维护性，而非追求像素级的完美结果。如果你能将模型准确率提高两个百分点，但需要增加数千行代码，我们很可能不会接受你的更改集。\n- 我们会对合并到 master 分支的更改集承担责任：一旦你的更改集被批准，后续的维护和调试工作就由我们负责。如果你的更改集无法被测试，或未来难以由核心开发者维护，我们很可能不会接受你的更改集。\n\n\n## 许可证\n\n版权所有 © 2018 Mapbox\n\n根据 MIT 许可证（MIT）发布。","# RoboSat 快速上手指南\n\n> **重要提示**：RoboSat 目前已不再由 Mapbox 维护或积极开发（主要开发者已离职）。本项目适用于学习卫星\u002F航拍图像特征提取原理或作为历史参考。生产环境请谨慎评估。\n\nRoboSat 是一个基于 Python 3 的端到端流水线工具，用于从航拍和卫星图像中提取地理特征（如建筑物、道路、停车场等）。它利用深度学习进行语义分割，并将结果转换为 GeoJSON 格式。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**：Linux (推荐 Ubuntu 18.04+) 或 macOS\n- **硬件**：\n  - **训练阶段**：强烈建议使用 NVIDIA GPU (如 GTX 1080 Ti 或更高)，需安装 CUDA 驱动。\n  - **推理阶段**：CPU 即可运行，但速度较慢。\n- **软件依赖**：\n  - Docker 及 Docker Compose (推荐方式)\n  - 或 Python 3.6+ (若从源码安装)\n\n### 前置知识\n- 了解 [Slippy Map](https:\u002F\u002Fwiki.openstreetmap.org\u002Fwiki\u002FSlippy_map_tilenames) 瓦片格式 `(x, y, z)`。\n- 拥有地图数据源访问权限（如 Mapbox Token 或本地 OSM `.osm.pbf` 文件）。\n\n## 2. 安装步骤\n\n推荐使用官方提供的 Docker 镜像，以避免复杂的环境依赖配置。\n\n### 方案 A：使用 Docker (推荐)\n\nMapbox 提供了预构建的 CPU 和 GPU 镜像。\n\n**1. 拉取镜像**\n```bash\n# CPU 版本\ndocker pull mapbox\u002Frobosat:latest-cpu\n\n# GPU 版本 (需主机安装 nvidia-docker)\ndocker pull mapbox\u002Frobosat:latest-gpu\n```\n\n**2. 验证安装**\n运行以下命令查看可用子命令：\n```bash\ndocker run -it --rm -v $PWD:\u002Fdata --ipc=host --network=host mapbox\u002Frobosat:latest-cpu --help\n```\n\n### 方案 B：从源码安装 (仅限高级用户)\n若需修改代码，可参考仓库中 `docker\u002F` 目录下的 Dockerfile 手动安装依赖（PyTorch, GDAL, Shapely 等）。\n\n## 3. 基本使用流程\n\nRoboSat 的核心工作流分为：**数据准备 -> 模型训练 -> 预测与后处理**。所有命令通过 `.\u002Frs \u003Ctool> \u003Cargs>` 调用（在 Docker 中则为 `docker run ... mapbox\u002Frobosat \u003Ctool> \u003Cargs>`）。\n\n以下是一个简化的典型工作流示例：\n\n### 第一步：数据准备 (Data Preparation)\n\n你需要生成训练数据集，包含“图像”和对应的“标签掩膜”。\n\n1.  **提取特征 (`rs extract`)**\n    从 OpenStreetMap (`.osm.pbf`) 文件中提取目标特征（如建筑物）的 GeoJSON。\n    ```bash\n    .\u002Frs extract --config=configs\u002Fosm-extract.toml --output=features.geojson input.osm.pbf\n    ```\n\n2.  **生成瓦片覆盖列表 (`rs cover`)**\n    计算覆盖上述 GeoJSON 特征所需的地图瓦片列表。\n    ```bash\n    .\u002Frs cover --config=configs\u002Fcover.toml --input=features.geojson --output=tiles.txt\n    ```\n\n3.  **下载影像 (`rs download`)**\n    根据瓦片列表下载卫星图（需配置 Mapbox API URL 和 Token）。\n    ```bash\n    .\u002Frs download --config=configs\u002Fdownload.toml --tiles=tiles.txt --output=dataset\u002Fimages\n    ```\n\n4.  **生成掩膜 (`rs rasterize`)**\n    将 GeoJSON 特征渲染为与下载图像对应的单通道掩膜图片。\n    ```bash\n    .\u002Frs rasterize --config=configs\u002Frasterize.toml --input=features.geojson --tiles=tiles.txt --output=dataset\u002Flabels\n    ```\n\n*注：请将数据集划分为 `training` 和 `validation` 目录结构。*\n\n### 第二步：模型训练 (Training)\n\n使用准备好的 `(image, mask)` 对训练分割模型。\n\n1.  **计算类别权重 (`rs weights`)**\n    分析训练集标签，计算类别权重以平衡样本。\n    ```bash\n    .\u002Frs weights --config=configs\u002Fdataset.toml --dataset=dataset\u002Ftraining\u002Flabels\n    ```\n\n2.  **开始训练 (`rs train`)**\n    启动训练过程（建议使用 GPU 容器）。\n    ```bash\n    docker run --runtime=nvidia -it --rm -v $PWD:\u002Fdata --ipc=host mapbox\u002Frobosat:latest-gpu \\\n      train --model \u002Fdata\u002Fmodel.toml --dataset \u002Fdata\u002Fdataset.toml --workers 4\n    ```\n    *输出：生成包含模型权重的 checkpoint 文件。*\n\n### 第三步：预测与导出 (Prediction & Post-processing)\n\n使用训练好的模型对新区域进行预测并生成最终的 GeoJSON。\n\n1.  **预测概率 (`rs predict`)**\n    对新的影像瓦片目录进行推理，输出每个像素的类别概率图。\n    ```bash\n    .\u002Frs predict --model=model_checkpoint.pth --dataset=predict_images_dir --output=predict_probs\n    ```\n\n2.  **生成掩膜 (`rs masks`)**\n    将概率图转换为二值化或单通道分割掩膜。\n    ```bash\n    .\u002Frs masks --probs=predict_probs --output=predict_masks\n    ```\n\n3.  **提取矢量特征 (`rs features`)**\n    从掩膜中提取简化的 GeoJSON 多边形。\n    ```bash\n    .\u002Frs features --masks=predict_masks --output=result_raw.geojson\n    ```\n\n4.  **后处理优化**\n    - **合并相邻要素**：`.\u002Frs merge --input=result_raw.geojson --output=result_merged.geojson`\n    - **去重（对比现有 OSM 数据）**：`.\u002Frs dedupe --input=result_merged.geojson --reference=osm_features.geojson --output=final_new_features.geojson`\n\n## 配置说明\n所有工具均依赖 `.toml` 配置文件。在使用前，请复制 `configs\u002F` 目录下的示例文件，并根据实际情况修改：\n- **瓦片分辨率** (如 256x256)\n- **API 地址与 Token** (下载影像用)\n- **超参数** (批次大小、学习率、GPU 设置等)\n\n详细参数请参考各子命令的 `--help` 输出或 `configs` 目录中的示例。","某非政府组织（NGO）急需在坦桑尼亚偏远地区更新地图数据，以支持灾后救援物资的精准投放，但当地缺乏详细的建筑物和道路矢量数据。\n\n### 没有 robosat 时\n- 依赖人工目视解译高分辨率无人机影像，数名分析师耗时数周才能勾勒出一个村庄的建筑轮廓，效率极低。\n- 手动数字化过程中难免出现人为误差，导致建筑物边界不贴合实际，且不同人员绘制的标准难以统一。\n- 面对海量卫星图块，无法快速批量处理，导致地图更新速度远远滞后于灾区实际需求的变化。\n- 缺乏自动化的后处理流程，生成的几何图形杂乱破碎，需要额外花费大量时间进行人工清洗和拓扑修复。\n\n### 使用 robosat 后\n- 利用 `download` 和 `rasterize` 快速构建训练集，并通过 `train` 训练语义分割模型，全自动从航拍图中提取建筑物和道路，将处理时间从数周缩短至数小时。\n- 基于深度学习的像素级分割确保了提取特征的高精度，`features` 命令直接生成简化的 GeoJSON 多边形，边界紧密贴合真实地物。\n- 借助对 Slippy Map 瓦片格式的原生支持，轻松并行处理覆盖整个省份的卫星影像，实现大规模区域的快速制图。\n- 内置的 `merge` 和 `dedupe` 工具自动合并相邻瓦片结果并去除重复项，直接输出干净、可用的矢量数据，无缝导入 OpenStreetMap。\n\nrobosat 将原本劳动密集型的地图绘制工作转化为高效的自动化流水线，让救援团队能在灾难发生后的黄金时间内获得准确的地理情报。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmapbox_robosat_c9e53b8c.png","mapbox","Mapbox","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmapbox_207f27ed.png","Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world. ",null,"https:\u002F\u002Fwww.mapbox.com","https:\u002F\u002Fgithub.com\u002Fmapbox",[83,87,91,95],{"name":84,"color":85,"percentage":86},"Python","#3572A5",97.6,{"name":88,"color":89,"percentage":90},"HTML","#e34c26",1.8,{"name":92,"color":93,"percentage":94},"Makefile","#427819",0.6,{"name":96,"color":97,"percentage":98},"Shell","#89e051",0,2055,388,"2026-04-03T12:06:23","MIT",4,"Linux","训练阶段推荐需要 NVIDIA GPU (文中提及使用 AWS p2\u002Fp3 实例及 GTX 1080 TI)；预测阶段可在 CPU 或 GPU 上运行。需安装 nvidia-docker 以在容器中使用 GPU。具体显存大小和 CUDA 版本未在文中明确说明。","未说明 (但使用 --ipc=host 参数暗示多进程训练需要较大的共享内存)",{"notes":108,"python":109,"dependencies":110},"1. 该项目已不再由 Mapbox 维护或积极开发。2. 官方推荐使用预构建的 Docker 镜像进行部署，分为 CPU 和 GPU 两个版本。3. 运行 GPU 容器时需添加 --runtime=nvidia 和 --ipc=host 参数。4. 工具链基于 Slippy Map 瓦片格式处理航拍和卫星图像。5. 支持将模型导出为 ONNX 格式以便在无 Python\u002FPyTorch 环境（如 AWS Lambda）中运行。","Python 3",[111,112,113,114],"Docker","nvidia-docker (GPU 环境必需)","PyTorch (隐含，用于 .pth 检查点)","ONNX (用于模型导出)",[13,14],[117,118,119,120,121],"satellite-imagery","aerial-imagery","machine-learning","segmentation","openstreetmap","2026-03-27T02:49:30.150509","2026-04-06T06:44:03.840936",[125,130,135,139,144,149,153],{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},10157,"如何在显存较小（如 1GB-2GB）的 GPU 上解决“内存不足”（Out of Memory）错误？","可以通过减小批次大小（batch_size=1）和分割图像瓦片来解决。具体步骤：\n1. 在 model.toml 中设置 batch_size = 1。\n2. 使用脚本将大图分割为更小的瓦片（例如从 512x512 分割为 256x256 或 32x32）。\n3. 如果仍然无法运行，可以尝试在 CPU 上进行训练（安装 CPU 版 torch 并设置 cuda = false），而在 GPU 上进行预测（predict），因为预测所需的显存较少（约 300MB）且速度更快。","https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F131",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},10158,"如何在 Docker 容器外正确运行 `rs` 命令？遇到\"command not found\"怎么办？","`rs` 命令通常需要在 Docker 容器内部运行，或者确保环境变量已正确配置。如果直接在宿主机运行报错，请尝试使用完整的 Docker 运行命令：\n`docker run -it --rm -v $PWD:\u002Fdata --ipc=host --network=host mapbox\u002Frobosat:latest-cpu \u003Ccommand>`\n确保将 `\u003Ccommand>` 替换为你需要执行的具体 robosat 指令（如 `--help`, `train`, `predict` 等）。不要试图在宿主机直接调用 `rs`，除非你手动安装了所有依赖并配置了 PATH。","https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F201",{"id":136,"question_zh":137,"answer_zh":138,"source_url":134},10159,"如何监控 RoboSat 运行时的资源使用情况以排查性能问题？","建议使用以下工具监控系统资源：\n1. 监控 GPU：使用 `nvidia-smi` 或 `nvtop` 查看显存使用和 GPU 利用率。\n2. 监控 CPU、内存和交换空间：使用 `htop`，特别留意是否发生了内存交换（swapping）。\n3. 监控磁盘 I\u002FO：使用 `iotop` 查看读写速度。\n这些工具能帮助判断瓶颈是在计算、内存还是磁盘 IO 上。",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},10160,"运行 `.\u002Frs cover` 处理道路数据时报错 \"IndexError: too many indices for array\" 如何解决？","该错误通常由提取过程中产生的空几何特征（null features \u002F POLYGON EMPTY）引起。这可能是因为某些道路标签（如 `highway=service` 且 `lanes=0`）导致计算出的道路宽度为 0，从而生成空多边形。\n解决方案：\n1. 确保使用的是已修复此问题的版本（参考 PR #119）。\n2. 检查输入的 GeoJSON 文件，过滤掉坐标为空或几何体无效的特征，确保传递给 `cover` 命令的数据不包含空对象。","https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F114",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},10161,"如何使用本地已有的 GeoTIFF 图像进行离线处理？","RoboSat 主要设计用于处理切片地图（slippy map tiles）。若要从本地 GeoTIFF 开始：\n1. 需要将 GeoTIFF 转换为程序可读取的瓦片格式（通常是 PNG 或 JPEG 的目录结构）。\n2. 关于是否需要完整场景或多块拼接，取决于你的训练策略，但通常模型是在固定大小的瓦片上训练的。\n3. 对于离线处理，需确保所有依赖数据和模型权重已下载到本地，并在配置文件中禁用网络请求。目前官方文档对直接从 GeoTIFF 导入的详细指南较少，可能需要编写自定义脚本进行格式转换。","https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat\u002Fissues\u002F200",{"id":150,"question_zh":151,"answer_zh":152,"source_url":148},10162,"如果已经有了分割好的分类图像（如 PNG 格式的建筑掩膜），如何将其转换为 GeoJSON 或 Shapefile？","你可以直接使用 RoboSat 的后处理工具 `rs features`。虽然早期版本可能主要支持 `parking` 类型，但该工具的核心功能是将二值掩膜图像矢量化。\n使用方法大致为：\n`.\u002Frs features --type \u003Cyour_type> --dataset \u003Cconfig_file> \u003Cmasks_directory> \u003Coutput.geojson>`\n注意：如果命令行参数限制了你想要的类型（如 building），可能需要修改源码中的 `handlers` 映射或使用通用的后处理逻辑，确保输入掩膜的标签与配置文件中的定义一致。",{"id":154,"question_zh":155,"answer_zh":156,"source_url":134},10163,"RoboSat 是否支持提取水体（water）特征？","RoboSat 可以扩展用于提取任意 OpenStreetMap 特征，包括水体。虽然默认示例可能集中在建筑和道路上，但你可以通过自定义配置来训练水体模型。此外，对于水体提取，推荐参考现有的解决方案，例如 Sentinel 卫星场景分类掩膜（Sentinel scene classification mask），它们通常已经包含了高质量的水体分类数据，可作为训练标签或直接使用。",[158,163],{"id":159,"version":160,"summary_zh":161,"released_at":162},107435,"v1.2.0","This release brings incredible new features and improvements from the\r\ncommunity accumulated over the last months. We recommend to upgrade.\r\n\r\nThe pre-built docker images are the recommended way of using robosat:\r\n- https:\u002F\u002Fgithub.com\u002Fmapbox\u002Frobosat#installation\r\n- https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmapbox\u002Frobosat\u002F\r\n\r\nChanges\r\n\r\n- `rs train`: state of the art losses and metrics. Lovasz loss as default,\r\n  many many more small features and fixes in training and related tools.\r\n  Thanks https:\u002F\u002Fgithub.com\u002Focourtin\r\n\r\n- `rs extract`: fully automatated road training dataset creation\r\n  Thanks https:\u002F\u002Fgithub.com\u002FDragonEmperorG\r\n\r\n- `rs extract`: batch feature extraction for datasets too big for memory\r\n  Thanks http:\u002F\u002Fgithub.com\u002Fdaniel-j-h\r\n\r\n- `rs rasterize`: batch rasterization for datasets too big for memory\r\n  Thanks http:\u002F\u002Fgithub.com\u002Fdaniel-j-h\r\n\r\n- Infrastructure: improved docker images, pre-trained weights in images,\r\n  upgrades to CUDA 10.1, cudnn 7, and pytorch 1.1.\r\n  Thanks http:\u002F\u002Fgithub.com\u002Fdaniel-j-h\r\n","2019-06-01T01:08:44",{"id":164,"version":165,"summary_zh":166,"released_at":167},107436,"v1.1.0","Changes\r\n\r\n- `rs train`: new `--checkpoint` argument to re-start training (fine-tune)\r\n  from a trained model checkpoint. Thanks https:\u002F\u002Fgithub.com\u002Focourtin\r\n\r\n- `rs train`: memory usage reduction during validation by disabling\r\n  expensive gradient computation. Thanks https:\u002F\u002Fgithub.com\u002FJesse-jApps\r\n\r\n- `rs train`, `rs predict`: speedups using multiple workers and\r\n  doing metric calculation on GPU.  Thanks https:\u002F\u002Fgithub.com\u002Focourtin\r\n\r\n- `rs merge`: polygon orientation fixes to respect the GeoJSON\r\n  specification (right-hand rule). Thanks https:\u002F\u002Fgithub.com\u002Fmarsbroshok\r\n\r\nYou can find automatically built Docker images as usual at https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmapbox\u002Frobosat\u002F","2018-09-12T13:38:26"]