[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-hkchengrex--STCN":3,"tool-hkchengrex--STCN":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 真正成长为懂上",151314,2,"2026-04-11T23:32:58",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[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},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"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":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":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":76,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":10,"env_os":90,"env_gpu":91,"env_ram":90,"env_deps":92,"category_tags":103,"github_topics":105,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":155},6804,"hkchengrex\u002FSTCN","STCN","[NeurIPS 2021] Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation","STCN 是一个专为视频对象分割设计的高效开源框架，曾荣获 NeurIPS 2021 论文收录。它主要解决在长视频中精准追踪并分割目标物体的难题，特别是在面对未知类别物体时，依然能保持极高的准确率与运行速度。\n\n不同于传统方法，STCN 创新性地提出了“时空对应网络”架构。其核心技术亮点在于直接构建图像帧之间的关联，而非依赖耗时的“图像 - 掩码”对计算，并结合 L2 相似度度量替代点积运算。这一改进大幅降低了显存占用，显著提升了推理效率，使其在普通显卡上即可实现每秒 20 至 30 帧的实时处理速度，同时在 YouTubeVOS 等权威基准测试中屡获佳绩。\n\nSTCN 非常适合计算机视觉领域的研究人员、算法工程师以及需要处理视频分析任务的开发者使用。它不仅性能强大，而且架构简洁，仅需两块 11GB 显存的 GPU 即可完成训练，无需顶级硬件支持。项目提供了完整的预训练模型、推理代码及交互式演示界面，方便用户快速上手验证或基于此进行二次开发，是探索高效视频分割技术的理想选择。","# STCN\n\n## Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation\n\n[Ho Kei Cheng](https:\u002F\u002Fhkchengrex.github.io\u002F), Yu-Wing Tai, Chi-Keung Tang\n\nNeurIPS 2021\n\n[[arXiv]](https:\u002F\u002Farxiv.org\u002Fabs\u002F2106.05210) [[PDF]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2106.05210) [[Project Page]](https:\u002F\u002Fhkchengrex.github.io\u002FSTCN\u002F) [[Papers with Code]](https:\u002F\u002Fpaperswithcode.com\u002Ftask\u002Fsemi-supervised-video-object-segmentation)\n\n## Check out our new work [Cutie](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FCutie)!\n\n![bmx](https:\u002F\u002Fimgur.com\u002FSIFq5c1.gif) ![pigs](https:\u002F\u002Fimgur.com\u002FnHvWuzi.gif)\n\n*News:* In the [YouTubeVOS 2021 challenge](https:\u002F\u002Fyoutube-vos.org\u002Fchallenge\u002F2021\u002Fleaderboard\u002F), STCN achieved 1st place accuracy in novel (unknown) classes and 2nd place in overall accuracy. Our solution is also fast and light.\n\nWe present Space-Time Correspondence Networks (STCN) as the new, effective, and efficient framework to model space-time correspondences in the context of video object segmentation.\nSTCN achieves SOTA results on multiple benchmarks while running fast at 20+ FPS without bells and whistles. Its speed is even higher with mixed precision.\nDespite its effectiveness, the network itself is very simple with lots of room for improvement. See the paper for technical details.\n\n**UPDATE (15-July-2021)**\n\n1. CBAM block: We tried without CBAM block and I would say that we don't really need it. For s03 model, we get -1.2 in DAVIS and +0.1 in YouTubeVOS. For s012 model, we get +0.1 in DAVIS and +0.1 in YouTubeVOS. You are welcome to drop this block (see `no_cbam` branch). Overall, the much larger YouTubeVOS seems to be a better evaluation benchmark for consistency.\n\n**UPDATE (22-Aug-2021)**\n\n2. Reproducibility: We have updated the package requirements below. With that environment, we obtained DAVIS J&F in the range of [85.1, 85.5] across multiple runs on two different machines.\n\n**UPDATE (27-Apr-2022)**\n\nMulti-scale testing code (as in the paper) has been added [here](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Ftree\u002Fms\u002Fms).\n\n\n## What do we have here?\n\n1. [A gentle introduction](#a-gentle-introduction)\n\n2. [Quantitative results and precomputed outputs](#results)\n    1. DAVIS 2016\n    2. DAVIS 2017 validation\u002Ftest-dev\n    3. YouTubeVOS 2018\u002F2019\n\n3. [Try our model on your own data (Interactive GUI available)](#try-your-own-data)\n\n4. Steps to reproduce\n   1. [Pretrained models](#pretrained-models)\n   2. [Inference](#inference)\n   3. [Training](#training)\n\n5. [If you want to look closer](#looking-closer)\n\n6. [Citation](#citation)\n\n## A Gentle Introduction\n\n![framework](https:\u002F\u002Fimgur.com\u002FTY1ScRy.jpg)\n\nThere are two main contributions: STCN framework (above figure), and L2 similarity. We build affinity between images instead of between (image, mask) pairs -- this leads to a significantly speed up, memory saving (because we compute one, instead of multiple affinity matrices), and robustness. We further use L2 similarity to replace dot product, which improves the memory bank utilization by a great deal.\n\n### Perks\n\n- Simple, runs fast (30+ FPS with mixed precision; 20+ without)\n- High performance\n- Still lots of room to improve upon (e.g. locality, memory space compression)\n- Easy to train: just two 11GB GPUs, no V100s needed\n\n## Requirements\n\nWe used these packages\u002Fversions in the development of this project. \n\n- PyTorch `1.8.1`\n- torchvision `0.9.1`\n- OpenCV `4.2.0`\n- [Pillow-SIMD](https:\u002F\u002Fgithub.com\u002Fuploadcare\u002Fpillow-simd) `7.0.0.post3`\n- progressbar2\n- [thinspline](https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline) for training (`pip install git+https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline`)\n- gitpython for training\n- gdown for downloading pretrained models\n- [Other packages in my environment](docs\u002Fpackages.txt), for reference only.\n\nRefer to the official [PyTorch guide](\u003Chttps:\u002F\u002Fpytorch.org\u002F>) for installing PyTorch\u002Ftorchvision, and the [pillow-simd](https:\u002F\u002Fgithub.com\u002Fuploadcare\u002Fpillow-simd) guide to install Pillow-SIMD. The rest can be installed by:\n\n`pip install progressbar2 opencv-python gitpython gdown git+https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline`\n\n## Results\n\n### Notations\n\n- FPS is amortized, computed as total processing time \u002F total number of frames irrespective of the number of objects, aka multi-object FPS, and measured on an RTX 2080 Ti with IO time excluded.\n- We also provide inference speed when Automatic Mixed Precision (AMP) is used -- the performance is almost identical. Speed in the paper are measured without AMP.\n- All evaluations are done in the 480p resolution. FPS for test-dev is measured on the validation set under the same memory setting (every third frame as memory) for consistency.\n\n**[[Precomputed outputs - Google Drive]](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1V4wslwiGaFHwq09k019tXU1HpG-kODnZ?usp=sharing)**\n\n**[[Precomputed outputs - OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:f:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEtzYCTCKG1FBoeocJ7Q_tUUB3jivfQE_2DnrybPNC6dTRA?e=hD7IKi)**\n\n**s012 denotes models with BL pretraining while s03 denotes those without** (used to be called s02 in MiVOS).\n\n### Numbers (s012)\n\n| Dataset | Split |  J&F | J | F | FPS | FPS (AMP)\n| --- | --- | :--:|:--:|:---:|:---:|:---:|\n| DAVIS 2016 | validation | 91.7 | 90.4 | 93.0 | 26.9 | 40.8 |\n| DAVIS 2017 | validation | 85.3 | 82.0 | 88.6 | 20.2 | 34.1 |\n| DAVIS 2017 | test-dev | 79.9 | 76.3 | 83.5 | 14.6 | 22.7 |\n\n| Dataset | Split | Overall Score | J-Seen | F-Seen | J-Unseen | F-Unseen\n| --- | --- | :--:|:--:|:---:|:---:|:---:|\n| YouTubeVOS 18 | validation | 84.3 | 83.2 | 87.9 | 79.0 | 87.2 |\n| YouTubeVOS 19 | validation | 84.2 | 82.6 | 87.0 | 79.4 | 87.7 |\n\n| Dataset | AUC-J&F | J&F @ 60s\n| --- |:---:| :--:|\n| DAVIS Interactive | 88.4 | 88.8 |\n\nFor DAVIS interactive, we changed the propagation module of [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS) from STM to STCN. See [this link](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002Ftree\u002FMiVOS-STCN) for details.\n\n## Try on your own data (Interactive GUI available)\n\nIf you (somehow) have the first-frame segmentation (or more generally, segmentation of each object when they first appear), you can use `eval_generic.py`. Check the top of that file for instructions.\n\nIf you just want to play with it interactively, I highly recommend [our extension to MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002Ftree\u002FMiVOS-STCN) :yellow_heart: -- it comes with an interactive GUI, and is highly efficient\u002Feffective.\n\n## Reproducing the results\n\n### Pretrained models\n\nWe use the same model for YouTubeVOS and DAVIS. You can download them yourself and put them in `.\u002Fsaves\u002F`, or use `download_model.py`.\n\ns012 model (better): [[Google Drive]](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mRrE0uCI2ktdWlUgapJI_KmgeIiF2eOm\u002Fview?usp=sharing) [[OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:u:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEav35v3GZIZFiq6dv9BM8n0BHtR1hD7QU9tcxH7hylG3dA?e=NXJpTu)\n\ns03 model: [[Google Drive]](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1JllXPJZola0G-g1aUQfXe9nLMBioj-aH\u002Fview?usp=sharing) [[OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:u:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEdhurrdqNTFIoK43NsboxOgBPTsMlJBoKOirflGUn-JqBA?e=8NATDz)\n\ns0 pretrained model: [[GitHub]](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Freleases\u002Ftag\u002F1.0)\n\ns01 pretrained model: [[GitHub]](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Freleases\u002Ftag\u002F1.0)\n\n### Inference\n\n- `eval_davis_2016.py` for DAVIS 2016 validation set\n- `eval_davis.py` for DAVIS 2017 validation and test-dev set (controlled by `--split`)\n- `eval_youtube.py` for YouTubeVOS 2018\u002F19 validation set (controlled by `--yv_path`)\n\nThe arguments tooltip should give you a rough idea of how to use them. For example, if you have downloaded the datasets and pretrained models using our scripts, you only need to specify the output path: `python eval_davis.py --output [somewhere]` for DAVIS 2017 validation set evaluation. For YouTubeVOS evaluation, point `--yv_path` to the version of your choosing.\n\nMulti-scale testing code (as in the paper) has been added [here](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Ftree\u002Fms\u002Fms).\n\n### Training\n\n#### Data preparation\n\nI recommend either softlinking (`ln -s`) existing data or use the provided `download_datasets.py` to structure the datasets as our format. `download_datasets.py` might download more than what you need -- just comment out things that you don't like. The script does not download BL30K because it is huge (>600GB) and we don't want to crash your harddisks. See below.\n\n```bash\n├── STCN\n├── BL30K\n├── DAVIS\n│   ├── 2016\n│   │   ├── Annotations\n│   │   └── ...\n│   └── 2017\n│       ├── test-dev\n│       │   ├── Annotations\n│       │   └── ...\n│       └── trainval\n│           ├── Annotations\n│           └── ...\n├── static\n│   ├── BIG_small\n│   └── ...\n├── YouTube\n│   ├── all_frames\n│   │   └── valid_all_frames\n│   ├── train\n│   ├── train_480p\n│   └── valid\n└── YouTube2018\n    ├── all_frames\n    │   └── valid_all_frames\n    └── valid\n```\n\n#### BL30K\n\nBL30K is a synthetic dataset proposed in [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002F#bl30k).\n\nYou can either use the automatic script `download_bl30k.py` or download it manually from [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002F#bl30k). Note that each segment is about 115GB in size -- 700GB in total. You are going to need ~1TB of free disk space to run the script (including extraction buffer).\n**Google might block the Google Drive link. You can 1) make a shortcut of the folder to your own Google Drive, and 2) use `rclone` to copy from your own Google Drive (would not count towards your storage limit).**\n\n#### Training commands\n\n`CUDA_VISIBLE_DEVICES=[a,b] OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port [cccc] --nproc_per_node=2 train.py --id [defg] --stage [h]`\n\nWe implemented training with Distributed Data Parallel (DDP) with two 11GB GPUs. Replace `a, b` with the GPU ids, `cccc` with an unused port number,  `defg` with a unique experiment identifier, and `h` with the training stage (0\u002F1\u002F2\u002F3).\n\nThe model is trained progressively with different stages (0: static images; 1: BL30K; 2: 300K main training; 3: 150K main training). After each stage finishes, we start the next stage by loading the latest trained weight.\n\n(Models trained on stage 0 only cannot be used directly. See `model\u002Fmodel.py: load_network` for the required mapping that we do.)\n\nThe `.pth` with `_checkpoint` as suffix is used to resume interrupted training (with `--load_model`) which is usually not needed. Typically you only need `--load_network` and load the last network weights (without `checkpoint` in its name).\n\n\u003Cdetails> \n\u003Csummary>\n\nSo, to train a s012 model, we launch three training steps sequentially as follows:\n\n\u003C\u002Fsummary>\n\nPre-training on static images: `CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s0 --stage 0`\n\nPre-training on the BL30K dataset: `CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s01 --load_network [path_to_trained_s0.pth]  --stage 1`\n\nMain training: `CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s012 --load_network [path_to_trained_s01.pth]  --stage 2`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails> \n\u003Csummary>\n\nAnd to train a s03 model, we launch two training steps sequentially as follows:\n\n\u003C\u002Fsummary>\n\nPre-training on static images: `CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s0 --stage 0`\n\nMain training: `CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s03 --load_network [path_to_trained_s0.pth]  --stage 3`\n\n\u003C\u002Fdetails>\n\n## Looking closer\n\n- To add your datasets, or do something with data augmentations: `dataset\u002Fstatic_dataset.py`, `dataset\u002Fvos_dataset.py`\n- To work on the similarity function, or memory readout process: `model\u002Fnetwork.py: MemoryReader`, `inference_memory_bank.py`\n- To work on the network structure: `model\u002Fnetwork.py`, `model\u002Fmodules.py`, `model\u002Feval_network.py`\n- To work on the propagation process: `model\u002Fmodel.py`, `eval_*.py`, `inference_*.py`\n\n## Citation\n\nPlease cite our paper (MiVOS if you use top-k) if you find this repo useful!\n\n```bibtex\n@inproceedings{cheng2021stcn,\n  title={Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation},\n  author={Cheng, Ho Kei and Tai, Yu-Wing and Tang, Chi-Keung},\n  booktitle={NeurIPS},\n  year={2021}\n}\n\n@inproceedings{cheng2021mivos,\n  title={Modular Interactive Video Object Segmentation: Interaction-to-Mask, Propagation and Difference-Aware Fusion},\n  author={Cheng, Ho Kei and Tai, Yu-Wing and Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2021}\n}\n```\n\nAnd if you want to cite the datasets:\n\n\u003Cdetails> \n\u003Csummary>\n\nbibtex\n\n\u003C\u002Fsummary>\n\n```bibtex\n@inproceedings{shi2015hierarchicalECSSD,\n  title={Hierarchical image saliency detection on extended CSSD},\n  author={Shi, Jianping and Yan, Qiong and Xu, Li and Jia, Jiaya},\n  booktitle={TPAMI},\n  year={2015},\n}\n\n@inproceedings{wang2017DUTS,\n  title={Learning to Detect Salient Objects with Image-level Supervision},\n  author={Wang, Lijun and Lu, Huchuan and Wang, Yifan and Feng, Mengyang \n  and Wang, Dong, and Yin, Baocai and Ruan, Xiang}, \n  booktitle={CVPR},\n  year={2017}\n}\n\n@inproceedings{FSS1000,\n  title = {FSS-1000: A 1000-Class Dataset for Few-Shot Segmentation},\n  author = {Li, Xiang and Wei, Tianhan and Chen, Yau Pun and Tai, Yu-Wing and Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2020}\n}\n\n@inproceedings{zeng2019towardsHRSOD,\n  title = {Towards High-Resolution Salient Object Detection},\n  author = {Zeng, Yi and Zhang, Pingping and Zhang, Jianming and Lin, Zhe and Lu, Huchuan},\n  booktitle = {ICCV},\n  year = {2019}\n}\n\n@inproceedings{cheng2020cascadepsp,\n  title={{CascadePSP}: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement},\n  author={Cheng, Ho Kei and Chung, Jihoon and Tai, Yu-Wing and Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2020}\n}\n\n@inproceedings{xu2018youtubeVOS,\n  title={Youtube-vos: A large-scale video object segmentation benchmark},\n  author={Xu, Ning and Yang, Linjie and Fan, Yuchen and Yue, Dingcheng and Liang, Yuchen and Yang, Jianchao and Huang, Thomas},\n  booktitle = {ECCV},\n  year={2018}\n}\n\n@inproceedings{perazzi2016benchmark,\n  title={A benchmark dataset and evaluation methodology for video object segmentation},\n  author={Perazzi, Federico and Pont-Tuset, Jordi and McWilliams, Brian and Van Gool, Luc and Gross, Markus and Sorkine-Hornung, Alexander},\n  booktitle={CVPR},\n  year={2016}\n}\n\n@inproceedings{denninger2019blenderproc,\n  title={BlenderProc},\n  author={Denninger, Maximilian and Sundermeyer, Martin and Winkelbauer, Dominik and Zidan, Youssef and Olefir, Dmitry and Elbadrawy, Mohamad and Lodhi, Ahsan and Katam, Harinandan},\n  booktitle={arXiv:1911.01911},\n  year={2019}\n}\n\n@inproceedings{shapenet2015,\n  title       = {{ShapeNet: An Information-Rich 3D Model Repository}},\n  author      = {Chang, Angel Xuan and Funkhouser, Thomas and Guibas, Leonidas and Hanrahan, Pat and Huang, Qixing and Li, Zimo and Savarese, Silvio and Savva, Manolis and Song, Shuran and Su, Hao and Xiao, Jianxiong and Yi, Li and Yu, Fisher},\n  booktitle   = {arXiv:1512.03012},\n  year        = {2015}\n}\n```\n\n\u003C\u002Fdetails>\n\nContact: \u003Chkchengrex@gmail.com>\n","# STCN\n\n## 通过改进的内存覆盖重新思考时空网络，以实现高效的视频目标分割\n\n[Ho Kei Cheng](https:\u002F\u002Fhkchengrex.github.io\u002F)、Yu-Wing Tai、Chi-Keung Tang\n\nNeurIPS 2021\n\n[[arXiv]](https:\u002F\u002Farxiv.org\u002Fabs\u002F2106.05210) [[PDF]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2106.05210) [[项目页面]](https:\u002F\u002Fhkchengrex.github.io\u002FSTCN\u002F) [[Papers with Code]](https:\u002F\u002Fpaperswithcode.com\u002Ftask\u002Fsemi-supervised-video-object-segmentation)\n\n## 欢迎查看我们的新作 [Cutie](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FCutie)！\n\n![bmx](https:\u002F\u002Fimgur.com\u002FSIFq5c1.gif) ![pigs](https:\u002F\u002Fimgur.com\u002FnHvWuzi.gif)\n\n*新闻:* 在 [YouTubeVOS 2021 挑战赛](https:\u002F\u002Fyoutube-vos.org\u002Fchallenge\u002F2021\u002Fleaderboard\u002F) 中，STCN 在新颖（未知）类别中取得了准确率第一，在总体准确率中取得了第二名。我们的解决方案还具有速度快、轻量级的特点。\n\n我们提出了时空对应网络（STCN），作为一种新的、高效且有效的框架，用于在视频目标分割的背景下建模时空对应关系。\nSTCN 在多个基准测试中取得了 SOTA 结果，同时在不使用额外花哨技术的情况下，仍能以 20+ FPS 的速度运行。使用混合精度时，其速度甚至更高。\n尽管效果显著，但该网络本身非常简单，仍有很大的改进空间。具体技术细节请参阅论文。\n\n**更新（2021年7月15日）**\n\n1. CBAM 块：我们尝试过不使用 CBAM 块，我认为我们确实不需要它。对于 s03 模型，我们在 DAVIS 上降低了 1.2 分，在 YouTubeVOS 上提高了 0.1 分。对于 s012 模型，我们在 DAVIS 和 YouTubeVOS 上都提高了 0.1 分。您可以选择移除此块（请参阅 `no_cbam` 分支）。总的来说，规模更大的 YouTubeVOS 似乎是一个更合适的评估基准，能够更好地衡量一致性。\n\n**更新（2021年8月22日）**\n\n2. 可重复性：我们已更新了下方的软件包要求。在该环境下，我们在两台不同的机器上多次运行后，得到的 DAVIS J&F 分数范围为 [85.1, 85.5]。\n\n**更新（2022年4月27日）**\n\n多尺度测试代码（如论文中所述）已添加至 [这里](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Ftree\u002Fms\u002Fms)。\n\n## 我们在这里提供了什么？\n\n1. [简要介绍](#a-gentle-introduction)\n\n2. [定量结果和预计算输出](#results)\n    1. DAVIS 2016\n    2. DAVIS 2017 验证集\u002F测试集\n    3. YouTubeVOS 2018\u002F2019\n\n3. [在您自己的数据上试用我们的模型（提供交互式 GUI）](#try-your-own-data)\n\n4. 复现步骤\n   1. [预训练模型](#pretrained-models)\n   2. [推理](#inference)\n   3. [训练](#training)\n\n5. [如果您想进一步了解](#looking-closer)\n\n6. [引用](#citation)\n\n## 简要介绍\n\n![framework](https:\u002F\u002Fimgur.com\u002FTY1ScRy.jpg)\n\n本工作主要有两个贡献：STCN 框架（上图）和 L2 相似度。我们是在图像之间建立亲和力，而不是在（图像，掩码）对之间——这大大提高了速度、节省了内存（因为我们只计算一个亲和力矩阵，而不是多个），并且增强了鲁棒性。此外，我们还用 L2 相似度替代点积，从而极大地提高了记忆库的利用率。\n\n### 优点\n\n- 简单，运行速度快（使用混合精度时可达 30+ FPS；不使用时也有 20+ FPS）\n- 性能优异\n- 仍有很大的改进空间（例如局部性、内存空间压缩）\n- 易于训练：只需两块 11GB 的 GPU，无需 V100\n\n## 要求\n\n我们在开发该项目时使用了以下软件包及版本：\n\n- PyTorch `1.8.1`\n- torchvision `0.9.1`\n- OpenCV `4.2.0`\n- [Pillow-SIMD](https:\u002F\u002Fgithub.com\u002Fuploadcare\u002Fpillow-simd) `7.0.0.post3`\n- progressbar2\n- [thinspline](https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline) 用于训练（`pip install git+https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline`）\n- gitpython 用于训练\n- gdown 用于下载预训练模型\n- [我环境中的其他软件包](docs\u002Fpackages.txt)，仅供参考。\n\n请参考官方 [PyTorch 指南](\u003Chttps:\u002F\u002Fpytorch.org\u002F>) 安装 PyTorch\u002Ftorchvision，以及 [pillow-simd](https:\u002F\u002Fgithub.com\u002Fuploadcare\u002Fpillow-simd) 指南安装 Pillow-SIMD。其余软件包可通过以下命令安装：\n\n`pip install progressbar2 opencv-python gitpython gdown git+https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline`\n\n## 结果\n\n### 符号说明\n\n- FPS 是平均值，计算方式为总处理时间除以总帧数，与对象数量无关，即多对象 FPS，并在 RTX 2080 Ti 上测量，排除了 IO 时间。\n- 我们还提供了使用自动混合精度（AMP）时的推理速度——性能几乎相同。论文中的速度数据未使用 AMP 测量。\n- 所有评估均在 480p 分辨率下进行。test-dev 的 FPS 是在验证集上以相同的内存设置（每三帧保存一次内存）测量的，以确保一致性。\n\n**[[预计算输出 - Google Drive]](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1V4wslwiGaFHwq09k019tXU1HpG-kODnZ?usp=sharing)**\n\n**[[预计算输出 - OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:f:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEtzYCTCKG1FBoeocJ7Q_tUUB3jivfQE_2DnrybPNC6dTRA?e=hD7IKi)**\n\n**s012 表示带有 BL 预训练的模型，而 s03 表示没有预训练的模型**（之前在 MiVOS 中称为 s02）。\n\n### 数据（s012）\n\n| 数据集 | 划分 | J&F | J | F | FPS | FPS (AMP) |\n| --- | --- | :--:|:--:|:---:|:---:|:---:|\n| DAVIS 2016 | 验证集 | 91.7 | 90.4 | 93.0 | 26.9 | 40.8 |\n| DAVIS 2017 | 验证集 | 85.3 | 82.0 | 88.6 | 20.2 | 34.1 |\n| DAVIS 2017 | test-dev | 79.9 | 76.3 | 83.5 | 14.6 | 22.7 |\n\n| 数据集 | 总分 | J-Seen | F-Seen | J-Unseen | F-Unseen |\n| --- | --- | :--:|:--:|:---:|:---:|:---:|\n| YouTubeVOS 18 | 验证集 | 84.3 | 83.2 | 87.9 | 79.0 | 87.2 |\n| YouTubeVOS 19 | 验证集 | 84.2 | 82.6 | 87.0 | 79.4 | 87.7 |\n\n| 数据集 | AUC-J&F | J&F @ 60s |\n| --- |:---:| :--:|\n| DAVIS Interactive | 88.4 | 88.8 |\n\n对于 DAVIS interactive，我们将 [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS) 的传播模块从 STM 更改为 STCN。详细信息请参阅 [此链接](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002Ftree\u002FMiVOS-STCN)。\n\n## 在您自己的数据上试用（提供交互式 GUI）\n\n如果您（不知何故）拥有第一帧的分割结果（或者更一般地说，每个对象首次出现时的分割结果），可以使用 `eval_generic.py`。请查看该文件顶部的说明。\n\n如果您只是想交互式地体验一下，我强烈推荐 [我们对 MiVOS 的扩展](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002Ftree\u002FMiVOS-STCN) :yellow_heart: ——它配备了交互式 GUI，而且非常高效、有效。\n\n## 复现结果\n\n### 预训练模型\n\n我们对 YouTubeVOS 和 DAVIS 使用相同的模型。你可以自行下载并将它们放入 `.\u002Fsaves\u002F` 目录，或者使用 `download_model.py` 脚本。\n\ns012 模型（效果更好）：[[Google Drive]](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mRrE0uCI2ktdWlUgapJI_KmgeIiF2eOm\u002Fview?usp=sharing) [[OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:u:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEav35v3GZIZFiq6dv9BM8n0BHtR1hD7QU9tcxH7hylG3dA?e=NXJpTu)\n\ns03 模型：[[Google Drive]](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1JllXPJZola0G-g1aUQfXe9nLMBioj-aH\u002Fview?usp=sharing) [[OneDrive]](https:\u002F\u002Fuillinoisedu-my.sharepoint.com\u002F:u:\u002Fg\u002Fpersonal\u002Fhokeikc2_illinois_edu\u002FEdhurrdqNTFIoK43NsboxOgBPTsMlJBoKOirflGUn-JqBA?e=8NATDz)\n\ns0 预训练模型：[[GitHub]](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Freleases\u002Ftag\u002F1.0)\n\ns01 预训练模型：[[GitHub]](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Freleases\u002Ftag\u002F1.0)\n\n### 推理\n\n- `eval_davis_2016.py` 用于 DAVIS 2016 验证集\n- `eval_davis.py` 用于 DAVIS 2017 验证集和 test-dev 集（通过 `--split` 参数控制）\n- `eval_youtube.py` 用于 YouTubeVOS 2018\u002F19 验证集（通过 `--yv_path` 参数控制）\n\n命令行参数的提示信息应该能让你大致了解如何使用它们。例如，如果你已经使用我们的脚本下载了数据集和预训练模型，那么对于 DAVIS 2017 验证集的评估，你只需要指定输出路径即可：`python eval_davis.py --output [somewhere]`。而对于 YouTubeVOS 的评估，则需要将 `--yv_path` 指向你选择的版本。\n\n多尺度测试代码（如论文中所述）已添加到 [这里](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Ftree\u002Fms\u002Fms)。\n\n### 训练\n\n#### 数据准备\n\n我建议要么对现有数据进行软链接（`ln -s`），要么使用提供的 `download_datasets.py` 脚本，按照我们的格式组织数据集。`download_datasets.py` 可能会下载比你需要的更多的内容——只需注释掉你不想要的部分即可。该脚本不会下载 BL30K 数据集，因为它非常庞大（超过 600GB），我们不希望导致你的硬盘崩溃。具体结构如下：\n\n```bash\n├── STCN\n├── BL30K\n├── DAVIS\n│   ├── 2016\n│   │   ├── Annotations\n│   │   └── ...\n│   └── 2017\n│       ├── test-dev\n│       │   ├── Annotations\n│       │   └── ...\n│       └── trainval\n│           ├── Annotations\n│           └── ...\n├── static\n│   ├── BIG_small\n│   └── ...\n├── YouTube\n│   ├── all_frames\n│   │   └── valid_all_frames\n│   ├── train\n│   ├── train_480p\n│   └── valid\n└── YouTube2018\n    ├── all_frames\n    │   └── valid_all_frames\n    └── valid\n```\n\n#### BL30K\n\nBL30K 是在 [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002F#bl30k) 中提出的一个合成数据集。\n\n你可以使用自动脚本 `download_bl30k.py`，也可以手动从 [MiVOS](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002F#bl30k) 下载。请注意，每个片段大约 115GB 大小——总共约 700GB。运行该脚本时，你需要大约 1TB 的可用磁盘空间（包括解压缓冲区）。\n**Google 可能会屏蔽 Google Drive 链接。你可以 1) 将文件夹创建快捷方式到你自己的 Google Drive，然后 2) 使用 `rclone` 从你自己的 Google Drive 复制（这不会计入你的存储限额）。**\n\n#### 训练命令\n\n`CUDA_VISIBLE_DEVICES=[a,b] OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port [cccc] --nproc_per_node=2 train.py --id [defg] --stage [h]`\n\n我们使用分布式数据并行（DDP）在两块 11GB 显存的 GPU 上进行训练。请将 `a, b` 替换为 GPU ID，`cccc` 替换为未使用的端口号，`defg` 替换为唯一的实验标识符，`h` 替换为训练阶段（0\u002F1\u002F2\u002F3）。\n\n模型按不同阶段逐步训练（0：静态图像；1：BL30K；2：30 万张主训练数据；3：15 万张主训练数据）。每个阶段完成后，我们会加载最新训练好的权重来开始下一个阶段。\n\n仅在阶段 0 训练得到的模型不能直接使用。所需映射关系请参见 `model\u002Fmodel.py: load_network`。\n\n以 `_checkpoint` 为后缀的 `.pth` 文件用于恢复中断的训练（通过 `--load_model` 参数），但通常并不需要。一般情况下，你只需要使用 `--load_network` 并加载最后一个网络权重（文件名中不含 `checkpoint`）。\n\n\u003Cdetails> \n\u003Csummary>\n\n因此，要训练一个 s012 模型，我们需要依次启动三个训练步骤：\n\n\u003C\u002Fsummary>\n\n静态图像预训练：`CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s0 --stage 0`\n\nBL30K 数据集预训练：`CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s01 --load_network [path_to_trained_s0.pth]  --stage 1`\n\n主训练：`CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s012 --load_network [path_to_trained_s01.pth]  --stage 2`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails> \n\u003Csummary>\n\n而要训练一个 s03 模型，则需要依次启动两个训练步骤：\n\n\u003C\u002Fsummary>\n\n静态图像预训练：`CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s0 --stage 0`\n\n主训练：`CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=4 python -m torch.distributed.launch --master_port 9842 --nproc_per_node=2 train.py --id retrain_s03 --load_network [path_to_trained_s0.pth]  --stage 3`\n\n\u003C\u002Fdetails>\n\n## 更深入地了解\n\n- 若要添加你的数据集，或进行数据增强操作：`dataset\u002Fstatic_dataset.py`, `dataset\u002Fvos_dataset.py`\n- 若想修改相似度函数或记忆读取过程：`model\u002Fnetwork.py: MemoryReader`, `inference_memory_bank.py`\n- 若想调整网络结构：`model\u002Fnetwork.py`, `model\u002Fmodules.py`, `model\u002Feval_network.py`\n- 若想改进传播过程：`model\u002Fmodel.py`, `eval_*.py`, `inference_*.py`\n\n## 引用\n\n如果您觉得本仓库有用，请引用我们的论文（如果您使用 top-k，请引用 MiVOS）！\n\n```bibtex\n@inproceedings{cheng2021stcn,\n  title={重新思考时空网络：通过改进内存覆盖实现高效的视频目标分割},\n  author={Cheng, Ho Kei 和 Tai, Yu-Wing 和 Tang, Chi-Keung},\n  booktitle={NeurIPS},\n  year={2021}\n}\n\n@inproceedings{cheng2021mivos,\n  title={模块化交互式视频目标分割：从交互到掩码、传播与差异感知融合},\n  author={Cheng, Ho Kei 和 Tai, Yu-Wing 和 Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2021}\n}\n```\n\n如果您还想引用数据集：\n\n\u003Cdetails> \n\u003Csummary>\n\nBibTeX 格式\n\n\u003C\u002Fsummary>\n\n```bibtex\n@inproceedings{shi2015hierarchicalECSSD,\n  title={基于扩展 CSSD 的层次化图像显著性检测},\n  author={Shi, Jianping 和 Yan, Qiong 和 Xu, Li 和 Jia, Jiaya},\n  booktitle={TPAMI},\n  year={2015},\n}\n\n@inproceedings{wang2017DUTS,\n  title={利用图像级监督学习检测显著对象},\n  author={Wang, Lijun 和 Lu, Huchuan 和 Wang, Yifan 和 Feng, Mengyang \n  和 Wang, Dong，以及 Yin, Baocai 和 Ruan, Xiang}, \n  booktitle={CVPR},\n  year={2017}\n}\n\n@inproceedings{FSS1000,\n  title = {FSS-1000：用于少样本分割的1000类数据集},\n  author = {Li, Xiang 和 Wei, Tianhan 和 Chen, Yau Pun 和 Tai, Yu-Wing 和 Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2020}\n}\n\n@inproceedings{zeng2019towardsHRSOD,\n  title = {迈向高分辨率显著目标检测},\n  author = {Zeng, Yi 和 Zhang, Pingping 和 Zhang, Jianming 和 Lin, Zhe 和 Lu, Huchuan},\n  booktitle = {ICCV},\n  year = {2019}\n}\n\n@inproceedings{cheng2020cascadepsp,\n  title={{CascadePSP}：通过全局与局部细化实现类别无关且超高分辨率的分割},\n  author={Cheng, Ho Kei 和 Chung, Jihoon 和 Tai, Yu-Wing 和 Tang, Chi-Keung},\n  booktitle={CVPR},\n  year={2020}\n}\n\n@inproceedings{xu2018youtubeVOS,\n  title={Youtube-vos：大规模视频目标分割基准},\n  author={Xu, Ning 和 Yang, Linjie 和 Fan, Yuchen 和 Yue, Dingcheng 和 Liang, Yuchen 和 Yang, Jianchao 和 Huang, Thomas},\n  booktitle = {ECCV},\n  year={2018}\n}\n\n@inproceedings{perazzi2016benchmark,\n  title={视频目标分割的基准数据集与评估方法},\n  author={Perazzi, Federico 和 Pont-Tuset, Jordi 和 McWilliams, Brian 和 Van Gool, Luc 和 Gross, Markus 和 Sorkine-Hornung, Alexander},\n  booktitle={CVPR},\n  year={2016}\n}\n\n@inproceedings{denninger2019blenderproc,\n  title={BlenderProc},\n  author={Denninger, Maximilian 和 Sundermeyer, Martin 和 Winkelbauer, Dominik 和 Zidan, Youssef 和 Olefir, Dmitry 和 Elbadrawy, Mohamad 和 Lodhi, Ahsan 和 Katam, Harinandan},\n  booktitle={arXiv:1911.01911},\n  year={2019}\n}\n\n@inproceedings{shapenet2015,\n  title       = {{ShapeNet：一个信息丰富的3D模型库}},\n  author      = {Chang, Angel Xuan 和 Funkhouser, Thomas 和 Guibas, Leonidas 和 Hanrahan, Pat 和 Huang, Qixing 和 Li, Zimo 和 Savarese, Silvio 和 Savva, Manolis 和 Song, Shuran 和 Su, Hao 和 Xiao, Jianxiong 和 Yi, Li 和 Yu, Fisher},\n  booktitle   = {arXiv:1512.03012},\n  year        = {2015}\n}\n```\n\n\u003C\u002Fdetails>\n\n联系方式：\u003Chkchengrex@gmail.com>","# STCN 快速上手指南\n\nSTCN (Space-Time Correspondence Networks) 是一个高效、轻量级的视频目标分割（VOS）框架，在多个基准测试中取得了 SOTA 结果。它无需复杂配置即可在单张显卡上以 20+ FPS 的速度运行，支持混合精度加速后更是可达 30+ FPS。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐)\n- **GPU**: 至少需要两张 11GB 显存的显卡进行训练（推理仅需一张）。支持 CUDA。\n- **Python**: 建议 Python 3.6+\n\n### 前置依赖\n本项目基于以下核心版本开发，建议尽量匹配以避免兼容性问题：\n- PyTorch `1.8.1`\n- torchvision `0.9.1`\n- OpenCV `4.2.0`\n- Pillow-SIMD `7.0.0.post3` (用于加速图像处理)\n\n> **注意**: 请优先参考 [PyTorch 官网](https:\u002F\u002Fpytorch.org\u002F) 安装与您 CUDA 版本匹配的 PyTorch 和 torchvision。国内用户可使用清华或中科大镜像源加速安装。\n\n## 安装步骤\n\n1. **克隆仓库**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN.git\n   cd STCN\n   ```\n\n2. **安装核心依赖**\n   首先确保已安装 PyTorch 和 torchvision，然后运行以下命令安装其余依赖包：\n   ```bash\n   pip install progressbar2 opencv-python gitpython gdown\n   ```\n\n3. **安装特殊依赖 (Pillow-SIMD 和 thinspline)**\n   Pillow-SIMD 能显著提升数据加载速度，thinspline 用于训练阶段的数据增强。\n   \n   *安装 Pillow-SIMD:*\n   ```bash\n   pip uninstall pillow\n   pip install pillow-simd==7.0.0.post3\n   ```\n   *(如果上述命令失败，请参考 Pillow-SIMD GitHub 页面的编译安装指南)*\n\n   *安装 thinspline:*\n   ```bash\n   pip install git+https:\u002F\u002Fgithub.com\u002Fcheind\u002Fpy-thin-plate-spline\n   ```\n\n## 基本使用\n\n### 1. 下载预训练模型\n你可以手动下载或使用提供的脚本下载模型。模型将保存在 `.\u002Fsaves\u002F` 目录下。\n\n**推荐模型 (s012 - 性能更好):**\n```bash\npython download_model.py --model s012\n```\n*若脚本下载缓慢，可手动从 [Google Drive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mRrE0uCI2ktdWlUgapJI_KmgeIiF2eOm\u002Fview?usp=sharing) 下载并放入 `.\u002Fsaves\u002F` 目录。*\n\n### 2. 准备数据\n你需要准备视频文件和对应的首帧掩码（Mask）。\n目录结构示例：\n```text\ndataset_name\u002F\n├── JPEGImages\u002F\n│   └── video_id\u002F\n│       ├── 00000.jpg\n│       ├── 00001.jpg\n│       └── ...\n└── Annotations\u002F\n    └── video_id\u002F\n        ├── 00000.png  (首帧掩码，后续帧无需提供)\n        └── ...\n```\n\n### 3. 运行推理 (Inference)\n使用 `eval_generic.py` 对自己的数据进行测试。\n\n```bash\npython eval_generic.py --dataset [你的数据集路径] --output [输出结果路径] --weights [模型权重路径，如 .\u002Fsaves\u002Fs012.pth]\n```\n\n**参数说明：**\n- `--dataset`: 包含 `JPEGImages` 和 `Annotations` 文件夹的根目录。\n- `--output`: 分割结果保存路径。\n- `--weights`: 预训练模型路径。\n\n### 4. 交互式体验 (可选)\n如果你希望拥有图形界面（GUI）来交互式地标注和分割视频，推荐使用集成了 STCN 的 [MiVOS 扩展版](https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS\u002Ftree\u002FMiVOS-STCN)：\n```bash\ngit clone -b MiVOS-STCN https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FMiVOS.git\ncd MiVOS\n# 按照该仓库说明安装并运行 interactive_gui.py\n```\n\n### 5. 验证基准测试结果 (可选)\n如果你已下载 DAVIS 或 YouTubeVOS 数据集，可直接运行官方评估脚本：\n\n*DAVIS 2017 验证集:*\n```bash\npython eval_davis.py --output [输出路径] --split val\n```\n\n*YouTubeVOS 验证集:*\n```bash\npython eval_youtube.py --yv_path [YouTubeVOS 数据集路径] --output [输出路径]\n```","某短视频特效团队需要为海量用户生成视频中的动态贴纸（如给奔跑的宠物自动添加装饰），要求处理速度快且边缘精准。\n\n### 没有 STCN 时\n- **渲染延迟高**：传统视频分割模型计算量大，单帧处理耗时久，无法达到实时预览所需的 20+ FPS，导致用户等待时间过长。\n- **显存占用爆炸**：随着视频时长增加，历史帧记忆库迅速膨胀，普通消费级显卡（如 11GB 显存）极易溢出，必须依赖昂贵的多卡集群。\n- **长视频跟踪丢失**：在物体被短暂遮挡或快速运动后，算法难以建立有效的时空关联，导致贴纸“跟丢”或闪烁，需人工逐帧修复。\n- **部署成本高昂**：为了平衡速度与精度，往往需要复杂的工程优化和特定的高端硬件（如 V100），增加了服务器运维负担。\n\n### 使用 STCN 后\n- **实现流畅实时交互**：STCN 凭借高效的时空对应网络，在混合精度下轻松突破 30 FPS，让用户在手机端也能即时看到完美的特效预览。\n- **内存利用极致优化**：通过改进的记忆覆盖机制和 L2 相似度计算，大幅压缩了显存需求，使得单张 11GB 显卡即可流畅处理长视频序列。\n- **鲁棒性显著增强**：即使在物体遮挡或剧烈形变场景下，STCN 仍能保持稳定的时空一致性，自动生成连贯平滑的蒙版，几乎无需人工干预。\n- **落地门槛大幅降低**：模型结构简单且无需特殊硬件加持，团队可直接在现有服务器上部署，快速将算法转化为线上产品功能。\n\nSTCN 通过重构时空记忆机制，以极低的算力成本解决了视频对象分割中速度与精度的长期矛盾，让高质量视频特效的大规模实时应用成为可能。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhkchengrex_STCN_a75c7cd0.png","hkchengrex","Rex Cheng","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fhkchengrex_01ff6c35.jpg","Ph.D. student at the University of Illinois Urbana-Champaign.\r\nOxygen consuming.",null,"Champaign, IL","hkchengrex@gmail.com","https:\u002F\u002Fhkchengrex.com","https:\u002F\u002Fgithub.com\u002Fhkchengrex",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,563,72,"2026-03-23T02:08:39","MIT","未说明","需要 NVIDIA GPU，训练需 2 张 11GB 显存显卡（无需 V100），推理测试基于 RTX 2080 Ti",{"notes":93,"python":90,"dependencies":94},"训练采用分布式数据并行 (DDP) 模式；BL30K 数据集巨大（约 700GB），运行下载脚本需预留约 1TB 磁盘空间；支持混合精度推理以提升速度；预训练模型需手动下载或运行脚本获取。",[95,96,97,98,99,100,101,102],"torch==1.8.1","torchvision==0.9.1","opencv-python==4.2.0","Pillow-SIMD==7.0.0.post3","progressbar2","py-thin-plate-spline","gitpython","gdown",[15,104,14],"视频",[106,107,108,109,110,111,112],"computer-vision","deep-learning","pytorch","segmentation","video-segmentation","video-object-segmentation","neurips-2021","2026-03-27T02:49:30.150509","2026-04-12T14:00:09.006173",[116,121,125,130,135,140,145,150],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},30677,"遇到 CUDA error: CUBLAS_STATUS_EXECUTION_FAILED 或 INVALID_VALUE 错误怎么办？","这是一个已知的兼容性问题，通常与特定的 PyTorch 版本（如 1.12.1+cu116）和 GPU 架构（如 Turing）有关。该错误发生在调用 `cublasSgemmStridedBatched` 时。目前社区中多位用户报告了此问题，建议检查您的 PyTorch 和 CUDA 版本组合，尝试升级或降级 PyTorch 版本，或者在较新的 GPU 架构上运行以规避此 cuBLAS 库的执行失败问题。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F7",{"id":122,"question_zh":123,"answer_zh":124,"source_url":120},30678,"复现论文结果时，DAVIS 2017 的指标比官方数据低，这正常吗？","在 'w\u002Fo BL30K' 设置下，DAVIS 2016 和 YouTube-VOS 的结果通常能复现（约 91.5% 和 83.0%），但 DAVIS 2017 的结果可能会比官方数据低约 1.2%（例如测得 84.2%）。这可能是由于评估细节或随机性导致的差异，如果其他基准符合预期，通常视为正常现象。",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},30679,"单 GPU 训练时如何调整 Batch Size 和迭代次数（iterations）？","如果您将单 GPU 的 Batch Size 从默认的 4 调整为 8（以保持与多 GPU 相同的总批次量），请保持迭代次数（iterations）和学习率（learning rate）与原论文设置一致（例如 stage3 保持 150k 次迭代），无需额外调整。维护者表示使用非最后的权重文件（如 iter 250k vs 300k）通常不会有重大差异，建议使用最后的权重文件。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F142",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},30680,"推理过程中如何获取前一帧的掩码（mask）？是否存在帧间隔？","在当前帧为 ti 的情况下，前一帧的索引即为 ti-1，帧之间没有间隔。如果您指的是“前一个记忆帧（previous memory frame）”，那是一个不同的概念，需要根据代码逻辑自行计算，但在常规的前后帧关系中，直接使用 ti-1 即可。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F60",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},30681,"训练过程中如何查看 Loss 和 IOU 日志？","项目不会生成文本格式的日志文件。模型文件保存在 `saves\u002F` 目录，而日志文件以 TensorBoard 格式保存在 `log\u002F` 目录（文件名类似 `events.out.tfevents...`）。您需要使用 TensorBoard 来查看这些数据，命令通常为 `tensorboard --logdir=log\u002F`，然后在浏览器中访问相应端口查看 Loss 和 IOU 曲线。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F96",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},30682,"实际训练时间远超论文描述的 30 小时，是什么原因？","论文中提到的 30 小时是指完成 stage 0 和 stage 3 的总时间。实际训练速度受硬件基础设施影响很大（如 CPU 负载、磁盘 I\u002FO、num_workers 设置等）。如果仅 stage 0 就耗时 100 小时，建议检查数据加载进程数（num_workers），尝试增加该值（例如设置为 16）以提升数据读取效率，从而加快训练速度。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F5",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},30683,"训练时为什么要随机选择第二个类别？支持多对象训练吗？","虽然 STCN 主要作为二值分割任务训练，但在 VOS 训练代码中确实会随机选择第二个类别参与训练，这一策略在论文的附录 F.3.2 节中有提及。这种做法有助于模型更好地处理多对象场景。实际上，使用包含多个对象的掩码进行训练，效果往往优于每个对象单独训练。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F128",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},30684,"测试阶段目标数量不固定，如何提取每个目标的预测掩码？","在训练阶段，目标数量通常是固定的（例如两个），可以直接通过切片（如 `prev_mask[:,0:1]`）获取。但在测试阶段，目标数量动态变化，需要通过 `self.enabled_obj` 列表来遍历当前启用的目标索引。代码逻辑应类似于：`for i, oi in enumerate(self.enabled_obj):`，然后利用 `oi` 索引从概率图或掩码张量中提取对应目标的预测结果，而不是硬编码索引。","https:\u002F\u002Fgithub.com\u002Fhkchengrex\u002FSTCN\u002Fissues\u002F64",[156],{"id":157,"version":158,"summary_zh":159,"released_at":160},222544,"1.0","预训练模型","2021-06-10T08:08:50"]