[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-torchgeo--torchgeo":3,"tool-torchgeo--torchgeo":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",144730,2,"2026-04-07T23:26:32",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":64,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":32,"env_os":91,"env_gpu":92,"env_ram":92,"env_deps":93,"category_tags":100,"github_topics":101,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":146},5276,"torchgeo\u002Ftorchgeo","torchgeo","TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data","TorchGeo 是一个专为地理空间数据打造的 PyTorch 领域库，其定位类似于图像处理领域的 torchvision。它整合了丰富的遥感数据集、智能采样器、专用数据变换工具以及预训练模型，旨在打通机器学习与地理信息科学之间的壁垒。\n\n长期以来，处理带有地理坐标的遥感数据门槛较高，算法专家往往缺乏领域数据接口，而遥感专家则难以快速上手深度学习框架。TorchGeo 正是为了解这一痛点而生：它让机器学习研究者能轻松调用标准的地理空间数据，同时也帮助遥感领域专家便捷地探索先进的 AI 解决方案。\n\n这款工具非常适合从事地球观测、环境监测、城市规划等方向的科研人员与开发者使用。其核心技术亮点在于原生支持“地理空间数据集”，能够自动处理复杂的地理投影与坐标对齐问题，并提供针对大尺度遥感影像的随机采样策略。通过标准化的接口设计，TorchGeo 让用户无需重复编写底层数据加载代码，即可快速构建并训练语义分割、分类等深度学习模型，极大地提升了地学 AI 应用的研发效率。","\u003Cimg class=\"dark-light\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Ftorchgeo\u002Ftorchgeo\u002Fmain\u002Fdocs\u002F_static\u002Flogo\u002Flogo-color.svg\" width=\"400\" alt=\"TorchGeo logo\"\u002F>\n\nTorchGeo is a [PyTorch](https:\u002F\u002Fpytorch.org\u002F) domain library, similar to [torchvision](https:\u002F\u002Fdocs.pytorch.org\u002Fvision), providing datasets, samplers, transforms, and pre-trained models specific to geospatial data.\n\nThe goal of this library is to make it simple:\n\n1. for machine learning experts to work with geospatial data, and\n2. for remote sensing experts to explore machine learning solutions.\n\nCommunity:\n[![slack](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSlack-join-4A154B?logo=slack)](https:\u002F\u002Ftorchgeo.slack.com\u002Fjoin\u002Fshared_invite\u002Fzt-22rse667m-eqtCeNW0yI000Tl4B~2PIw)\n[![osgeo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FOSGeo-join-4CB05B?logo=osgeo)](https:\u002F\u002Fwww.osgeo.org\u002Fcommunity\u002Fgetting-started-osgeo\u002F)\n[![huggingface](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHugging_Face-join-FFD21E?logo=huggingface)](https:\u002F\u002Fhuggingface.co\u002Ftorchgeo)\n[![pytorch](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-join-DE3412?logo=pytorch)](https:\u002F\u002Fpytorch.org\u002Fjoin-ecosystem\u002F)\n[![youtube](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FYouTube-subscribe-FF0000?logo=youtube)](https:\u002F\u002Fwww.youtube.com\u002F@TorchGeo)\n\nPackaging:\n[![pypi](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchgeo.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorchgeo\u002F)\n[![conda](https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Ftorchgeo\u002Fbadges\u002Fversion.svg)](https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Ftorchgeo)\n[![spack](https:\u002F\u002Fimg.shields.io\u002Fspack\u002Fv\u002Fpy-torchgeo)](https:\u002F\u002Fpackages.spack.io\u002Fpackage.html?name=py-torchgeo)\n\nTesting:\n[![docs](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_13d664e1afd7.png)](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002F)\n[![style](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Fstyle.yaml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Fstyle.yaml)\n[![tests](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Ftests.yaml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Ftests.yaml)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ftorchgeo\u002Ftorchgeo\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg?token=oa3Z3PMVOg)](https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Ftorchgeo\u002Ftorchgeo)\n\n## Installation\n\nThe recommended way to install TorchGeo is with [pip](https:\u002F\u002Fpip.pypa.io\u002Fen\u002Fstable\u002F):\n\n```sh\npip install torchgeo\n```\n\nFor [conda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002F) and [spack](https:\u002F\u002Fspack.io\u002F) installation instructions, see the [documentation](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fuser\u002Finstallation.html).\n\n## Documentation\n\nYou can find the documentation for TorchGeo on [ReadTheDocs](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002F). This includes API documentation, contributing instructions, and several [tutorials](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials\u002Fgetting_started.html). For more details, check out our [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2111.08872), [blog post](https:\u002F\u002Fpytorch.org\u002Fblog\u002Fgeospatial-deep-learning-with-torchgeo\u002F), and [YouTube channel](https:\u002F\u002Fwww.youtube.com\u002F@TorchGeo).\n\n\u003Cp float=\"left\">\n    \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=0HfykJa-foE\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_eb4fe445ff16.jpg\" style=\"width:49%;\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ET8Hb_HqNJQ\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_987c8c695efc.jpg\" style=\"width:49%;\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n## Example Usage\n\nThe following sections give basic examples of what you can do with TorchGeo.\n\nFirst we'll import various classes and functions used in the following sections:\n\n```python\nfrom lightning.pytorch import Trainer\nfrom torch.utils.data import DataLoader\n\nfrom torchgeo.datamodules import InriaAerialImageLabelingDataModule\nfrom torchgeo.datasets import CDL, Landsat7, Landsat8, VHR10, stack_samples\nfrom torchgeo.samplers import RandomGeoSampler\nfrom torchgeo.trainers import SemanticSegmentationTask\n```\n\n### Geospatial datasets and samplers\n\nMany remote sensing applications involve working with [_geospatial datasets_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatasets.html#geospatial-datasets)—datasets with geographic metadata. These datasets can be challenging to work with due to the sheer variety of data. Geospatial imagery is often multispectral with a different number of spectral bands and spatial resolution for every satellite. In addition, each file may be in a different coordinate reference system (CRS), requiring the data to be reprojected into a matching CRS.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_570ce1170789.png\" alt=\"Example application in which we combine Landsat and CDL and sample from both\"\u002F>\n\nIn this example, we show how easy it is to work with geospatial data and to sample small image patches from a combination of [Landsat](https:\u002F\u002Fwww.usgs.gov\u002Flandsat-missions) and [Cropland Data Layer (CDL)](https:\u002F\u002Fwww.nass.usda.gov\u002FResearch_and_Science\u002FCropland\u002FSARS1a.php) data using TorchGeo. First, we assume that the user has Landsat 7 and 8 imagery downloaded. Since Landsat 8 has more spectral bands than Landsat 7, we'll only use the bands that both satellites have in common. We'll create a single dataset including all images from both Landsat 7 and 8 data by taking the union between these two datasets.\n\n```python\nlandsat7 = Landsat7(paths=\"...\", bands=[\"B1\", ..., \"B7\"])\nlandsat8 = Landsat8(paths=\"...\", bands=[\"B2\", ..., \"B8\"])\nlandsat = landsat7 | landsat8\n```\n\nNext, we take the intersection between this dataset and the CDL dataset. We want to take the intersection instead of the union to ensure that we only sample from regions that have both Landsat and CDL data. Note that we can automatically download and checksum CDL data. Also note that each of these datasets may contain files in different coordinate reference systems (CRS) or resolutions, but TorchGeo automatically ensures that a matching CRS and resolution is used.\n\n```python\ncdl = CDL(paths=\"...\", download=True, checksum=True)\ndataset = landsat & cdl\n```\n\nThis dataset can now be used with a PyTorch data loader. Unlike benchmark datasets, geospatial datasets often include very large images. For example, the CDL dataset consists of a single image covering the entire continental United States. In order to sample from these datasets using geospatial coordinates, TorchGeo defines a number of [_samplers_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fsamplers.html). In this example, we'll use a random sampler that returns 256 x 256 pixel images and 10,000 samples per epoch. We also use a custom collation function to combine each sample dictionary into a mini-batch of samples.\n\n```python\nsampler = RandomGeoSampler(dataset, size=256, length=10000)\ndataloader = DataLoader(dataset, batch_size=128, sampler=sampler, collate_fn=stack_samples)\n```\n\nThis data loader can now be used in your normal training\u002Fevaluation pipeline.\n\n```python\nfor batch in dataloader:\n    image = batch[\"image\"]\n    mask = batch[\"mask\"]\n\n    # train a model, or make predictions using a pre-trained model\n```\n\nMany applications involve intelligently composing datasets based on geospatial metadata like this. For example, users may want to:\n\n- Combine datasets for multiple image sources and treat them as equivalent (e.g., Landsat 7 and 8)\n- Combine datasets for disparate geospatial locations (e.g., Chesapeake NY and PA)\n\nThese combinations require that all queries are present in at least one dataset, and can be created using a `UnionDataset`. Similarly, users may want to:\n\n- Combine image and target labels and sample from both simultaneously (e.g., Landsat and CDL)\n- Combine datasets for multiple image sources for multimodal learning or data fusion (e.g., Landsat and Sentinel)\n\nThese combinations require that all queries are present in both datasets, and can be created using an `IntersectionDataset`. TorchGeo automatically composes these datasets for you when you use the intersection (`&`) and union (`|`) operators.\n\n### Benchmark datasets\n\nTorchGeo includes a number of [_benchmark datasets_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatasets.html#non-geospatial-datasets)—datasets that include both input images and target labels. This includes datasets for tasks like image classification, regression, semantic segmentation, object detection, instance segmentation, change detection, and more.\n\nIf you've used [torchvision](https:\u002F\u002Fdocs.pytorch.org\u002Fvision) before, these datasets should seem very familiar. In this example, we'll create a dataset for the Northwestern Polytechnical University (NWPU) very-high-resolution ten-class ([VHR-10](https:\u002F\u002Fgithub.com\u002Fchaozhong2010\u002FVHR-10_dataset_coco)) geospatial object detection dataset. This dataset can be automatically downloaded, checksummed, and extracted, just like with torchvision.\n\n```python\nfrom torch.utils.data import DataLoader\n\nfrom torchgeo.datamodules.utils import collate_fn_detection\nfrom torchgeo.datasets import VHR10\n\n# Initialize the dataset\ndataset = VHR10(root=\"...\", download=True, checksum=True)\n\n# Initialize the dataloader with the custom collate function\ndataloader = DataLoader(\n    dataset,\n    batch_size=128,\n    shuffle=True,\n    num_workers=4,\n    collate_fn=collate_fn_detection,\n)\n\n# Training loop\nfor batch in dataloader:\n    image = batch[\"image\"]  # list of images\n    bbox_xyxy = batch[\"bbox_xyxy\"]  # list of boxes\n    label = batch[\"label\"]  # list of labels\n    mask = batch[\"mask\"]  # list of masks\n\n    # train a model, or make predictions using a pre-trained model\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_7cf9eccee32c.png\" alt=\"Example predictions from a Mask R-CNN model trained on the VHR-10 dataset\"\u002F>\n\nAll TorchGeo datasets are compatible with PyTorch data loaders, making them easy to integrate into existing training workflows. The only difference between a benchmark dataset in TorchGeo and a similar dataset in torchvision is that each dataset returns a dictionary with keys for each PyTorch `Tensor`.\n\n### Pre-trained Weights\n\nPre-trained weights have proven to be tremendously beneficial for transfer learning tasks in computer vision. Practitioners usually utilize models pre-trained on the ImageNet dataset, containing RGB images. However, remote sensing data often goes beyond RGB with additional multispectral channels that can vary across sensors. TorchGeo is the first library to support models pre-trained on different multispectral sensors, and adopts torchvision's [multi-weight API](https:\u002F\u002Fpytorch.org\u002Fblog\u002Fintroducing-torchvision-new-multi-weight-support-api\u002F). A summary of currently available weights can be seen in the [docs](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fmodels.html#pretrained-weights). To create a [timm](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fpytorch-image-models) Resnet-18 model with weights that have been pretrained on Sentinel-2 imagery, you can do the following:\n\n```python\nimport timm\nfrom torchgeo.models import ResNet18_Weights\n\nweights = ResNet18_Weights.SENTINEL2_ALL_MOCO\nmodel = timm.create_model(\"resnet18\", in_chans=weights.meta[\"in_chans\"], num_classes=10)\nmodel.load_state_dict(weights.get_state_dict(progress=True), strict=False)\n```\n\nThese weights can also directly be used in TorchGeo Lightning modules that are shown in the following section via the `weights` argument. For a notebook example, see this [tutorial](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials\u002Fpretrained_weights.html).\n\n### Reproducibility with Lightning\n\nIn order to facilitate direct comparisons between results published in the literature and further reduce the boilerplate code needed to run experiments with datasets in TorchGeo, we have created Lightning [_datamodules_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatamodules.html) with well-defined train-val-test splits and [_trainers_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Ftrainers.html) for various tasks like classification, regression, and semantic segmentation. These datamodules show how to incorporate augmentations from the kornia library, include preprocessing transforms (with pre-calculated channel statistics), and let users easily experiment with hyperparameters related to the data itself (as opposed to the modeling process). Training a semantic segmentation model on the [Inria Aerial Image Labeling](https:\u002F\u002Fproject.inria.fr\u002Faerialimagelabeling\u002F) dataset is as easy as a few imports and four lines of code.\n\n```python\ndatamodule = InriaAerialImageLabelingDataModule(root=\"...\", batch_size=64, num_workers=6)\ntask = SemanticSegmentationTask(\n    model=\"unet\",\n    backbone=\"resnet50\",\n    weights=True,\n    in_channels=3,\n    task=\"binary\",\n    loss=\"bce\",\n)\ntrainer = Trainer(default_root_dir=\"...\")\n\ntrainer.fit(model=task, datamodule=datamodule)\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_c44830c3848e.png\" alt=\"Building segmentations produced by a U-Net model trained on the Inria Aerial Image Labeling dataset\"\u002F>\n\nTorchGeo also supports command-line interface training using [LightningCLI](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html). It can be invoked in two ways:\n\n```sh\n# If torchgeo has been installed\ntorchgeo\n# If torchgeo has been installed, or if it has been cloned to the current directory\npython3 -m torchgeo\n```\n\nIt supports command-line configuration or YAML\u002FJSON config files. Valid options can be found from the help messages:\n\n```sh\n# See valid stages\ntorchgeo --help\n# See valid trainer options\ntorchgeo fit --help\n# See valid model options\ntorchgeo fit --model.help ClassificationTask\n# See valid data options\ntorchgeo fit --data.help EuroSAT100DataModule\n```\n\nUsing the following config file:\n\n```yaml\ntrainer:\n  max_epochs: 20\nmodel:\n  class_path: ClassificationTask\n  init_args:\n    model: 'resnet18'\n    in_channels: 13\n    num_classes: 10\ndata:\n  class_path: EuroSAT100DataModule\n  init_args:\n    batch_size: 8\n  dict_kwargs:\n    download: true\n```\n\nwe can see the script in action:\n\n```sh\n# Train and validate a model\ntorchgeo fit --config config.yaml\n# Validate-only\ntorchgeo validate --config config.yaml --ckpt_path=...\n# Calculate and report test accuracy\ntorchgeo test --config config.yaml --ckpt_path=...\n```\n\nIt can also be imported and used in a Python script if you need to extend it to add new features:\n\n```python\nfrom torchgeo.main import main\n\nmain([\"fit\", \"--config\", \"config.yaml\"])\n```\n\nSee the [Lightning documentation](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html) for more details.\n\n## Citation\n\nIf you use this software in your work, please cite our [paper](https:\u002F\u002Fdoi.org\u002F10.1145\u002F3707459):\n\n```bibtex\n@article{stewart2024torchgeo,\n    author = {Stewart, Adam J. and Robinson, Caleb and Corley, Isaac A. and Ortiz, Anthony and Lavista Ferres, Juan M. and Banerjee, Arindam},\n    title = {{TorchGeo}: Deep Learning With Geospatial Data},\n    journal = {ACM Transactions on Spatial Algorithms and Systems},\n    volume = {11},\n    number = {4},\n    pages = {1--28},\n    month = aug,\n    year = {2025}\n}\n```\n\n## Contributing\n\nThis project welcomes contributions and suggestions. If you would like to submit a pull request, see our [Contribution Guide](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fuser\u002Fcontributing.html) for more information.\n\nThis project has adopted the [Contributor Covenant Code of Conduct](https:\u002F\u002Fwww.contributor-covenant.org\u002F). For more information see the [Contributor Covenant Code of Conduct FAQ](https:\u002F\u002Fwww.contributor-covenant.org\u002Ffaq\u002F) or contact @adamjstewart on [Slack](https:\u002F\u002Ftorchgeo.slack.com\u002Fjoin\u002Fshared_invite\u002Fzt-22rse667m-eqtCeNW0yI000Tl4B~2PIw) with any additional questions or comments.\n","\u003Cimg class=\"dark-light\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Ftorchgeo\u002Ftorchgeo\u002Fmain\u002Fdocs\u002F_static\u002Flogo\u002Flogo-color.svg\" width=\"400\" alt=\"TorchGeo logo\"\u002F>\n\nTorchGeo 是一个基于 [PyTorch](https:\u002F\u002Fpytorch.org\u002F) 的领域专用库，类似于 [torchvision](https:\u002F\u002Fdocs.pytorch.org\u002Fvision)，为地理空间数据提供了专门的数据集、采样器、变换和预训练模型。\n\n该库的目标是让以下两件事变得简单：\n\n1. 使机器学习专家能够轻松处理地理空间数据；  \n2. 使遥感专家能够探索机器学习解决方案。\n\n社区：\n[![slack](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSlack-join-4A154B?logo=slack)](https:\u002F\u002Ftorchgeo.slack.com\u002Fjoin\u002Fshared_invite\u002Fzt-22rse667m-eqtCeNW0yI000Tl4B~2PIw)\n[![osgeo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FOSGeo-join-4CB05B?logo=osgeo)](https:\u002F\u002Fwww.osgeo.org\u002Fcommunity\u002Fgetting-started-osgeo\u002F)\n[![huggingface](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHugging_Face-join-FFD21E?logo=huggingface)](https:\u002F\u002Fhuggingface.co\u002Ftorchgeo)\n[![pytorch](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-join-DE3412?logo=pytorch)](https:\u002F\u002Fpytorch.org\u002Fjoin-ecosystem\u002F)\n[![youtube](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FYouTube-subscribe-FF0000?logo=youtube)](https:\u002F\u002Fwww.youtube.com\u002F@TorchGeo)\n\n打包：\n[![pypi](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchgeo.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorchgeo\u002F)\n[![conda](https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Ftorchgeo\u002Fbadges\u002Fversion.svg)](https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Ftorchgeo)\n[![spack](https:\u002F\u002Fimg.shields.io\u002Fspack\u002Fv\u002Fpy-torchgeo)](https:\u002F\u002Fpackages.spack.io\u002Fpackage.html?name=py-torchgeo)\n\n测试：\n[![docs](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_13d664e1afd7.png)](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002F)\n[![style](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Fstyle.yaml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Fstyle.yaml)\n[![tests](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Ftests.yaml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Factions\u002Fworkflows\u002Ftests.yaml)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ftorchgeo\u002Ftorchgeo\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg?token=oa3Z3PMVOg)](https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Ftorchgeo\u002Ftorchgeo)\n\n## 安装\n\n推荐使用 [pip](https:\u002F\u002Fpip.pypa.io\u002Fen\u002Fstable\u002F) 安装 TorchGeo：\n\n```sh\npip install torchgeo\n```\n\n有关 [conda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002F) 和 [spack](https:\u002F\u002Fspack.io\u002F) 的安装说明，请参阅 [文档](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fuser\u002Finstallation.html)。\n\n## 文档\n\n您可以在 [ReadTheDocs](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002F) 上找到 TorchGeo 的文档。其中包括 API 文档、贡献指南以及多个 [教程](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials\u002Fgetting_started.html)。更多详细信息，请查看我们的 [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2111.08872)、[博客文章](https:\u002F\u002Fpytorch.org\u002Fblog\u002Fgeospatial-deep-learning-with-torchgeo\u002F) 和 [YouTube 频道](https:\u002F\u002Fwww.youtube.com\u002F@TorchGeo)。\n\n\u003Cp float=\"left\">\n    \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=0HfykJa-foE\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_eb4fe445ff16.jpg\" style=\"width:49%;\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ET8Hb_HqNJQ\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_987c8c695efc.jpg\" style=\"width:49%;\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n## 示例用法\n\n以下部分提供了一些使用 TorchGeo 的基本示例。\n\n首先，我们导入将在后续章节中使用的各类类和函数：\n\n```python\nfrom lightning.pytorch import Trainer\nfrom torch.utils.data import DataLoader\n\nfrom torchgeo.datamodules import InriaAerialImageLabelingDataModule\nfrom torchgeo.datasets import CDL, Landsat7, Landsat8, VHR10, stack_samples\nfrom torchgeo.samplers import RandomGeoSampler\nfrom torchgeo.trainers import SemanticSegmentationTask\n```\n\n### 地理空间数据集与采样器\n\n许多遥感应用都涉及处理[_地理空间数据集_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatasets.html#geospatial-datasets)——即带有地理元数据的数据集。由于数据种类繁多，这类数据集往往难以直接使用。地理空间影像通常是多光谱的，不同卫星的光谱波段数量和空间分辨率各不相同。此外，每个文件可能采用不同的坐标参考系统（CRS），因此需要将数据重新投影到一致的坐标系中。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_570ce1170789.png\" alt=\"示例应用：我们将Landsat与CDL数据结合，并从两者中进行采样\"\u002F>\n\n在本示例中，我们展示了如何使用TorchGeo轻松处理地理空间数据，并从[Landsat](https:\u002F\u002Fwww.usgs.gov\u002Flandsat-missions)和[作物数据层（CDL）](https:\u002F\u002Fwww.nass.usda.gov\u002FResearch_and_Science\u002FCropland\u002FSARS1a.php)数据的组合中采样小块图像。首先，假设用户已下载了Landsat 7和8的影像。由于Landsat 8的光谱波段比Landsat 7多，我们仅使用两颗卫星共有的波段。通过取这两个数据集的并集，我们可以创建一个包含Landsat 7和8所有影像的单一数据集。\n\n```python\nlandsat7 = Landsat7(paths=\"...\", bands=[\"B1\", ..., \"B7\"])\nlandsat8 = Landsat8(paths=\"...\", bands=[\"B2\", ..., \"B8\"])\nlandsat = landsat7 | landsat8\n```\n\n接下来，我们对该数据集与CDL数据集取交集。这里使用交集而非并集，是为了确保只从同时拥有Landsat和CDL数据的区域进行采样。需要注意的是，CDL数据可以自动下载并校验其校验和。此外，这些数据集中的文件可能采用不同的坐标参考系统或分辨率，但TorchGeo会自动确保使用匹配的坐标系和分辨率。\n\n```python\ncdl = CDL(paths=\"...\", download=True, checksum=True)\ndataset = landsat & cdl\n```\n\n现在，这个数据集可以与PyTorch的数据加载器一起使用。与基准数据集不同，地理空间数据集通常包含非常大的图像。例如，CDL数据集由一张覆盖整个美国本土的单幅图像组成。为了能够基于地理坐标从这些数据集中采样，TorchGeo定义了一系列[_采样器_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fsamplers.html)。在本例中，我们使用随机采样器，每次返回256×256像素的图像，并且每轮迭代采样10,000个样本。同时，我们还使用自定义的批处理函数，将每个样本字典合并成一个小批量样本。\n\n```python\nsampler = RandomGeoSampler(dataset, size=256, length=10000)\ndataloader = DataLoader(dataset, batch_size=128, sampler=sampler, collate_fn=stack_samples)\n```\n\n现在，这个数据加载器就可以用于常规的训练或评估流程中。\n\n```python\nfor batch in dataloader:\n    image = batch[\"image\"]\n    mask = batch[\"mask\"]\n\n    # 训练模型，或使用预训练模型进行预测\n```\n\n许多应用都需要根据地理空间元数据智能地组合数据集。例如，用户可能希望：\n\n- 将多个影像源的数据集合并，并将其视为等效（如Landsat 7和8）；\n- 将来自不同地理区域的数据集合并（如切萨皮克湾的纽约州和宾夕法尼亚州部分）。\n\n这些组合要求所有查询至少存在于其中一个数据集中，可以通过`UnionDataset`来实现。类似地，用户也可能希望：\n\n- 将影像和目标标签结合起来，并同时从中采样（如Landsat和CDL）；\n- 将多个影像源的数据集合并，用于多模态学习或数据融合（如Landsat和Sentinel）。\n\n这些组合则要求所有查询同时存在于两个数据集中，可以通过`IntersectionDataset`来实现。当您使用交集（`&`）和并集（`|`）运算符时，TorchGeo会自动为您完成这些数据集的组合。\n\n### 基准数据集\n\nTorchGeo包含一系列[_基准数据集_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatasets.html#non-geospatial-datasets)，这些数据集同时包含输入图像和目标标签。它们涵盖了图像分类、回归、语义分割、目标检测、实例分割、变化检测等多种任务。\n\n如果您之前使用过[torchvision](https:\u002F\u002Fdocs.pytorch.org\u002Fvision)，那么这些数据集应该会显得非常熟悉。在本例中，我们将创建西北工业大学（NWPU）的超高分辨率十类目标检测数据集（[VHR-10](https:\u002F\u002Fgithub.com\u002Fchaozhong2010\u002FVHR-10_dataset_coco)）。该数据集可以像torchvision中的数据集一样，自动下载、校验并解压。\n\n```python\nfrom torch.utils.data import DataLoader\n\nfrom torchgeo.datamodules.utils import collate_fn_detection\nfrom torchgeo.datasets import VHR10\n\n# 初始化数据集\ndataset = VHR10(root=\"...\", download=True, checksum=True)\n\n# 使用自定义批处理函数初始化数据加载器\ndataloader = DataLoader(\n    dataset,\n    batch_size=128,\n    shuffle=True,\n    num_workers=4,\n    collate_fn=collate_fn_detection,\n)\n\n# 训练循环\nfor batch in dataloader:\n    image = batch[\"image\"]  # 图像列表\n    bbox_xyxy = batch[\"bbox_xyxy\"]  # 边界框列表\n    label = batch[\"label\"]  # 标签列表\n    mask = batch[\"mask\"]  # 掩码列表\n\n    # 训练模型，或使用预训练模型进行预测\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_7cf9eccee32c.png\" alt=\"基于VHR-10数据集训练的Mask R-CNN模型的预测示例\"\u002F>\n\nTorchGeo中的所有数据集都与PyTorch的数据加载器兼容，因此很容易集成到现有的训练工作流中。TorchGeo中的基准数据集与torchvision中类似的数据集唯一的区别在于，每个数据集返回的是一个字典，其中包含对应于每个PyTorch张量的键。\n\n### 预训练权重\n\n预训练权重已被证明对计算机视觉领域的迁移学习任务极为有益。从业者通常会使用在包含 RGB 图像的 ImageNet 数据集上预训练的模型。然而，遥感数据往往不仅限于 RGB，还包含多个多光谱通道，且这些通道的数量和波段范围可能因传感器而异。TorchGeo 是首个支持在不同多光谱传感器上预训练模型的库，并采用了 torchvision 的 [多权重 API](https:\u002F\u002Fpytorch.org\u002Fblog\u002Fintroducing-torchvision-new-multi-weight-support-api\u002F)。当前可用的权重概览可在[文档](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fmodels.html#pretrained-weights)中找到。要创建一个基于 Sentinel-2 影像预训练权重的 [timm](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fpytorch-image-models) Resnet-18 模型，可以按如下方式操作：\n\n```python\nimport timm\nfrom torchgeo.models import ResNet18_Weights\n\nweights = ResNet18_Weights.SENTINEL2_ALL_MOCO\nmodel = timm.create_model(\"resnet18\", in_chans=weights.meta[\"in_chans\"], num_classes=10)\nmodel.load_state_dict(weights.get_state_dict(progress=True), strict=False)\n```\n\n这些权重也可以通过 `weights` 参数直接用于 TorchGeo Lightning 模块中，具体示例见下文。有关笔记本示例，请参阅此[教程](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials\u002Fpretrained_weights.html)。\n\n### 使用 Lightning 实现可复现性\n\n为了便于将文献中发表的结果与使用 TorchGeo 数据集进行实验的结果直接比较，并进一步减少运行实验所需的样板代码量，我们创建了具有明确训练\u002F验证\u002F测试划分的 Lightning [_数据模块_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatamodules.html) 以及适用于分类、回归和语义分割等多种任务的 [_训练器_](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Ftrainers.html)。这些数据模块展示了如何集成 kornia 库中的数据增强技术、包含预处理变换（并使用预先计算的通道统计信息），同时允许用户轻松地调整与数据本身相关的超参数（而非建模过程中的超参数）。例如，在 [Inria 航拍图像标注](https:\u002F\u002Fproject.inria.fr\u002Faerialimagelabeling\u002F) 数据集上训练一个语义分割模型，只需几行导入语句和四行代码即可完成。\n\n```python\ndatamodule = InriaAerialImageLabelingDataModule(root=\"...\", batch_size=64, num_workers=6)\ntask = SemanticSegmentationTask(\n    model=\"unet\",\n    backbone=\"resnet50\",\n    weights=True,\n    in_channels=3,\n    task=\"binary\",\n    loss=\"bce\",\n)\ntrainer = Trainer(default_root_dir=\"...\")\ntrainer.fit(model=task, datamodule=datamodule)\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_readme_c44830c3848e.png\" alt=\"使用在 Inria 航拍图像标注数据集上训练的 U-Net 模型生成的建筑物分割结果\"\u002F>\n\nTorchGeo 还支持使用 [LightningCLI](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html) 进行命令行训练。可以通过以下两种方式调用：\n\n```sh\n# 如果已安装 torchgeo\ntorchgeo\n# 如果已安装 torchgeo，或已将其克隆到当前目录\npython3 -m torchgeo\n```\n\n它支持通过命令行配置或 YAML\u002FJSON 配置文件进行设置。有效选项可通过帮助信息查看：\n\n```sh\n# 查看有效阶段\ntorchgeo --help\n# 查看有效训练器选项\ntorchgeo fit --help\n# 查看有效模型选项\ntorchgeo fit --model.help ClassificationTask\n# 查看有效数据选项\ntorchgeo fit --data.help EuroSAT100DataModule\n```\n\n使用以下配置文件：\n\n```yaml\ntrainer:\n  max_epochs: 20\nmodel:\n  class_path: ClassificationTask\n  init_args:\n    model: 'resnet18'\n    in_channels: 13\n    num_classes: 10\ndata:\n  class_path: EuroSAT100DataModule\n  init_args:\n    batch_size: 8\n  dict_kwargs:\n    download: true\n```\n\n我们可以看到该脚本的实际运行效果：\n\n```sh\n# 训练并验证模型\ntorchgeo fit --config config.yaml\n# 仅验证\ntorchgeo validate --config config.yaml --ckpt_path=...\n# 计算并报告测试准确率\ntorchgeo test --config config.yaml --ckpt_path=...\n```\n\n如果需要扩展功能，也可以将其导入 Python 脚本中使用：\n\n```python\nfrom torchgeo.main import main\n\nmain([\"fit\", \"--config\", \"config.yaml\"])\n```\n\n更多详细信息请参阅 [Lightning 文档](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html)。\n\n## 引用\n\n如果您在工作中使用了本软件，请引用我们的[论文](https:\u002F\u002Fdoi.org\u002F10.1145\u002F3707459)：\n\n```bibtex\n@article{stewart2024torchgeo,\n    author = {Stewart, Adam J. and Robinson, Caleb and Corley, Isaac A. and Ortiz, Anthony and Lavista Ferres, Juan M. and Banerjee, Arindam},\n    title = {{TorchGeo}: Deep Learning With Geospatial Data},\n    journal = {ACM Transactions on Spatial Algorithms and Systems},\n    volume = {11},\n    number = {4},\n    pages = {1--28},\n    month = aug,\n    year = {2025}\n}\n```\n\n## 贡献\n\n本项目欢迎各类贡献和建议。如果您希望提交拉取请求，请参阅我们的[贡献指南](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fuser\u002Fcontributing.html)以获取更多信息。\n\n本项目已采纳 [Contributor Covenant 行为准则](https:\u002F\u002Fwww.contributor-covenant.org\u002F)。如需更多信息，请参阅 [Contributor Covenant 行为准则常见问题解答](https:\u002F\u002Fwww.contributor-covenant.org\u002Ffaq\u002F)，或通过 [Slack](https:\u002F\u002Ftorchgeo.slack.com\u002Fjoin\u002Fshared_invite\u002Fzt-22rse667m-eqtCeNW0yI000Tl4B~2PIw) 联系 @adamjstewart，提出任何其他问题或意见。","# TorchGeo 快速上手指南\n\nTorchGeo 是一个基于 PyTorch 的地理空间数据领域库，类似于 torchvision。它提供了专门针对地理空间数据的 datasets（数据集）、samplers（采样器）、transforms（变换）和预训练模型，旨在降低机器学习专家处理地理空间数据的门槛，同时帮助遥感专家探索机器学习解决方案。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux, macOS 或 Windows\n*   **Python**: 3.8 或更高版本\n*   **核心依赖**:\n    *   [PyTorch](https:\u002F\u002Fpytorch.org\u002F) (建议安装与您的 CUDA 版本匹配的最新版)\n    *   [Lightning](https:\u002F\u002Flightning.ai\u002F) (可选，用于复现实验和简化训练流程)\n*   **地理空间依赖**: TorchGeo 底层依赖 `rasterio`, `gdal`, `shapely` 等库。\n    *   **推荐方案**: 为了避免编译 GDAL 等 C++ 库的复杂性，强烈建议使用 **Conda** 环境进行管理。\n\n## 安装步骤\n\n### 方式一：使用 pip 安装（推荐）\n\n如果您已经配置好了包含 GDAL 等地理空间库的环境，可以直接使用 pip 安装：\n\n```sh\npip install torchgeo\n```\n\n> **国内加速提示**: 如果下载速度较慢，可以使用清华或阿里镜像源：\n> ```sh\n> pip install torchgeo -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n### 方式二：使用 Conda 安装（最稳健）\n\n此方式会自动解决复杂的地理空间依赖（如 GDAL、PROJ 等），适合大多数用户：\n\n```sh\nconda install -c conda-forge torchgeo\n```\n\n> **国内加速提示**: 配置 conda-forge 国内镜像后速度更快：\n> ```sh\n> conda config --add channels https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fanaconda\u002Fcloud\u002Fconda-forge\u002F\n> conda config --set show_channel_urls yes\n> conda install -c conda-forge torchgeo\n> ```\n\n## 基本使用\n\nTorchGeo 的核心优势在于能够轻松组合不同的地理空间数据集，并自动处理坐标参考系统（CRS）和分辨率的对齐。\n\n以下示例展示了如何组合 **Landsat** 卫星影像数据和 **CDL** (Cropland Data Layer) 土地覆盖数据，并使用采样器生成训练批次。\n\n### 1. 导入必要模块\n\n```python\nfrom torch.utils.data import DataLoader\n\nfrom torchgeo.datasets import CDL, Landsat7, Landsat8, stack_samples\nfrom torchgeo.samplers import RandomGeoSampler\n```\n\n### 2. 构建组合数据集\n\nTorchGeo 允许使用集合运算符来组合数据集：\n*   `|` (Union): 取并集，适用于合并不同来源但类型相同的数据（如 Landsat 7 和 8）。\n*   `&` (Intersection): 取交集，适用于将影像与标签对齐（确保只在两者都覆盖的区域采样）。\n\n```python\n# 初始化 Landsat 7 和 8 数据集 (假设路径已准备好)\n# 仅选择两颗卫星共有的波段\nlandsat7 = Landsat7(paths=\"path\u002Fto\u002Flandsat7\", bands=[\"B1\", \"B2\", \"B3\", \"B4\", \"B5\", \"B6\", \"B7\"])\nlandsat8 = Landsat8(paths=\"path\u002Fto\u002Flandsat8\", bands=[\"B2\", \"B3\", \"B4\", \"B5\", \"B6\", \"B7\", \"B8\"])\n\n# 合并 Landsat 7 和 8 (并集)\nlandsat = landsat7 | landsat8\n\n# 初始化 CDL 数据集 (支持自动下载和校验)\ncdl = CDL(paths=\"path\u002Fto\u002Fcdl\", download=True, checksum=True)\n\n# 获取影像和标签的重叠区域 (交集)\n# TorchGeo 会自动处理重投影和分辨率匹配\ndataset = landsat & cdl\n```\n\n### 3. 定义采样器与数据加载器\n\n地理空间图像通常非常大（例如覆盖整个美国），不能直接一次性加载。需要使用 `GeoSampler` 按坐标块进行采样。\n\n```python\n# 定义随机采样器：每次采集 256x256 像素的图块，每个 epoch 采样 10000 次\nsampler = RandomGeoSampler(dataset, size=256, length=10000)\n\n# 创建 DataLoader\n# collate_fn=stack_samples 用于将样本字典堆叠成 batch\ndataloader = DataLoader(\n    dataset, \n    batch_size=32, \n    sampler=sampler, \n    collate_fn=stack_samples,\n    num_workers=4\n)\n```\n\n### 4. 开始训练循环\n\n现在可以像使用普通 PyTorch 数据一样进行迭代：\n\n```python\nfor batch in dataloader:\n    # batch 是一个字典，包含 'image', 'mask' 等键\n    image = batch[\"image\"]  # 形状: [Batch, Channels, Height, Width]\n    mask = batch[\"mask\"]    # 形状: [Batch, Classes, Height, Width]\n    \n    # 在此处插入您的模型训练代码\n    # outputs = model(image)\n    # loss = criterion(outputs, mask)\n    pass\n```\n\n### 进阶：使用预训练模型\n\nTorchGeo 支持针对多光谱传感器（如 Sentinel-2）预训练的权重，这对于迁移学习非常有用：\n\n```python\nimport timm\nfrom torchgeo.models import ResNet18_Weights\n\n# 加载在 Sentinel-2 数据上预训练的权重\nweights = ResNet18_Weights.SENTINEL2_ALL_MOCO\n\n# 创建模型，注意输入通道数需匹配预训练权重\nmodel = timm.create_model(\"resnet18\", in_chans=weights.meta[\"in_chans\"], num_classes=10)\n\n# 载入权重\nmodel.load_state_dict(weights.get_state_dict(progress=True), strict=False)\n```","某农业科技公司数据团队正利用卫星遥感影像构建全国范围的作物分类模型，以监测主要粮食产区的种植分布。\n\n### 没有 torchgeo 时\n- 工程师需手动编写大量代码解析 GeoTIFF 等复杂地理空间格式，并自行处理不同坐标系之间的转换与对齐，极易出错。\n- 缺乏统一的地理采样器，难以从海量大幅面卫星图中高效提取固定大小的训练样本，导致数据加载逻辑混乱且效率低下。\n- 预处理流程碎片化，团队成员各自实现辐射校正、云掩膜等变换操作，造成代码重复维护困难，实验结果难以复现。\n- 机器学习专家因不熟悉地理投影知识而望而却步，遥感专家则因深度学习框架门槛高而难以落地算法，跨领域协作受阻。\n\n### 使用 torchgeo 后\n- 直接调用内置的 Landsat 或 Sentinel 数据集类，自动完成多源数据的坐标对齐与格式标准化，将数据准备时间从数天缩短至几小时。\n- 利用 RandomGeoSampler 等专用采样器，可基于地理坐标无缝滑动裁剪超大影像，显著提升了大规模数据训练的吞吐量。\n- 复用官方提供的地理空间专属 transforms 流水线，统一了云层去除与波段组合标准，确保了全团队实验环境的高度一致。\n- 提供了类似 torchvision 的友好接口，让算法工程师能像处理普通图片一样操作地理数据，同时赋能遥感专家快速验证深度学习方案。\n\ntorchgeo 通过屏蔽底层地理信息系统的复杂性，真正实现了遥感领域专家与人工智能技术的高效融合。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorchgeo_torchgeo_570ce117.png","TorchGeo","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftorchgeo_f1886453.png","TorchGeo: deep learning with geospatial data",null,"https:\u002F\u002Fosgeo.org\u002Fprojects\u002Ftorchgeo","https:\u002F\u002Fgithub.com\u002Ftorchgeo",[79,83],{"name":80,"color":81,"percentage":82},"Python","#3572A5",100,{"name":84,"color":85,"percentage":86},"Batchfile","#C1F12E",0,3963,536,"2026-04-07T18:53:37","MIT","","未说明",{"notes":94,"python":92,"dependencies":95},"README 中未明确列出具体的操作系统、GPU、内存及 Python 版本要求。该工具是一个 PyTorch 领域库，支持通过 pip、conda 和 spack 安装。它提供了针对地理空间数据的数据集、采样器、变换和预训练模型（包括多光谱传感器预训练权重）。建议使用 Lightning 模块以确保实验的可复现性。",[96,97,98,99],"torch","lightning.pytorch","timm","kornia",[16,15,14],[102,103,104,105,106,107,108,109,110,111,112],"pytorch","torchvision","datasets","models","transforms","remote-sensing","deep-learning","earth-observation","computer-vision","geospatial","satellite-imagery","2026-03-27T02:49:30.150509","2026-04-08T07:44:01.414625",[116,121,126,131,136,141],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},23913,"在 macOS 或 Windows 上使用 num_workers > 0 进行训练时出现 PicklingError（无法序列化）错误怎么办？","这通常是因为在并行数据加载器中使用了数据模块的实例方法导致的，是 PyTorch Lightning (PL) 的一个已知问题。如果在自定义数据集或数据模块中定义了实例方法并在多进程加载时被调用，就会触发此错误。建议检查是否将实例方法传递给了 DataLoader，或者尝试将 num_workers 设置为 0 以单进程运行作为临时解决方案。该问题与 Lightning AI 的相关 Bug 有关（参考 PR #17130 和 #17133）。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F886",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},23914,"如何为 TorchGeo 添加用于多分类任务的自定义数据集（包含图像和掩码）？","创建自定义数据集时，需要分别为图像和掩码定义不同的类，并正确设置 is_image 属性。图像数据集应设置 is_image = True，而掩码数据集必须设置 is_image = False（因为掩码通常没有波段概念）。示例代码如下：\nclass ImageDataset(RasterDataset):\n    is_image = True\n\nclass MaskDataset(RasterDataset):\n    is_image = False\n\nimage = ImageDataset(image_path)\nmask = MaskDataset(mask_path)\n请确保仔细阅读官方教程中关于 custom_raster_dataset 的部分，并根据图像和掩码的特性设置所有必要的类属性。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F2148",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},23915,"运行 README 中的基准数据集（如 VHR-10）示例代码时遇到 MD5 校验和不匹配或导入错误怎么办？","这类错误通常是由于版本不兼容或数据集源变更引起的。VHR-10 数据集的下载逻辑已得到显著改进，且现在有了经过测试的 InstanceSegmentationTask 训练器。如果仍然遇到问题，可能是因为原数据集托管位置（如 Google Drive）不稳定。项目计划将数据集迁移至 Hugging Face 以解决依赖 rarfile 和 gdown 的问题，或者建议在示例中改用更稳定的数据集（如 EuroSAT）进行测试。请确保升级到最新版本的 torchgeo。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F2069",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},23916,"为什么原本可用的数据集（如 Radiant MLHub 上的数据集）突然无法下载或文件结构改变了？","这是因为 Radiant MLHub 服务已停止运营，导致原本托管在其上的数据集（如 AgriFieldNet, Benin Cashews, SpaceNet 等）下载链接失效或结构变更。TorchGeo 正在将这些数据集迁移到 Source Cooperative 或 Hugging Face 等新平台。如果您发现某个特定数据集无法下载，请查看该项目是否已有对应的迁移 PR（例如热带气旋数据集的迁移参考 PR #2068），或者等待维护者更新该数据集的下载逻辑。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F1830",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},23917,"CI（持续集成）测试经常因依赖项更新而失败，普通用户该如何应对类似的依赖冲突？","CI 的不稳定通常源于上游依赖（如 pytorch-lightning, setuptools）发布新版本后引入了破坏性变更。对于普通用户，如果遇到安装或运行错误，首先尝试固定关键依赖的版本，或者使用项目推荐的特定环境配置（如 conda 环境文件）。如果是开发贡献者，项目正通过 Dependabot 来管理依赖更新，以确保只有专门的版本更新 PR 会处理潜在的断裂，而不是影响所有 PR。用户应避免盲目升级所有包到最新版，而是参考项目文档中指定的兼容版本范围。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F488",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},23918,"在使用 IDTReeS 数据集训练目标检测模型时发现坐标 swapped（交换）或标注错误怎么办？","IDTReeS 数据集中曾存在坐标轴交换的 Bug（例如 x 和 y 坐标颠倒），这会导致训练出的模型预测位置偏差。该问题已在后续的修复（PR #683）中得到解决。如果您使用的是旧版本代码或数据，请确保更新到最新的 TorchGeo 版本，以获取修正后的坐标处理逻辑。如果问题依然存在，请检查本地缓存的数据文件是否需要重新下载以应用新的解析规则。","https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo\u002Fissues\u002F684",[147,152,157,162,167,172,177,182,187,192,197,202,207,212,217,222,227,232,237,242],{"id":148,"version":149,"summary_zh":150,"released_at":151},145461,"v0.9.0","# TorchGeo 0.9.0 发行说明\n\nTorchGeo 0.9 包含 13 个新数据集，以及为更好地支持时间序列而进行的多项改进，这些成果凝聚了来自世界各地的 15 位贡献者长达 3 个月的辛勤工作。我们现在正努力实现更频繁的发布，以便尽快将令人兴奋的新功能带给用户！\n\n## 本次发行的主要亮点\n\n### 嵌入数据集\n\n![Copernicus-Embed](https:\u002F\u002Fgithub.com\u002Fzhu-xlab\u002FCopernicus-FM\u002Fblob\u002Fmain\u002Fassets\u002Fembed_main-1.png)\n\nTorchGeo 是首个提供预训练地理空间基础模型的库，其 GeoFM 的数量甚至超过了其他所有 GeoML 库的总和[^1]。一直以来，用户都可以使用 TorchGeo [生成自己的嵌入](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Ftutorials\u002Fembeddings.html)。然而，使用基础模型需要相当的专业知识和计算资源，这在一定程度上阻碍了其广泛应用。\n\n近年来，多篇重要论文提出了“地球嵌入”的概念——即基于卫星影像镶嵌图或区域至全球尺度的年度时间序列数据预先计算好的嵌入表示。作为对地球嵌入更广泛综述的一部分[^2]，我们已将所有已知的基于补丁和基于像素的嵌入产品添加到了 TorchGeo 中！\n\n| 数据集 | 类型 | 空间范围 | 空间分辨率 | 时间范围 | 时间分辨率 | 维度 | 数据类型 | 许可证 |\n| :------ | :---: | :------------ | -----------------: | --------------: | :-----------------: | ---------: | :---: | ------: |\n| [Clay Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fclay-embeddings.html) | 补丁 | 全球* | 5.12 km | 2018–2023* | 快照 | 768 | float32 | ODC-By-1.0 |\n| [Major TOM Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fmajor-tom.html) | 补丁 | 全球 | 2.14–3.56 km | 2015–2024* | 快照 | 2048 | float32 | CC-BY-SA-4.0 |\n| [Earth Index Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fearth-index-embeddings.html) | 补丁 | 全球 | 320 m | 2024 | 快照 | 384 | float32 | CC-BY-4.0 |\n| [Copernicus-Embed](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fcopernicus-embed.html) | 补丁 | 全球 | 0.25° | 2021 | 年度 | 768 | float32 | CC-BY-4.0 |\n| [LGND Clay Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fclay-embeddings.html) | 补丁 | 全球 | 256 m | 2024–2025 | 快照 | 1024 | float32 | CC-BY-4.0 |\n| [EarthEmbeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fearth-embeddings.html) | 补丁 | 全球* | 2.24–3.84 km | 2015–2024* | 快照 | 256–1152 | float16、float32 | CC-BY-SA-4.0 |\n| [Presto Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Fpresto-embeddings.html) | 像素 | 多哥 | 10 m | 2019–2020 | 年度 | 128 | uint16 | CC-BY-4.0 |\n| [Tessera Embeddings](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fdatasets\u002Ftessera-embeddings.html) | 像素 | 全球 | 10 m | 2017–2025* | 年度 | 128 | int8 → float32 | CC0-1.0 |\n| [Google Satellite Embedding](https:\u002F\u002Ftor","2026-02-14T15:24:18",{"id":153,"version":154,"summary_zh":155,"released_at":156},145462,"v0.8.1","# TorchGeo 0.8.1 发行说明\n\n这是一个错误修复和维护版本。虽然没有新增功能或 API 变更，但此版本包含了重要的错误修复、文档改进以及在数据集、模型和测试方面的少量增强。\n\n> [!NOTE]  \n> TorchGeo 的文档已更新为使用 [PyData Sphinx 主题](https:\u002F\u002Fpydata-sphinx-theme.readthedocs.io\u002F)，带来了现代化的外观和更好的导航与可访问性。新主题使 TorchGeo 与其他科学 Python 项目（如 [NumPy](https:\u002F\u002Fnumpy.org\u002Fdoc\u002Fstable\u002Findex.html)、[pandas](https:\u002F\u002Fpandas.pydata.org\u002Fdocs\u002F) 和 [xarray](https:\u002F\u002Fdocs.xarray.dev\u002Fen\u002Fstable\u002F)）保持一致，为整个生态系统的用户提供熟悉的操作体验。\n\n## 依赖项\n\n- mypy：现需 1.16+ 版本 (#3153)\n- myst-parser：新增依赖项 (#3283)\n- opencv：移除依赖项 (#3238)\n- pandas：修复对 pandas 3+ 的支持 (#3311)\n- pandas-stubs：新增依赖项 (#3155)\n- pydata-sphinx-theme：新增依赖项 (#3165)\n- python：测试 3.14，支持自由线程化 (#3045, #3203, #3259, #3319)\n- pytorch-sphinx-theme：移除依赖项 (#3165)\n- sphinx：修复对 sphinx 6+ 的支持 (#3165)\n- types-requests：新增依赖项 (#3157)\n- types-shapely：新增依赖项 (#3154, #3187)\n- 弃用策略：NEP 29 -> SPEC 0 (#3204)\n\n## 数据集\n\n- Biomassters：修复文件句柄泄漏 (#3233)\n- DL4GAM：修复文件句柄泄漏 (#3234)\n- DIOR：修复下载问题 (#3196)\n- NLCD：修复下载问题，v0 -> v1 (#3185)\n- RasterDataset：修复对翻转或倒置栅格的支持 (#3249)\n- Sentinel-1：新增对 S1C、S1D 的支持 (#3223)\n- SolarPlantsBrazil：在图表中添加预测结果 (#3144)\n- VectorDataset：支持 parquet 文件 (#3166)\n- XarrayDataset：修复文件句柄泄漏 (#3235)\n- random_grid_cell_assignment：修复数据集拆分长度问题 (#3251)\n\n## 模型\n\n- ChangeViT：为所有 ViT 骨干网络启用动态图像尺寸 (#3133)\n- CROMA：将 attn_bias 注册为缓冲区 (#3232)\n- RCF\u002FMOSAIKS：性能加速 (#3242)\n- 权重：确保所有权重都没有空变换 (#3167)\n\n## 训练器\n\n- 变化检测：新增对预训练 BTC\u002FChangeViT 权重的支持 (#3131)\n\n## 文档\n\n- 切换到 pydata-sphinx 主题 (#3165, #3275, #3276, #3283)\n- 相关库：GeoAI 现已提供 GUI (#3193)\n- 更新 TorchGeo 引用信息 (#3229)\n- ChaBuD：修复主页及引用链接 (#3130)\n- OSCD：修复许可证问题 (#3174)\n- 移除 experiments 目录 (#3273)\n- 在 update_timeline.py 中添加缺失的版权头信息 (#3262)\n- 修复 pyproject.toml 中的拼写错误 (#3226)\n\n## 教程\n\n- 地理空间：使用现代 GDAL CLI 语法 (#3060)\n- 转换：修复 EuroSAT 可视化小部件 (#3171)\n- CLI：增加更多自定义配置选项 (#3266)\n- 地表水：移除未使用的类型忽略标记 (#3188)\n- 自定义栅格数据集：添加 dtype\u002F重采样覆盖示例 (#3186)\n- 为教程笔记本正确设置加速器 (#3149)\n\n## 测试\n\n- mypy：改进配置 (#3153","2026-01-25T16:07:19",{"id":158,"version":159,"summary_zh":160,"released_at":161},145463,"v0.8.0","# TorchGeo 0.8.0 发行说明\n\nTorchGeo 0.8 版本新增了 28 个预训练模型权重，并针对时序数据支持进行了多项改进，其中包括对所有 GeoDataset 和 GeoSampler 内部实现的全面重写。这些工作由来自世界各地的 23 名贡献者历时 8 个月共同完成。\n\n## 本次发布的主要亮点\n\n### 开放且独立的治理机制\n\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Ftorchgeo\u002Ftorchgeo\u002Fmain\u002Fdocs\u002F_static\u002Flogo\u002Flogo-color.svg\" width=\"400\" alt=\"TorchGeo logo\"\u002F>\n\n您可能已经注意到，原本位于 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftorchgeo 的仓库现已迁移至 https:\u002F\u002Fgithub.com\u002Ftorchgeo\u002Ftorchgeo。这绝非偶然！\n\n> [!NOTE]  \n> TorchGeo 现在属于全体社区成员！欢迎加入我们每月举行的 技术指导委员会 会议！\n\nTorchGeo 最初是微软 AI for Good 实验室于 2021 年的一个实习生项目。开源后，它迅速被 AI4EO 社区所采纳，其发展速度令人惊叹。自那以来，来自全球超过 100 位开发者为 TorchGeo 的成长做出了重要贡献。\n\n尽管 TorchGeo 是开源项目，但我们仍收到许多现有及潜在贡献者的反馈，指出由于项目归属微软，参与贡献存在一定困难。过去四年里，微软为 TorchGeo 提供了良好的孵化环境，然而我们认为，TorchGeo 已经超越了初创阶段，亟需更加独立和可持续的发展模式。\n\n在过去一年中，我们与微软紧密合作，共同探索解决方案。在此版本中，我们很高兴地宣布成立 TorchGeo _组织_，这是一个旨在保障 TorchGeo _项目_ 独立性与长期发展的治理机构。TorchGeo 组织由技术指导委员会（TSC）领导，其初始成员包括当前 TorchGeo 项目的维护者：\n\n* @adamjstewart (慕尼黑工业大学) - 主席\n* @calebrob6 (微软)\n* @anthonymlortiz (微软)\n* @isaaccorley (Wherobots)\n* @ashnair1 (Space42)\n* @nilsleh (慕尼黑工业大学)\n\nTorchGeo 现已迁移到 https:\u002F\u002Fgithub.com\u002Ftorchgeo，微软也慷慨地将该项目的版权无偿转让给了全体 TorchGeo _贡献者_。我们诚挚希望所有 TorchGeo 用户和开发者都能真正成为项目的主人，并邀请大家积极参与我们的 TSC 会议。更多信息及每月会议安排，请加入 TorchGeo Slack 中的 `#technical-steering-committee` 频道：[TorchGeo Slack](https:\u002F\u002Fjoin.slack.com\u002Ft\u002Ftorchgeo\u002Fshared_invite\u002Fzt-22rse667m-eqtCeNW0yI000Tl4B~2PIw)。\n\n除了这一全新的开放与独立治理机制外，TorchGeo 项目本身不会有太大变化。TorchGeo 将始终以 MIT 许可证开源，对所有用户和开发者免费开放。我们相信，这一变革将带来更多协作机会、基于 TorchGeo 构建的优秀库，以及对项目长期发展前景的更强信心！\n\n### 变化检测支持\n\n![BRIGHT 数据集](https:\u002F\u002Fgithub.com\u002Fuser-attachmen","2025-11-23T20:38:43",{"id":163,"version":164,"summary_zh":165,"released_at":166},145464,"v0.7.2","# TorchGeo 0.7.2 发行说明\n\n这是一个错误修复和维护版本。虽然没有新增功能或 API 变更，但此版本包含了重要的错误修复、文档改进以及在数据集、模型和测试方面的少量增强。\n\n## 依赖项\n\n* laspy：现在需要 2.5.3+ 版本才能使用 wheel 包 (#2988)\n* lightning：不支持 2.5.5 版本，该版本存在检查点加载错误 (#2996, #3000, #3052)\n* lightning：将 lightning[pytorch-extra] 替换为 lightning + jsonargparse (#2999)\n* rasterio：现在需要 1.3.11+ 版本才能支持非正方形像素 (#2969)\n* dependabot：不要固定 setuptools 版本，因为我们无论如何都无法跟踪它 (#2931)\n\n## 数据模块\n\n* DataModules：在训练数据加载器中使用 drop_last 标志 (#3061)\n* Augmentations：将 K.Resize 命令中的 int 类型替换为元组类型 (#2861)\n\n## 数据集\n\n* BRIGHT：修复 MD5 校验和 (#2864)\n* FTW：修复堆叠顺序以提高可重复性 (#2982)\n* HySpecNet-11k：修复文件路径中的错误 (#2924)\n* 非开源数据集现在从私有 Hugging Face 下载 (#2940)\n\n## 模型\n\n* 移除权重深拷贝的变通方法 (#2937)\n* Augmentations：将 K.Resize 命令中的 int 类型替换为元组类型 (#2861)\n* 非开源模型现在从私有 Hugging Face 下载 (#2940)\n\n## 文档\n\n* 贡献指南：增加了在本地构建文档的更详细说明 (#3044)\n* PyPI：添加了 Slack 和 Codecov 的链接 (#2930)\n\n## 教程\n\n* PyTorch：下载所有 EuroSAT 分割文件 (#2853)\n* 地理空间：更新 CRS\u002F投影相关图表 (#3048)\n* 嵌入：新增使用因子分解机生成嵌入的教程 (#2959)\n* 预训练权重：移除 Lightning 相关步骤，这些内容将在后续教程中介绍 (#2946)\n* 地震检测：重命名已弃用的 ResNet50 S1 权重 (#2951)\n* 移除 Google Colab 元数据 (#2851)\n\n## 测试\n\n* 确保 pyproject.toml 和 min-reqs.old 文件内容一致 (#2986)\n* Windows：在 .bat 模拟脚本中使用 python 而不是 python3 (#2901)\n* 移除孤立的 xView3 目录 (#2902)\n* 教程：测试下载功能是否正常 (#2891)\n* 自定义分割教程：模拟权重下载 (#3051)\n\n## 贡献者\n\n本版本的发布离不开以下贡献者的支持：\n\n* @adamjstewart\n* @ashnair1\n* @blaz-r\n* @boezzz\n* @calebrob6\n* @gatienc\n* @isaaccorley\n* @robmarkcole\n* @sfalkena\n* @wangyi111","2025-10-29T21:51:25",{"id":168,"version":169,"summary_zh":170,"released_at":171},145465,"v0.7.1","# TorchGeo 0.7.1 发行说明\n\n这是一个错误修复和维护版本。虽然没有新增功能或 API 变更，但此版本包含了重要的错误修复、文档改进以及在数据集、模型、训练器和测试方面的多项小改进。\n\n## 依赖项\n\n- dependabot：统一更新 pandas 组 (#2818)\n- jsonargparse：静默弃用警告 (#2774)\n- segmentation-models-pytorch：现需 0.5+ 版本 (#2740)\n- setuptools：现需 77.0.1+ 版本 (#2703)\n\n## 数据模块\n\n- NAIP\u002FChesapeake：修复训练集与测试集的重叠问题 (#2834)\n- SKIPP'D：添加到文档中 (#2778)\n- VHR-10：添加到文档中 (#2776)\n\n## 数据集\n\n- Intersection\u002FUnionDataset：简化 CRS\u002F分辨率的 getter\u002Fsetter 方法 (#2754)\n- BigEarthNet v2：修复验证目录名称错误 (#2825)\n- CopernicusPretrain：数据集应使用 yield 而非 return (#2768)\n- EuroSAT：即使图像目录已存在，也下载划分文件 (#2840)\n- FTW：在绘图中添加预测结果 (#2731, #2735)\n- FTW：将未压缩的测试数据添加到 Git 中 (#2746)\n\n## 模型\n\n- API：确保所有模型都位于工具函数或 Hub 中 (#2733)\n- CopernicusFM：修复不稳定测试 (#2710)\n- CopernicusFM：修正拼写错误 (#2770, #2844)\n\n## 采样器\n\n- 采样器：采样器应使用 yield 而非 return (#2766)\n- PreChippedGeoSampler：修复测试中的类型提示错误 (#2720)\n\n## 训练器\n\n- 分类任务：在绘图前应用 sigmoid 函数再进行阈值处理 (#2793)\n- 实例分割：在绘图前对图像进行反归一化处理 (#2744)\n- 实例分割：修复对非 RGB 图像的支持问题 (#2752)\n- 目标检测：修复对非 RGB 图像的支持问题 (#2752)\n- 语义分割：在绘图前应用 sigmoid 函数再进行阈值处理 (#2793)\n- 语义分割：现支持预训练的 ViT 权重 (#2787)\n\n## 文档\n\n- README：更新 TorchGeo 论文引用 (#2729)\n- README：更新 VHR-10 示例中的语法 (#2705)\n- 相关库：添加 GeoDeep 和 srai (#2730, #2758)\n- 相关库：DeepForest 曾经支持 TensorFlow (#2734)\n- Landsat TM：修复预训练权重的通道数错误 (#2836)\n- 更新 PyTorch 官方文档站点链接 (#2794)\n\n## 教程\n\n- PyTorch 入门：使用变换操作 (#2723)\n- 地理空间入门：修正错别字 (#2706)\n- 地震检测：加快教程测试速度 (#2721)\n- 贡献 DataModule：修正错别字 (#2708)\n- 贡献 NonGeoDataset：修复 Sphinx 指令错误 (#2784)\n\n## 贡献者\n\n本版本的发布离不开以下贡献者的努力：\n\n- @adamjstewart\n- @ashnair1\n- @canmike\n- @DarthReca \n- @ginamanou\n- @isaaccorley\n- @kiransiitg\n- @Night-dev1307\n- @pierotofy\n- @RaczeQ\n- @robmarkcole\n- @wangyi111","2025-06-20T18:37:08",{"id":173,"version":174,"summary_zh":175,"released_at":176},145466,"v0.7.0","# TorchGeo 0.7.0 发行说明\n\nTorchGeo 0.7 版本新增了 26 个预训练模型权重、33 个新数据集，以及更强大的训练器，凝聚了来自世界各地的 20 位贡献者历时 7 个月的辛勤工作。\n\n## 本次发布亮点\n\n> [!NOTE]  \n> 以下模型和数据集的描述由一位并不完美的“人类”撰写，而非大型语言模型生成。如有任何不准确之处，或您希望特别指出的内容，请随时联系 @adamjstewart。\n\n### 基础模型库不断壮大\n\n![全景架构](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F93211d28-9cc4-447b-a6e1-3ab55f677bee)\n\nTorchGeo 拥有一个日益丰富的[地球观测基础模型](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.04285)库，其中包括来自 13 篇论文的 94 个权重：\n\n* [GASSL](https:\u002F\u002Farxiv.org\u002Fabs\u002F2011.09980) (@kayush95 等，2020)：利用随时间变化的空间对齐图像构建时序正样本对，并提出了一种新颖的地理位置前置任务。非常适合处理高分辨率 RGB 数据，例如 Planet 或 Maxar 的影像。\n* [SeCo](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.16607) (@oscmansan 等，2021)：引入季节性对比的概念，通过空间对齐的时序图像，迫使模型学习对季节性增强、合成增强以及两者均不变的特征。\n* [SSL4EO-S12](https:\u002F\u002Farxiv.org\u002Fabs\u002F2211.07044) (@wangyi111 等，2022)：SeCo 的精神继承者，提供了针对 Sentinel-1\u002F2 数据的预训练模型，采用 MoCo、DINO 和 MAE 方法（新增）。\n* [Satlas](https:\u002F\u002Farxiv.org\u002Fabs\u002F2211.15660) (@favyen2 等，2022)：一系列基于 Swin V2 的预训练模型，训练数据量惊人，涵盖大量 Sentinel-2 和 NAIP 影像，并支持单张图像及多时相序列输入。随后还发布了 Sentinel-1 和 Landsat 相关模型。\n* [Scale-MAE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2212.14532) (@cjrd 等，2022)：首个明确支持广泛空间分辨率范围的 RGB 图像的基础模型。\n* [SSL4EO-L](https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.09424) (@adamjstewart 等，2023)：首批在 Landsat 影像上进行预训练的基础模型，覆盖 Landsat 4–5 (TM)、Landsat 7 (ETM+) 以及 Landsat 8–9 (OLI\u002FTIRS)。\n* [DeCUR](https:\u002F\u002Farxiv.org\u002Fabs\u002F2309.05300) (@wangyi111 等，2023)：采用一种新颖的多模态自监督学习策略，旨在促进学习通用表征的同时，保留各传感器特有的信息。\n* [FG-MAE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.18653) (@wangyi111 等，2023)：（新增）一种基于特征引导的 MAE 模型，预训练用于重建梯度直方图（HOG）及归一化差异指数（NDVI、NDWI、NDBI）。\n* [CROMA](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.00566) (@antofuller 等，2023)：（新增）结合对比学习与重建损失，以学习 MSI 和 SAR 数据的丰富表征。\n* [DOFA](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.15356) (@xiong-zhitong 等，2024)：提出了动态生成共享多模态编码器中补丁嵌入层的想法。","2025-04-05T19:46:16",{"id":178,"version":179,"summary_zh":180,"released_at":181},145467,"v0.6.2","# TorchGeo 0.6.2 发行说明\n\n这是一个错误修复版本。与 0.6.1 版本相比，本次发布没有新增功能或 API 变更。\n\n此版本将 TorchGeo 教程的数量**翻倍**，使学习 TorchGeo 比以往更加容易！所有教程现已重新组织如下：\n\n* [入门](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Ftutorials\u002Fgetting_started.html)：关于 PyTorch、地理空间数据和 TorchGeo 的背景知识\n* [基本用法](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Ftutorials\u002Fbasic_usage.html)：TorchGeo 的基本概念和组件及其使用方法\n* [案例研究](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Ftutorials\u002Fcase_studies.html)：常见遥感应用场景的端到端工作流程\n* [自定义](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Flatest\u002Ftutorials\u002Fcustomization.html)：根据需求自定义 TorchGeo，并将这些更改回馈社区\n\n如果您有尚未记录的应用场景，请考虑贡献一个新的案例研究教程！\n\n## 依赖项\n\n* pyvista：目前尚不支持 VTK 9.4 (#2431)\n* rasterio：现已支持 1.4.3 及以上版本 (#2442)\n\n## 数据集\n\n* Chesapeake 7\u002F13：移除对已删除类的引用 (#2388)\n* Chesapeake CVPR：修复下载链接 (#2445)\n* EuroSAT：修正 Sentinel-2 波段顺序 (#2480)\n* EuroSAT：在 Hugging Face 上重新分发划分文件 (#2432)\n* Forest Damage：修复 _verify 文档字符串 (#2401)\n* Million-AID：修复 _verify 文档字符串 (#2401)\n* UC Merced：在 Hugging Face 上重新分发划分文件 (#2433)\n* Utilities：从批处理函数中移除 defaultdict (#2398)\n\n## 模型\n\n* 为所有预训练权重添加 `bands` 元数据 (#2376)\n\n## 脚本\n\n* SSL4EO：GEE 上的 Sentinel-2 名称已更改 (#2421)\n\n## 测试\n\n* CI：缓存名称更易读 (#2426)\n* 模型：测试 `bands` 是否与预期维度匹配 (#2383)\n\n## 文档\n\n* 文档：更新替代方案 (#2437)\n* 文档：重新组织教程层级结构 (#2439)\n* 添加 PyTorch 入门教程 (#2440, #2467)\n* 添加地理空间数据入门教程 (#2446, #2467)\n* 添加 TorchGeo 入门教程 (#2457)\n* 添加 TorchGeo CLI 教程 (#2479)\n* 添加地球表面水体教程 (#960)\n* 添加非地理数据集的贡献教程 (#2451, #2469)\n* 添加数据模块的贡献教程 (#2452)\n* 在所有教程中添加一致的作者和版权信息 (#2478)\n* 更新变换和预训练权重相关教程 (#2454)\n* README：修正控制台代码的语法高亮显示 (#2482)\n* README：将 GeoDatasets 的路径根目录调整为 `paths` (#2438)\n\n## 贡献者\n\n本版本的发布离不开以下贡献者的努力：\n\n@adamjstewart  \n@calebrob6  \n@cordmaur  \n@giswqs  \n@hfangcat  \n@InderParmar  \n@lhackel-tub  \n@nilsleh  \n@yichiac","2024-12-19T23:22:37",{"id":183,"version":184,"summary_zh":185,"released_at":186},145468,"v0.6.1","# TorchGeo 0.6.1 发行说明\n\n这是一个错误修复版本。与 0.6.0 版本相比，本次发布没有新增功能或 API 变更。\n\n此版本修复了一个重要的 [安全漏洞](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftorchgeo\u002Fpull\u002F2323)，并正确记录了对 [rasterio 1.4 的不支持](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftorchgeo\u002Fpull\u002F2327)。建议所有使用 `torchgeo.models.get_weight` 的用户升级到 TorchGeo 0.6.1。\n\n## 依赖项\n\n* rasterio：目前仍不支持 1.4 版本 (#2327)\n\n## 数据模块\n\n* 数据模块：在并行数据加载中使用持久化工作进程 (#2291)\n* OSCD：更新归一化统计信息 (#2282)\n\n## 数据集\n\n* 数据集：添加对 `os.PathLike` 的支持 (#2273)\n* GeoDataset：允许混合使用 `str` 和 `pathlib` 路径 (#2270)\n\n## 模型\n\n* API：避免在 `get_weight` 中使用 `eval` 方法 (#2323)\n\n## 测试\n\n* CD：设置持续部署至 PyPI (#2342)\n* CI：安装 TensorBoard 以加快笔记本运行速度 (#2315)\n* CI：从检出的仓库安装 TorchGeo (#2306)\n* dependabot：仅更新 npm 锁文件 (#2277)\n* prettier：忽略缓存目录 (#2278)\n* prettier：优先使用单引号 (#2280)\n* pytest：设置默认的 `--cov` 和 `--cov-report` (#2275)\n* pytest：也在本地设置 matplotlib 后端 (#2326)\n* pytest：静默 PyTorch 中的 NumPy 2 警告 (#2302)\n* ruff：移除 NPY 测试，因为我们现在已经在 CI 中测试 NumPy 2 (#2287)\n\n## 文档\n\n* 替代方案：将 scikit-eo 添加到 TorchGeo 替代方案列表中 (#2340)\n* 贡献指南：与安装无关的 prettier 使用方式 (#2279)\n* 数据集：将数据集 CSV 文件移动到子目录 (#2281, #2304)\n* 数据集：更新 NAIP 分辨率 (#2325)\n* 教程：通过签名 URL 修复 NAIP 下载问题 (#2343)\n* 教程：更新包含图像和掩码的栅格数据集的推荐策略 (#2293)\n\n## 贡献者\n\n本次发布感谢以下贡献者：\n\n@adamjstewart\n@calebrob6 \n@MathiasBaumgartinger\n@Nowosad\n@sfalkena","2024-10-10T18:22:20",{"id":188,"version":189,"summary_zh":190,"released_at":191},145469,"v0.6.0","# TorchGeo 0.6.0 发行说明\n\nTorchGeo 0.6 新增了 18 个数据集、15 个数据模块和 27 个预训练模型，凝聚了来自全球 23 位贡献者历时 11 个月的辛勤工作。\n\n## 本次发布的主要亮点\n\n### 多模态基础模型\n\n![统一的多模态地球基础模型示意图](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fd231817f-9d48-49c2-ba79-56a2c20cc60e)\n\n在任何时刻，都有 [数千颗对地观测卫星](https:\u002F\u002Forbit.ing-now.com\u002F) 在绕地球运行。传统上，若要在深度学习流水线中使用其中一颗卫星的数据，首先需要收集该传感器拍摄的数百万张人工标注图像来训练模型。自监督学习虽然实现了无需标签的预训练，但仍需数百万张多样化的特定传感器图像，这使得新发射或价格昂贵的商业卫星难以被利用。\n\nTorchGeo 0.6 引入了多个新的 [多模态基础模型](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.04285)，这些模型能够处理来自任意卫星或传感器的影像，即便模型并未针对这些特定数据显式训练过。尽管 [GASSL](https:\u002F\u002Farxiv.org\u002Fabs\u002F2011.09980) 和 [Scale-MAE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2212.14532) 只支持 RGB 影像，但 [DOFA](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.15356) 则支持 RGB、SAR、MSI 和 HSI 等多种类型，且光谱波段数量不限。它采用了一种新颖的基于波长的编码器，将每个波段的光谱波长映射到训练过程中见过的已知波长范围内。\n\n下表描述了这些模型通过其训练数据（隐式）或模型架构（显式）所提供的动态空间分辨率、时间跨度和\u002F或光谱波段支持：\n\n| 模型 | 空间分辨率 | 时间跨度 | 光谱波段 |\n| --- | --- | --- | --- |\n| [DOFA](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.15356) | 隐式 | — | 显式 |\n| [GASSL](https:\u002F\u002Farxiv.org\u002Fabs\u002F2011.09980) | 隐式 | — | — |\n| [Scale-MAE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2212.14532) | 显式 | — | — |\n\n此外，TorchGeo 0.6 还新增了多个单模态基础模型，包括 [DeCUR](https:\u002F\u002Farxiv.org\u002Fabs\u002F2309.05300) 和 [SatlasPretrain](https:\u002F\u002Farxiv.org\u002Fabs\u002F2211.15660)。\n\n### Source Cooperative 数据迁移\n\n![从 Radiant MLHub 迁移到 Source Cooperative](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fb1328fde-5424-4ca5-af15-1ebb9cf2179c)\n\nTorchGeo 包含了多个来自近期已停止运营的 [Radiant MLHub](https:\u002F\u002Fmlhub.earth\u002F) 的数据集：\n\n* [AgriFieldNet 竞赛数据集](https:\u002F\u002Fbeta.source.coop\u002Fradiantearth\u002Fagrifieldnet-competition\u002F)\n* [贝宁小农腰果种植园](https:\u002F\u002Fbeta.source.coop\u002Ftechnoserve\u002Fcashews-benin\u002F)\n* [Sentinel-2 云覆盖分割数据集](https:\u002F\u002Fbeta.source.coop\u002Fradiantearth\u002Fcloud-cover-detection-challenge\u002F)\n* [CV4A 肯尼亚作物类型竞赛](https:\u002F\u002Fbeta.source.coop\u002Fradiantearth\u002Fafrican-crops-kenya-02\u002F)\n* [热带气旋风速估算竞赛](https:\u002F\u002Fbeta.source.coop\u002Fnasa\u002Ftrop","2024-09-01T10:12:02",{"id":193,"version":194,"summary_zh":195,"released_at":196},145470,"v0.5.2","# TorchGeo 0.5.2 发行说明\n\n这是一个错误修复版本。与 0.5.1 版本相比，没有新增功能或 API 变更。\n\n此版本包含多项重要的可复现性和确定性修复。建议所有用户升级到 0.5.2，以确保其工作的可复现性。\n\nTorchGeo 一直支持 Python 3.12，现在也正式通过了测试！\n\n## 依赖项\n\n* 测试 TorchGeo 对 Python 3.12 的支持 (#1837)\n* lightly 1.4.26 与 smp 不兼容 (#1824, #1825)\n* 添加开发容器以支持 GitHub Codespaces 开发 (#1085)\n\n## 数据模块\n\n* L7 Irish 此前使用非确定性的训练\u002F验证\u002F测试划分。现已修复 (#1899, #1908)\n* L8 Biome 此前使用非确定性的训练\u002F验证\u002F测试划分。现已修复 (#1899, #1908)\n* 热带气旋此前使用非确定性的训练\u002F验证\u002F测试划分。现已修复 (#1839)\n* SEN12MS 此前使用非确定性的训练\u002F验证\u002F测试划分。现已修复 (#1839)\n\n## 数据集\n\n* RasterDataset：澄清 is_image 和 dtype 的文档说明 (#1811)\n* GeoDataset 此前使用非确定性的训练\u002F验证\u002F测试划分。现已修复 (#1899, #1908)\n* xView2 此前采用非确定性的顺序。现已修复 (#1918)\n* HuggingFace：使用稳定的下载 URL (#1916)\n* GitLab：使用稳定的下载 URL (#1917)\n* Deep Globe 土地覆盖：记录下载步骤 (#1797, #1921)\n* PASTIS：修复默认折叠设置 (#1810)\n* SustainBench 作物产量：修复下载支持问题 (#1753, #1755)\n* SustainBench 作物产量：启用 eager 数据加载模式 (#1754, #1756)\n\n## 模型\n\n* HuggingFace：使用稳定的下载 URL (#1916)\n* ViTSmall16_Weights：修复拼写错误 (#1904)\n\n## 采样器\n\n* RandomGeoSampler：可选长度参数为可选项 (#1907)\n\n## 训练器\n\n* 移除调用 torchmetrics 之前的不必要的 argmax 操作 (#1777)\n* 更好地记录默认训练器指标 (#1874, #1914, #1923, #1924)\n* ObjectDetectionTask：提高测试覆盖率 (#1739)\n\n## 脚本\n\n* SSL4EO 下载：跳过缺失坐标文件的下载 (#1821)\n* 确保所有文件顶部均包含许可证头 (#1787)\n\n## 测试\n\n* 笔记本：使用稳定的依赖版本 (#1838)\n* 不再将警告转换为错误 (#1793)\n* 修复 lightning-utilities 已弃用警告 (#1733)\n* 修复 pre-commit 依赖版本问题 (#1781)\n\n## 文档\n\n* RasterDataset：澄清 is_image 和 dtype 的文档说明 (#1811)\n* RtD：使用稳定的依赖版本 (#1827)\n* 记录 TorchGeo 的替代方案 (#1742)\n* 教程：load_state_dict 不会返回模型 (#1503)\n* README：修复 VHR-10 示例 (#1686, #1920)\n* README：添加 TorchGeo 播客节目 (#1806)\n* README：添加 PyTorch 徽章 (#1882)\n* README：添加 OSGeo 徽章 (#1880)\n* README：为 bibtex 添加颜色语法高亮 (#1820)\n* README：修复 Spack 链接 (#1804)\n\n## 贡献者\n\n本次发布感谢以下贡献者：\n\n@adamjstewart\n@ashnair1\n@calebrob6\n@DimitrisMantas \n@dmeaux","2024-03-03T19:51:38",{"id":198,"version":199,"summary_zh":200,"released_at":201},145471,"v0.5.1","# TorchGeo 0.5.1 Release Notes\r\n\r\nThis is a bugfix release. There are no new features or API changes with respect to the 0.5.0 release.\r\n\r\n## Datamodules\r\n\r\n- EuroSAT: make channel normalization statistics responsive to dynamic band selection (#1634, #1681)\r\n\r\n## Datasets\r\n\r\n- AGB Live Woody Biomass: update download link for dataset (#1679, #1713)\r\n- EuroSAT: remove classes attribute and instead rely on `ImageFolder` classes (#1648, #1650)\r\n- OSCD: change image datatype be float instead of int (#1652, #1656)\r\n- RESICS45: remove classes attribute and instead rely on `ImageFolder` classes (#1648, #1650)\r\n- UC Merced: fix plotting which expects images from dataset to be normalized already (#1712)\r\n- UC Merced: remove classes attribute and instead rely on `ImageFolder` classes (#1648, #1650)\r\n- GeoDataset: check if the path points to a Virtual File System, to prevent error of looking and not finding the paths locally (#1605, #1612)\r\n- GeoDatasets: consistent use of `paths` argument instead of `root` in `RuntimeError` of several datasets (#1704, #1717)\r\n\r\n## Trainers\r\n\r\n- During logging, trainers were expecting a datamodule with plot functionality, which was preventing trainers from being used with custom Pytorch Dataloaders (#1703)\r\n- Remove default callback configurations of trainers and leave it to user instead (#1640, #1641, #1642, #1645, #1647)\r\n- Skip weights and augmentations when saving hparams, allowing these parameters to be changed (#1622, #1639, #1670)\r\n\r\n## Scripts\r\n\r\n- Solve logging conflict by allowing `config.yaml` file to be overwritten (#1621, #1625)\r\n\r\n## Tests\r\n\r\n- Greatly reduce memory footprint of CI which was causing PR tests to fail (#1658)\r\n- Copy testing csv file instead of downloading it for MapInWild dataset test (#1657)\r\n- Fix `choco install unrar` in CI by using `7zip` instead of `unrar` (#1697)\r\n- CI: use unique names for release caches (#1723)\r\n\r\n## Documentation\r\n\r\n- README: update `SemanticSegmentationTask` example with arguments introduced in 0.5 (#1608)\r\n- README: add section on LightningCLI usage with torchgeo (#1626, #1628)\r\n- README: add section on availability of pretrained weights in torchgeo (#1716)\r\n- BioMassters: fix typo in docs' overview table of non-geo datasets (#1718)\r\n- SSL4EO-L Benchmark: add dataset information to documentation (#1719)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors (in alphabetical order):\r\n\r\n@adamjstewart\r\n@ashnair1\r\n@dylanrstewart\r\n@kaybe20\r\n@menglutao\r\n@nilsleh\r\n@pioneerHitesh\r\n@robmarkcole\r\n\r\n\r\n\r\n","2023-11-10T16:46:48",{"id":203,"version":204,"summary_zh":205,"released_at":206},145472,"v0.5.0","# TorchGeo 0.5.0 Release Notes\r\n\r\n0.5.0 encompasses over 8 months of hard work and new features contributed by 20 users from around the world. Below, we detail specific features worth highlighting.\r\n\r\n## Highlights of this release\r\n\r\n### New command-line interface\r\n\r\nTorchGeo has always had tight integration with [PyTorch Lightning](https:\u002F\u002Flightning.ai\u002Fpytorch-lightning), including [datamodules](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Fdatamodules.html) for common benchmark datasets and [trainers](https:\u002F\u002Ftorchgeo.readthedocs.io\u002Fen\u002Fstable\u002Fapi\u002Ftrainers.html) for most computer vision tasks. TorchGeo 0.5.0 introduces a new command-line interface for model training based on [LightningCLI](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html). It can be invoked in two ways:\r\n```bash\r\n# If torchgeo has been installed\r\ntorchgeo\r\n# If torchgeo has been installed, or if it has been cloned to the current directory\r\npython3 -m torchgeo\r\n```\r\nIt supports command-line configuration or YAML\u002FJSON config files. Valid options can be found from the help messages:\r\n```bash\r\n# See valid stages\r\ntorchgeo --help\r\n# See valid trainer options\r\ntorchgeo fit --help\r\n# See valid model options\r\ntorchgeo fit --model.help ClassificationTask\r\n# See valid data options\r\ntorchgeo fit --data.help EuroSAT100DataModule\r\n```\r\nUsing the following config file:\r\n```yaml\r\ntrainer:\r\n  max_epochs: 20\r\nmodel:\r\n  class_path: ClassificationTask\r\n  init_args:\r\n    model: \"resnet18\"\r\n    in_channels: 13\r\n    num_classes: 10\r\ndata:\r\n  class_path: EuroSAT100DataModule\r\n  init_args:\r\n    batch_size: 8\r\n  dict_kwargs:\r\n    download: true\r\n```\r\nwe can see the script in action:\r\n```bash\r\n# Train and validate a model\r\ntorchgeo fit --config config.yaml\r\n# Validate-only\r\ntorchgeo validate --config config.yaml\r\n# Calculate and report test accuracy\r\ntorchgeo test --config config.yaml\r\n```\r\nIt can also be imported and used in a Python script if you need to extend it to add new features:\r\n```python\r\nfrom torchgeo.main import main\r\n\r\nmain([\"fit\", \"--config\", \"config.yaml\"])\r\n```\r\nSee the [Lightning documentation](https:\u002F\u002Flightning.ai\u002Fdocs\u002Fpytorch\u002Fstable\u002Fcli\u002Flightning_cli.html) for more details.\r\n\r\n### Self-supervised learning and Landsat\r\n\r\n![SSL4EO-S12 Logo](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftorchgeo\u002Fassets\u002F12021217\u002F31d9fd60-242c-4f60-8c44-fb1cb4b91f42)\r\n\r\nSelf-supervised learning has become a dominant technique for model pre-training, especially in domains (like remote sensing) that are rich in data but lacking in large labeled datasets. The 0.5.0 release adds powerful trainers for the following SSL techniques:\r\n\r\n* BYOL [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2006.07733)]\r\n* MoCo [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F1911.05722), [2](https:\u002F\u002Farxiv.org\u002Fabs\u002F2003.04297), [3](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.02057)]\r\n* SimCLR [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2002.05709), [2](https:\u002F\u002Farxiv.org\u002Fabs\u002F2006.10029)]\r\n\r\nlarge unlabeled datasets for multiple satellite platforms:\r\n\r\n* SeCo [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.16607)]\r\n* SSL4EO-L [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.09424)]\r\n* SSL4EO-S12 [[1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2211.07044)]\r\n\r\nand the first ever models pre-trained on Landsat imagery. See our [SSL4EO-L paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.09424) for more details.\r\n\r\n### Utilities for splitting GeoDatasets\r\n\r\nIn prior releases, the only way to create train\u002Fval\u002Ftest splits of GeoDatasets was to use a Sampler `roi`. This limited the types of splits you could perform, and was unintuitive for users coming from PyTorch where the dataset can be split into multiple datasets. TorchGeo 0.5.0 introduces new splitting utilities for GeoDatasets in `torchgeo.datasets`, including:\r\n\r\n* `random_bbox_assignment`: randomly assigns each scene to a different split\r\n* `random_bbox_splitting`: randomly split each scene and assign each half to a different split\r\n* `random_grid_cell_assignment`: overlay a grid and randomly assign each grid cell to a different split\r\n* `roi_split`: split using a `roi` just like with Sampler\r\n* `time_series_split`: split along the time axis\r\n\r\nSplitting with a Sampler `roi` is not yet deprecated, but users are encouraged to adopt the new dataset splitting utility functions.\r\n\r\n### GeoDatasets now accept lists as input\r\n\r\nPreviously, each GeoDataset accepted a single root directory as input. Now, users can pass one or more directories, or a list of files they want to include. At first glance, this doesn't seem like a big deal, but it actually opens a lot of possibilities for how users can construct GeoDatasets. For example, users can use custom filters:\r\n```python\r\nfiles = []\r\nfor file in glob.glob(\"*.tif\"):\r\n    # check pixel QA band or metadata file\r\n    if cloud_cover \u003C 20:  # select images with minimal cloud cover\r\n        files.append(file)\r\nds = Landsat8(files)\r\n```\r\nor use remote files from S3 buckets or Azure blob storage. Basically, as long as GDAL knows how to read the file, TorchGeo supports it, wherever the file lives.\r\n\r\nNote that some datasets may not support a list of files if","2023-09-30T21:53:35",{"id":208,"version":209,"summary_zh":210,"released_at":211},145473,"v0.4.1","# TorchGeo 0.4.1 Release Notes\r\n\r\nThis is a bugfix release. There are no new features or API changes with respect to the 0.4.0 release.\r\n\r\n## Dependencies\r\n\r\nSome dependencies have changed:\r\n\r\n* nbmake: 1.3.3+ required now (#1124)\r\n* omegaconf: now optional (#1214)\r\n* pytorch-lightning: replaced with lightning (#1178, #1179)\r\n* sphinx: 6+ not yet supported (#1144)\r\n* tensorboard: now optional (#1214)\r\n* `pip install torchgeo[all]` added, installs all optional dependencies (#1095)\r\n\r\nOther dependencies now support newer versions:\r\n\r\n* black: add 23 support (#1080)\r\n* kornia: add 0.6.10 support (#1123)\r\n* mypy: add 1 support (#1089)\r\n* nbsphinx: add 0.9 support (#1173)\r\n* pandas: add 2 support (#1216)\r\n* pyvista: add 0.38 support (#1083)\r\n* radiant-mlhub: add 0.5 support (#1102)\r\n* scikit-image: add 0.20 support (#1153)\r\n* setuptools: add 67 support (#1066)\r\n* torch: add 2 support (#1177)\r\n* torchvision: add 0.15 support (#1177)\r\n\r\n## Datamodules\r\n\r\n* SeCo: fix transforms (#1166)\r\n\r\n## Datasets\r\n\r\nFixes for benchmark datasets:\r\n\r\n* BigEarthNet: fix order of class labels (#1127)\r\n* CDL: add checksum for 2022 mask (#1201)\r\n* EuroSAT: fix SSL issue, redistribute on Hugging Face (#1065, #1072)\r\n* FAIR1M: fix directory name (#1098, #1099)\r\n* Landsat: better default bands (#1169)\r\n* UC Merced: redistribute on Hugging Face (#1076)\r\n* USAVars: fix class labels (#1138)\r\n\r\nFixes for base classes:\r\n\r\n* RasterDataset: fix support for datasets where `all_bands` does not actually contain _all_ bands (e.g., Landsat) (#1134, #1135)\r\n* RasterDataset: fix support for datasets where `all_bands` is not defined and `separate_files` is False (#1135)\r\n* RasterDataset: fix bug when `separate_files` and no date in `filename_regex` (#1191)\r\n* RasterDataset: remove unnecessary glob (#1219)\r\n* RasterDataset: better error message when no data found (#1193)\r\n* IntersectionDataset: better error message when no overlap (#1192)\r\n\r\n## Models\r\n\r\nThere are several improvements to our new pre-trained weights:\r\n\r\n* Add sha256 suffix for security (#1105)\r\n* Add and improve normalizations (#1119, #1166)\r\n\r\n## Trainers\r\n\r\n* BYOL: Fix image size to match ViT patch size (#1084)\r\n* Fix support for loading ViT weights (#1049, #1084)\r\n* Fix support for non-TensorBoardLogger (#1143, #1145)\r\n\r\n## Tests\r\n\r\nA lot of work in this patch release went towards improving CI:\r\n\r\n* Constrain dependencies to avoid CI hang (#1062)\r\n* Codecov: use repository upload token (#1077)\r\n* Cache pip installs (#1057)\r\n* Cancel in-progress jobs on new commit (#1094) but not the labeler tasks (#1187)\r\n* Test notebooks when they are modified (#1097)\r\n* Speed up object detection tests (#1148)\r\n* Fix tests on macOS arm64 (MPS support) (#1188)\r\n* Properly test pre-trained model transforms (#1166)\r\n* Speed up notebook tests (#665, #1124)\r\n\r\n## Documentation\r\n\r\n* Update the example embedded in the README (#1211)\r\n* Fix broken URLs throughout the documentation (#1125)\r\n* Tutorial downloads are now much smaller and faster (#1124)\r\n* Replace CSV with TensorBoard in Trainer tutorial (#1163, #1189)\r\n* Fix version selection button (#1144)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors:\r\n\r\n@adamjstewart\r\n@ashnair1\r\n@bugraaldal\r\n@calebrob6\r\n@isaaccorley \r\n@julien-blanchon\r\n@lucastao\r\n@nilsleh\r\n@SpontaneousDuck\r\n@TolgaAktas","2023-04-11T21:52:27",{"id":213,"version":214,"summary_zh":215,"released_at":216},145474,"v0.4.0","# TorchGeo 0.4.0 Release Notes\r\n\r\nThis is our biggest release yet, with improved support for pre-trained models, faster datamodules and transforms, and more powerful trainers. See the following sections for specific changes to each module:\r\n\r\n- [Backwards-incompatible changes](#user-content-changes)\r\n- [Dependencies](#user-content-dependencies)\r\n- [Datamodules](#user-content-datamodules)\r\n- [Datasets](#user-content-datasets)\r\n- [Models](#user-content-models)\r\n- [Samplers](#user-content-samplers)\r\n- [Trainers](#user-content-trainers)\r\n- [Transforms](#user-content-transforms)\r\n- [Documentation](#user-content-documentation)\r\n\r\nAs always, thanks to our many [contributors](#user-content-contributors)!\r\n\r\n\u003Ch2 id=\"changes\">\r\nBackwards-incompatible changes\r\n\u003C\u002Fh2>\r\n\r\n* Datasets: So2Sat bands were renamed (#735)\r\n* Datasets: TropicalCycloneWindEstimation was renamed to TropicalCyclone (#815, #846)\r\n* Datasets: VisionDataset and VisionClassificationDataset (deprecated in 0.3) have been removed (#627)\r\n* Datamodules: many arguments have been renamed or reordered (#666, #730, #992)\r\n* Datamodules: CycloneDataModule was renamed to TropicalCycloneDataModule (#815, #846)\r\n* Models: resnet50 has a new multi-weight API (#917)\r\n* Trainers: many arguments have been renamed (#916, #917, #918, #919, #920)\r\n* Transforms: now take a single image as input instead of a sample dict (#999)\r\n\r\n\u003Ch2 id=\"dependencies\">\r\nDependencies\r\n\u003C\u002Fh2>\r\n\r\n* Open3D replaced by PyVista (#663)\r\n* Remove packaging dependency (#1019)\r\n* Support einops 0.6 (#896)\r\n* Support flake8 6 (#910)\r\n* Support mypy 0.991 (#900)\r\n* Support pytest-cov 4 (#801)\r\n* Support pyupgrade 3 (#817)\r\n* Support setuptools 66 (#1017)\r\n* Support shapely 2 (#949)\r\n* Support sphinx 6 (#990)\r\n* Support timm 0.6 (#1002)\r\n* Support torchmetrics 0.11 (#925)\r\n* Support torchvision 0.14 (#875)\r\n\r\n\u003Ch2 id=\"datamodules\">\r\nDatamodules\r\n\u003C\u002Fh2>\r\n\r\nOur existing datamodules worked well, but suffered from several performance issues. For the average dataset with 3 splits (train\u002Fval\u002Ftest), we were instantiating the dataset 10 times! All data augmentation was done on the CPU, one sample at a time. A multiprocessing bug prevented parallel data loading on macOS and Windows. And a serious bug was discovered in some of our datamodules that allowed training images to leak into the test set (only affected datamodules using `torchgeo.datamodules.utils.dataset_split`). All of these bugs have been fixed, and performance has been drastically improved. Datasets are only instantiated 3 times (once for each split). All data augmentation happens on the GPU, an entire batch at a time. And multiprocessing is now supported on all platforms. By refactoring our datamodules and adding new base classes, we were able to remove 1.6K lines of duplicated code in the process!\r\n\r\nNew datamodules:\r\n\r\n* GID-15 (#928)\r\n* SpaceNet1 (#965)\r\n\r\nChanges to existing datamodules:\r\n\r\n* Only instantiate dataset in prepare_data if download is requested (#967, #974)\r\n* Only instantiate datasets needed for a given stage (#992)\r\n* Use Kornia for all data augmentation (#992)\r\n* Faster data augmentation (CPU → GPU, sample → batch) (#992)\r\n* Fix macOS\u002FWindows multiprocessing bug (#886, #992)\r\n* Fix bug with train images leaking into test set (#992)\r\n* Add plot method to all datamodules (#814, #992)\r\n* `torchgeo.datamodules.utils.dataset_split` is deprecated, use `torch.utils.data.random_split` instead (#992)\r\n* Pass kwargs directly to datasets (#666, #730)\r\n* Add random cropping to several datamodules (#851, #853, #855, #876, #929)\r\n* Inria Aerial Image Labeling: fix predict dimensions (#975)\r\n* LandCover.ai: fix mIoU calculation and plotting (#959)\r\n* Tropical Cyclone: CycloneDataModule was renamed to TropicalCycloneDataModule (#815, #846)\r\n\r\nNew base classes:\r\n\r\n* Add GeoDataModule and NonGeoDataModule base classes (#992)\r\n\r\n\u003Ch2 id=\"datasets\">\r\nDatasets\r\n\u003C\u002Fh2>\r\n\r\nThis release adds a new Sentinel-1 dataset. Here is a scene taken over the Big Island of Hawai'i:\r\n\r\n![HH_HV](https:\u002F\u002Fuser-images.githubusercontent.com\u002F12021217\u002F205945840-2a3a070a-6366-4b90-bed3-ac052ba7b412.png)\r\n\r\nAdditionally, all image datasets now have a `plot` method.\r\n\r\nNew datasets:\r\n\r\n* Cloud Cover Detection (#510)\r\n* Sentinel-1 (#821)\r\n* SpaceNet 6 (#878)\r\n\r\nChanges to existing datasets:\r\n\r\n* Add default root argument to all datasets (#802)\r\n* Consistent capitalization of band names (#778)\r\n* Many datasets now return float images and int labels (#992)\r\n* Chesapeake CVPR: add plot method (#820)\r\n* ETCI 2021: fix data loading (#861)\r\n* NASA Marine Debris: fix plot warning when model outputs no prediction boxes (#988)\r\n* OSCD: images are now stacked channel-wise (#992)\r\n* SEN12MS: mask is only single channel (#992)\r\n* Sentinel-2: use 10,000 as scale factor (#1027)\r\n* So2Sat: rename bands (#735)\r\n* Tropical Cyclone: renamed from TropicalCycloneWindEstimation to TropicalCyclone (#815, #846)\r\n* Tropical Cyclone: images are RGB, not grayscale (#992)\r\n* VHR-10: add plot method (#847)\r","2023-01-24T23:47:51",{"id":218,"version":219,"summary_zh":220,"released_at":221},145475,"v0.3.1","# TorchGeo 0.3.1 Release Notes\r\n\r\nThis is a bugfix release. There are no new features or API changes with respect to the 0.3.0 release.\r\n\r\n## Dependencies\r\n\r\n* pytorch-lightning: add 1.9 support (#697, #771)\r\n* radiant-mlhub: 0.5 not yet supported (#711)\r\n* segmentation-models-pytorch: add 0.3 support (#692)\r\n* setuptools: add 65 support (#715, #753)\r\n* torchvision: fix 0.12 pretrained model support (#761)\r\n\r\n## DataModules\r\n\r\n* Fix rounding bugs in train\u002Fval\u002Ftest split sizes (#675, #679, #736)\r\n\r\n## Datasets\r\n\r\n* Fix rounding bugs leading to inconsistent image shapes in vector datasets (#674, #675, #679, #736)\r\n* IDTReeS: fix (x, y) coordinate swap in boxes (#683, #684)\r\n* IDTReeS: clip boxes to bounds of image (#684, #760)\r\n* Sentinel-2: add support for files downloaded from USGS EarthExplorer (#505, #754)\r\n* Sentinel-2: prevent dataset from loading bands at different resolutions (#754)\r\n* Sentinel-2: support loading even when band B02 is not present (#754)\r\n\r\n## Samplers\r\n\r\n* GridGeoSampler: adjust stride of last row\u002Fcol to sample entire ROI (#431, #448, #630)\r\n\r\n## Transforms\r\n\r\n* NDVI: fix computation, we were computing the negative (#713, #714)\r\n* SWI: fix band names (#714)\r\n\r\n## Documentation\r\n\r\nAPI docs:\r\n\r\n* USAVars is a regression dataset (#699)\r\n\r\nTutorials:\r\n\r\n* Use IntersectionDataset in sampler (#707)\r\n* Custom Raster Datasets: complete overhaul with real data (#766, #772)\r\n* Trainers: optional datasets required (#759)\r\n* Transforms: replace cell magic with shell command (#756)\r\n* Transforms: fix GPU usage (#763, #767)\r\n* Clean up file names, execution counts, and output (#770)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors:\r\n\r\n* @adamjstewart\r\n* @ashnair1 \r\n* @calebrob6 \r\n* @isaaccorley \r\n* @remtav\r\n* @TCherici ","2022-09-08T21:30:22",{"id":223,"version":224,"summary_zh":225,"released_at":226},145476,"v0.3.0","# TorchGeo 0.3.0 Release Notes\r\n\r\nThis release contains a number of new features, and brings increased stability to installations and testing. \r\n\r\nIn previous releases, not all dependencies had a minimum supported version listed, causing issues if users had old versions lying around. Old releases would also install the latest version of all dependencies even if they had never been tested before. TorchGeo now lists a minimum and maximum supported version for all dependencies. Moreover, we now test the minimum supported versions of all dependencies. Dependencies are automatically updated using dependabot to prevent unrelated CI failures from sneaking into PRs. We hope this makes it even easier to contribute to TorchGeo, and ensures that old releases will continue to work even if our dependencies make backwards-incompatible changes.\r\n\r\n## Backwards-incompatible changes\r\n\r\n* VisionDataset and VisionClassificationDataset have been renamed to NonGeoDataset and NonGeoClassificationDataset (#627)\r\n* Sample size now defaults to pixel units, use `units=Units.CRS` for old behavior (#294)\r\n* RasterDataset no longer has a plot method, subclasses have their own plot methods (#476)\r\n* Plot method of RasterDataset subclasses now take sample dicts, not image tensors (#476)\r\n* Removed FCEF model, use segmentation_models_pytorch.Unet instead (#345)\r\n* SemanticSegmentationTrainer: ignore_zeros renamed to ignore_index (#444, #644)\r\n\r\n## Dependencies\r\n\r\n* Python 3.7+ is now required (#413, #482, #486)\r\n* Add lower version bounds to all dependencies based on testing (#574)\r\n* Add upper version bounds to all dependencies based on semver (#544, #557)\r\n* Fix Conda environment installation (#527, #528, #529, #545)\r\n\r\n## Datamodules\r\n\r\nNew datamodules:\r\n\r\n* Inria Aerial Image Labeling (#498)\r\n* USAVars (#441)\r\n\r\nChanges to existing datamodules:\r\n\r\n* Improved consistency between datamodules (#657)\r\n\r\n## Datasets\r\n\r\nNew datasets:\r\n\r\n* Aboveground Live Woody Biomass Density (#425)\r\n* Aster GDEM (#404)\r\n* CMS Global Mangrove Canopy (#391, #427)\r\n* DeepGlobe (#578)\r\n* DFC 2022 (#354)\r\n* EDDMapS (#533)\r\n* EnviroAtlas (#364)\r\n* Esri 2020 Land Cover (#390, #405)\r\n* EU-DEM (#426)\r\n* Forest Damage (#461, #499)\r\n* GBIF (#507)\r\n* GlobBiomass (#395)\r\n* iNaturalist (#532)\r\n* Inria Aerial Image Labeling (#355)\r\n* Million-AID (#455)\r\n* OpenBuildings (#68, #402)\r\n* ReforesTree (#582)\r\n* SpaceNet 3 (#480)\r\n* USAVars (#363)\r\n\r\nChanges to existing datasets:\r\n\r\n* Benin Small Holder Cashews: return geospatial metadata (#377)\r\n* BigEarthNet: fix checksum (#550)\r\n* CBF: add plot method (#410)\r\n* CDL: add 2021 download (#418)\r\n* CDL: add plot method (#415)\r\n* Chesapeake: add plot method (#417)\r\n* EuroSat: new bands parameter (#396, #397)\r\n* LandCover.ai: update download URL (#559, #579)\r\n* Landsat: add support for all Level-1 and Level-2 products (#492, #504)\r\n* Landsat: add plot method (#661)\r\n* NAIP: add plot method (#407)\r\n* Seasonal Contrast: ensure that all images are square (#658)\r\n* Sentinel: add plot method (#416, #493)\r\n* SEN12MS: avoid casting float to int (#500, #502)\r\n* So2Sat: new bands parameter (#394)\r\n\r\nBase classes and utilities:\r\n\r\n* VisionDataset and VisionClassificationDataset have been renamed to NonGeoDataset and NonGeoClassificationDataset (#627)\r\n* RasterDataset no longer has a plot method, subclasses have their own plot methods (#476)\r\n* Plot method of RasterDataset subclasses now take sample dicts, not image tensors (#476)\r\n* BoundingBox has new area and volume attributes (#375)\r\n* Don't subtract microsecond from mint (#506)\r\n\r\n## Models\r\n\r\nChanges to existing models:\r\n\r\n* Removed FCEF model, use segmentation_models_pytorch.Unet instead (#345)\r\n* FCSiamConf and FCSiamDiff now inherit from segmentation_models_pytorch.Unet, allowing for easily loading pretrained weights (#345)\r\n\r\n## Samplers\r\n\r\nNew samplers:\r\n\r\n* PreChippedGeoSampler (#479)\r\n\r\nChanges to existing samplers:\r\n\r\n* Allow for point sampling (#477)\r\n* Allow for sampling of entire scene (#477)\r\n* RandomGeoSampler no longer suffers from area bias (#408, #477)\r\n* Sample size now defaults to pixel units, use `units=Units.CRS` for old behavior (#294)\r\n\r\n## Trainers\r\n\r\nChanges to existing trainers:\r\n\r\n* BYOLTask: fix in_channels handling (#522)\r\n* BYOLTask: fix loading of encoder weights (#524)\r\n* SemanticSegmentationTask: ignore_zeros renamed to ignore_index (#444, #644)\r\n\r\n## Transforms\r\n\r\nNew spectral indices:\r\n\r\n* BNDVI (#386)\r\n* GBNDVI (#450)\r\n* GNDVI (#371)\r\n* GRNDVI (#450)\r\n* NDRE (#386)\r\n* RBNDVI (#450)\r\n* SWI (#371)\r\n\r\nNew base classes:\r\n\r\n* AppendTriBandNormalizedDifferenceIndex (#414)\r\n\r\n## Documentation\r\n\r\n* Improved README (#589, #626)\r\n* Add dataset tables (#435, #478, #649)\r\n* Shorter dataset\u002Fdatamodule\u002Fmodel names (#569, #571)\r\n* Spectral indices now display mathematical equations (#400)\r\n* Fix NAIP download in tutorials (#526, #531)\r\n* Add issue templates on GitHub (#584, #590)\r\n* Clarify Windows conda installation (#581)\r\n* Public type hints (#508)\r\n\r\n## Tests\r\n\r","2022-07-11T05:55:22",{"id":228,"version":229,"summary_zh":230,"released_at":231},145477,"v0.2.1","# TorchGeo 0.2.1 Release Notes\r\n\r\nThis is a bugfix release. There are no new features or API changes with respect to the 0.2.0 release.\r\n\r\n## Dependencies\r\n\r\n* Fix minimum supported kornia version (#350)\r\n* Support older pytorch-lightning (#347, #351)\r\n* Add support for torchmetrics 0.8+ (#361, #382)\r\n\r\n## DataModules\r\n\r\n* RESISC45: fix normalization statistics (#440)\r\n\r\n## Datasets\r\n\r\nFixes for dataset base classes:\r\n\r\n* GeoDataset: fix `len()` of empty dataset (#374)\r\n* RasterDataset: add support for float dtype (#379, #384)\r\n* RasterDataset: don't override custom cmap (#421, #422)\r\n* VectorDataset: fix issue with empty query (#399, #454, #467)\r\n\r\nFixes for specific datasets:\r\n\r\n* CDL: update checksums due to new file formats (#423, #424, #428)\r\n* Chesapeake: support extraction of deflate64-compressed zip files (#59, #282)\r\n* Chesapeake: allow multiple datasets to share same root (#419, #420)\r\n* ChesapeakeCVPR: update prior extension data to version 1.1 (#359)\r\n* IDTReeS: fix citation (#389)\r\n* LandCover.ai: support already-downloaded dataset (#383)\r\n* Sentinel-2: fix regex to support band 8A (#393)\r\n* SpaceNet 2: update checksum due to data format consistency fix (#469)\r\n\r\n## Samplers\r\n\r\n* Avoid bounding boxes smaller than patch size (#319, #376)\r\n\r\n## Tutorials\r\n\r\n* Fix variable name in trainer notebook (#434)\r\n\r\n## Tests\r\n\r\n* Fix integration tests on macOS\u002FWindows (#349, #468)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors:\r\n\r\n* @adamjstewart\r\n* @ashnair1\r\n* @calebrob6 \r\n* @ethanwhite \r\n* @nilsleh\r\n* @tritolol\r\n* @weiji14 ","2022-03-20T16:41:30",{"id":233,"version":234,"summary_zh":235,"released_at":236},145478,"v0.2.0","# TorchGeo 0.2.0 Release Notes\r\n\r\nThis release contains a number of new features. The biggest change in this release is a significant overhaul of `GeoDataset`. It is now possible to intelligently compose multiple `GeoDatasets` in a variety of ways. For example, users can now:\r\n\r\n* Combine datasets for multiple image sources and treat them as equivalent (e.g. Landsat 7 and Landsat 8)\r\n* Combine datasets for disparate geospatial locations (e.g. Chesapeake NY and PA)\r\n\r\nThese combinations require that all queries are present in *at least one* dataset, and can be combined using a `UnionDataset`:\r\n\r\n```python\r\nlandsat7 = Landsat7(root=\"...\")\r\nlandsat8 = Landsat8(root=\"...\", bands=[\"B2\", \"B3\", \"B4\", \"B5\", \"B6\", \"B7\", \"B8\", \"B9\"])\r\nlandsat = landsat7 | landsat8\r\n```\r\n\r\nUsers can now also:\r\n\r\n* Combine image and target labels and sample from both simultaneously (e.g. Landsat and CDL)\r\n* Combine datasets for multiple image sources for multimodal learning or data fusion (e.g. Landsat and Sentinel)\r\n\r\nThese combinations require that all queries are present in *both* datasets, and can be combined using an `IntersectionDataset`:\r\n\r\n```python\r\ncdl = CDL(root=\"...\", download=True, checksum=True)\r\ndataset = landsat & cdl\r\n```\r\n\r\nIf files are in different coordinate systems or at different spatial resolutions, TorchGeo now automatically warps all tiles to a common CRS and resolution. As before, all `GeoDatasets` are compatible with PyTorch `DataLoaders` using `GeoSamplers`.\r\n\r\n## Backwards-incompatible changes\r\n\r\nTorchGeo is still in the alpha development phase and our API continues to change as needed. If you are using any of the following features, be sure to update your code to use the new API:\r\n\r\n* `ZipDataset` has been renamed to `IntersectionDataset` (#144)\r\n* `GeoDataset` no longer supports addition (`+`), use intersection (`&`) or union (`|`) instead (#144)\r\n* `BoundingBox` is no longer a subclass of `tuple`, but can still be cast to a tuple using `tuple(bbox)` (#144)\r\n* `collate_dict` has been renamed to `stack_samples` (#144)\r\n* Dataset-specific trainers have been removed, use task-specific trainers instead (#205, #286)\r\n* All `DataModules` have been moved from `torchgeo.datasets` to `torchgeo.datamodules` (#321)\r\n* Functional index transforms have been removed (#285)\r\n\r\n## Datamodules\r\n\r\nThis release adds a new `torchgeo.datamodules` namespace. All `DataModules` previously defined in `torchgeo.datasets` now live in `torchgeo.datamodules`.\r\n\r\nIn addition, the following datasets have new datamodules:\r\n\r\n* Chesapeake CVPR prior labels (#202)\r\n* ETCI 2021 (#234)\r\n* EuroSAT (#246)\r\n* FAIR1M (#232)\r\n* LoveDA (#270)\r\n* NASA Marine Debris (#269)\r\n* OSCD (#255, #257, #341)\r\n* Potsdam 2D (#247)\r\n* Vaihingen 2D (#248)\r\n* xView2 (#236)\r\n\r\nMany datamodules now have a `plot` method that wraps around the respective dataset `plot` method (#286)\r\n\r\n## Datasets\r\n\r\nThis release includes many improvements for geospatial datasets:\r\n\r\n* New `IntersectionDataset` and `UnionDataset` classes (#144)\r\n* `GeoDataset` and `BoundingBox` now support set arithmetic (#144)\r\n* New collation functions for stacking, concatenating, merging, and unbinding samples (#144, #286, #328)\r\n* Chesapeake CVPR dataset now supports optional prior labels (#202)\r\n\r\nThis release also includes the following new benchmark datasets:\r\n\r\n* FAIR1M (#232)\r\n* IDTReeS (#201)\r\n* LoveDA (#270)\r\n* NASA Marine Debris (#269)\r\n* OSCD (#233, #254, #258)\r\n* Potsdam 2D (#247)\r\n* SpaceNet 5 (#263)\r\n* SpaceNet 7 (#241)\r\n* Vaihingen 2D (#248)\r\n* xView2 (#236)\r\n\r\nMost existing datasets now have a `plot` method:\r\n\r\n* ADVANCE (#264)\r\n* Benin Small Holder Cashews (#264)\r\n* BigEarthNet (#264)\r\n* COWC (#300)\r\n* CV4A Kenya Crop Type (#312)\r\n* Cyclone (#298)\r\n* ETCI 2021 (#234)\r\n* EuroSAT (#251)\r\n* GID15 (#288)\r\n* LandCover.ai (#251)\r\n* LEVIR-CD+ (#335)\r\n* PatternNet (#314)\r\n* RESISC45 (#251)\r\n* SeCo (#251)\r\n* SEN12MS (#320, #338)\r\n* So2Sat (#251)\r\n* SpaceNet (#252, #311)\r\n* UCMerced (#251)\r\n* Zueri Crop (#334)\r\n\r\n## Losses\r\n\r\nThis release adds a new `torchgeo.losses` namespace for loss functions common in or exclusive to geospatial data.\r\n\r\n* QR and RQ losses (#202, #333)\r\n\r\n## Models\r\n\r\n* RCF now has a seed parameter (#193, #250)\r\n\r\n## Samplers\r\n\r\n* Samplers now respect ROI (#144, #149, #260)\r\n\r\n## Trainers\r\n\r\n* Trainers now plot samples during validation for supported datamodules (#286)\r\n* Dataset-specific trainers have been removed (#286)\r\n\r\n## Transforms\r\n\r\n* New `AppendNormalizedDifferenceIndex` transform (#285)\r\n* New normalized burn ratio transform (#284)\r\n\r\n## Documentation\r\n\r\n* New tutorial for writing custom `RasterDatasets` (#283)\r\n* Tutorials are now properly versioned (#274, #309, #310)\r\n* Tutorials now have an \"Open in Planetary Computer\" button (#316)\r\n* Minor updates to Indices tutorial (#339, #348)\r\n\r\n## Tests\r\n\r\n* Datamodules are now properly tested with real trainers (#329)\r\n* Tests no longer require internet access (#194, #265)\r\n* Tests now use significantly less memory (","2022-01-02T03:58:13",{"id":238,"version":239,"summary_zh":240,"released_at":241},145479,"v0.1.1","# TorchGeo 0.1.1 Release Notes\r\n\r\nThis is a bugfix release. There are no new features or API changes with respect to the 0.1.0 release.\r\n\r\n## Bug Fixes\r\n\r\n* Avoid circular import errors (#276)\r\n* Rework list of required dependencies (#249, #287)\r\n* Relax constraints on Conda environment (#293, #295)\r\n* Fix parallel data loading on macOS\u002FWindows (#184, #304)\r\n* Fix bug in shuffling of ETCI 2021 dataset (#231)\r\n* Support already downloaded files in Chesapeake datasets (#281)\r\n* Tutorials now open the same file in Google Colab (#274, #309)\r\n* Add pre-trained ResNet models to the docs (#256)\r\n* Clean up tutorial imports (#267, #308)\r\n* Various improvements to CI stability (#261, #268, #292, #299, #306)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors:\r\n\r\n* @adamjstewart \r\n* @amrzv \r\n* @ashnair1 \r\n* @calebrob6 \r\n* @isaaccorley ","2021-12-20T01:40:07",{"id":243,"version":244,"summary_zh":245,"released_at":246},145480,"v0.1.0","# TorchGeo 0.1.0 Release Notes\r\n\r\nThis is the first official release of TorchGeo! This release contains the following features:\r\n\r\n## Datasets\r\n\r\nAdded the following new benchmark datasets:\r\n\r\n* ADVANCE (AuDio Visual Aerial sceNe reCognition datasEt) (#133)\r\n* Smallholder Cashew Plantations in Benin (#28)\r\n* BigEarthNet (#197, #211)\r\n* Cars Overhead With Context (COWC) (#25, #217)\r\n* CV4A Kenya Crop Type Competition (#22)\r\n* ETCI2021 Flood Detection (#119)\r\n* EuroSAT (#167)\r\n* GID-15 (Gaofen Image Dataset) (#123)\r\n* LandCover.ai (Land Cover from Aerial Imagery) (#19, #48)\r\n* LEVIR-CD+ (LEVIR Change Detection +) (#106)\r\n* PatternNet (#111)\r\n* RESISC45 (Remote Sensing Image Scene Classification) (#126, #179)\r\n* Seasonal Contrast (#223)\r\n* SEN12MS (#26, #44)\r\n* So2Sat (#34, #145)\r\n* SpaceNet (#129, #155, #185)\r\n* Tropical Cyclone Wind Estimation Competition (8305aa7c5ed0e3d6d823c7cd2d552b137969b35b)\r\n* NWPU VHR-10 (6df38094df157aacc4a3f1e9b388b927dcd3515d)\r\n* UC Merced (#169, #208)\r\n* ZueriCrop (#147)\r\n\r\nAdded the following new generic datasets:\r\n\r\n* Canadian Building Footprints (#69)\r\n* Chesapeake Bay High-Resolution Land Cover Project (#18, #100, #142)\r\n* Cropland Data Layer (CDL) (#37)\r\n* Landsat (#37)\r\n* National Agriculture Imagery Program (NAIP) (#57, #98)\r\n* Sentinel (#37)\r\n\r\n## Models\r\n\r\nAdded the following new models:\r\n\r\n* Change Star (#157)\r\n* Foreground-aware Relation Network (FarSeg) (#150)\r\n* Fully-convolutional Network (FCN) (#54)\r\n* Fully Convolutional Siamese Networks for Change Detection (#108)\r\n* Random-convolutional feature (RCF) extractor (#176)\r\n\r\n## Samplers\r\n\r\nAdded the following new samplers:\r\n\r\n* Random Geo Sampler (#37)\r\n* Grid Geo Sampler (#37)\r\n* Random Batch Geo Sampler (#37)\r\n\r\n## Trainers\r\n\r\nAdded the following new trainers:\r\n\r\n* BYOL (#145)\r\n* Classification (#207)\r\n* Multi-label Classification (#211)\r\n* Regression (#215)\r\n* Semantic Segmentation (#224)\r\n\r\n## Transforms\r\n\r\nAdded the following new transforms:\r\n\r\n* Indices: NDBI, NDSI, NDVI, NDWI (#127)\r\n\r\n## Docs\r\n\r\nAdded documentation for:\r\n\r\n* Installation (#153)\r\n* Contributing (#141)\r\n* Glossary (f6c91f4ebcfa7363bf421592fc36a0f523b9b5a4)\r\n* API Docs (00d619e9463ca223e29aa98e4658eb397dd74164)\r\n\r\nAdded tutorials for:\r\n\r\n* Getting Started (#93)\r\n* Transforms (#127)\r\n* Indices (#127)\r\n* PyTorch Lightning Trainers (#161)\r\n* Benchmarking (#93)\r\n\r\n## Contributors\r\n\r\nThis release is thanks to the following contributors:\r\n\r\n* @adamjstewart\r\n* @anthonymlortiz \r\n* @ashnair1 \r\n* @calebrob6 \r\n* @isaaccorley \r\n* @Z-Zheng ","2021-11-08T04:47:47"]