[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-facebookresearch--vggsfm":3,"tool-facebookresearch--vggsfm":64},[4,18,26,35,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},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,2,"2026-04-06T11:32:50",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"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",[43,15,13,14],"语言模型",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,52],"视频",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85013,"2026-04-06T11:09:19",[15,16,52,61,13,62,43,14,63],"插件","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":10,"env_os":95,"env_gpu":96,"env_ram":97,"env_deps":98,"category_tags":110,"github_topics":79,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":111,"updated_at":112,"faqs":113,"releases":144},4796,"facebookresearch\u002Fvggsfm","vggsfm","VGGSfM: Visual Geometry Grounded Deep Structure From Motion","vggsfm 是一款由 Meta AI 与牛津大学 VGG 团队联合开源的深度学习工具，专注于从图像序列中重建高精度的三维场景结构（SfM）。它巧妙地将视觉几何原理融入深度神经网络，有效解决了传统方法在弱纹理区域匹配困难、动态物体干扰以及大规模场景重建效率低等痛点。\n\n该工具不仅能精准估算相机姿态和生成稀疏点云，最新升级版本更支持输出稠密点云与深度图，并能通过掩码技术过滤视频中的移动物体，实现长达千帧的动态视频序列重建。此外，其结果可直接用于训练高斯泼溅（Gaussian Splatting）模型，快速生成逼真的三维场景。凭借在 CVPR2024 相机姿态估计挑战赛中夺冠的实力，vggsfm 展现了卓越的鲁棒性。\n\nvggsfm 非常适合计算机视觉研究人员、三维重建开发者以及需要处理复杂场景的设计师使用。虽然它提供了命令行演示供技术爱好者尝试，但其核心优势在于为专业用户提供了一个高效、可扩展且精度顶尖的底层重建方案，助力大家轻松探索从静态图片到动态视频的三维数字化世界。","# VGGSfM: Visual Geometry Grounded Deep Structure From Motion\n\n\n![Teaser](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_f2a43f82bc2c.gif)\n\n**[Meta AI Research, GenAI](https:\u002F\u002Fai.facebook.com\u002Fresearch\u002F)**; **[University of Oxford, VGG](https:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002F)**\n\n\n[Jianyuan Wang](https:\u002F\u002Fjytime.github.io\u002F), [Nikita Karaev](https:\u002F\u002Fnikitakaraevv.github.io\u002F), [Christian Rupprecht](https:\u002F\u002Fchrirupp.github.io\u002F), [David Novotny](https:\u002F\u002Fd-novotny.github.io\u002F)\n\n\n\n\u003Cp \ndir=\"auto\">[\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2312.04563.pdf\" rel=\"nofollow\">Paper\u003C\u002Fa>]\n[\u003Ca href=\"https:\u002F\u002Fvggsfm.github.io\u002F\" rel=\"nofollow\">Project Page\u003C\u002Fa>]   \n[\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffacebook\u002Fvggsfm\" rel=\"nofollow\">🤗 Demo\u003C\u002Fa>] \n[Version 2.0]\n\u003C\u002Fp> \n\n\n**Updates:**\n\n\n- [Sep 9, 2024] Allow to export a dense point cloud!\n\n- [Sep 5, 2024] Added the instruction on how to train a Gaussian splatting model with our results! \n\n- [Aug 26, 2024]\n  - We have introduced a video runner that can process sequential frames, such as those in videos. It supports the reconstruction of over ```1000``` input frames. By using masks to filter out moving objects, it can also effectively recover camera poses and point clouds from dynamic video sequences.\n\n- [Jul 28, 2024] Added support for filtering out dynamic objects using ```masks```.\n\n- [Jul 10, 2024] Now we support exporting dense depth maps!\n\n- Happy to share we were ranked 1st 🥇 in the CVPR24 IMC Challenge regarding camera pose (Rot&Trans) estimation.\n\n## Table of Contents\n- [Installation](#installation)\n- [Reconstruction](#reconstruction)\n  - [Download Pre-trained Model](#1-download-pre-trained-model)\n  - [Run a Demo](#2-run-a-demo)\n  - [Visualization Options](#3-visualization-options)\n  - [Use Your Own Data](#4-use-your-own-data)\n  - [Generate Denser Point Cloud](#5-generate-denser-point-cloud)\n  - [Dense Depth Prediction (Beta)](#6-dense-depth-prediction-beta)\n  - [Sequential Input](#7-sequential-input)\n  - [Dynamic\u002FMoving Objects](#8-dynamicmoving-objects)\n  - [Train a Gaussian Splatting Model](#9-train-a-gaussian-splatting-model)\n  - [FAQs](#10-faqs)\n\n## Installation\nWe provide a simple installation script that, by default, sets up a conda environment with Python 3.10, PyTorch 2.1, and CUDA 12.1.\n\n```.bash\nsource install.sh\npython -m pip install -e .\n```\n\nThis script installs official ```pytorch3d```, ```lightglue```, ```pycolmap```, ```poselib```, and ```visdom```. If you cannot install ```pytorch3d``` on your machine, feel free to skip it, because now we only use it for visdom visualization (i.e., ```cfg.viz_visualize=True```). \n\n\n## RECONSTRUCTION  \n\n### 1. Download Pre-trained Model\nThe checkpoint will be automatically downloaded from [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002FVGGSfM\u002Ftree\u002Fmain) during the first run. Alternatively, you can manually download it from [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002FVGGSfM\u002Fblob\u002Fmain\u002Fvggsfm_v2_0_0.bin) or [Google Drive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F163bHiqeTJhQ2_UnihRNPRA4Y9X8-gZ1-\u002Fview?usp=sharing). If you prefer to specify the checkpoint path manually, set `auto_download_ckpt` to `False` and update `resume_ckpt` to your path in the Hydra config.\n\n\n### 2. Run a Demo \n\nNow it's time to enjoy your 3D reconstruction! You can start with our provided examples:\n\n```bash\n# Use default settings\npython demo.py SCENE_DIR=examples\u002Fkitchen \n\n# Specify query method: sp+sift (default: aliked)\npython demo.py SCENE_DIR=examples\u002Fstatue query_method=sp+sift\n\n# Increase query number to 4096 (default: 2048)\npython demo.py SCENE_DIR=examples\u002Fbritish_museum max_query_pts=4096 \n\n# Assume a shared camera model for all frames, and\n# Use SIMPLE_RADIAL camera model instead of the default SIMPLE_PINHOLE\n# Increase the number of query frames from the default value of 3 to 6\npython demo.py shared_camera=True camera_type=SIMPLE_RADIAL query_frame_num=6\n\n# If you want a fast reconstruction without fine tracking\npython demo.py SCENE_DIR=examples\u002Fkitchen fine_tracking=False\n```\n\nAll default settings for the flags are specified in `cfgs\u002Fdemo.yaml`. You can adjust these flags as needed, such as reducing the number of query points by ```max_query_pts```, or increase ```query_frame_num``` to use more frames as query. To enforce a shared camera model for a scene, set ```shared_camera=True```. To use query points from different methods, set ```query_method``` to ```sp```, ```sift```, ```aliked```, or any combination like ```sp+sift```. Additionally, ```fine_tracking``` is enabled by default, but you can set it to False to switch to coarse matching only, which speeds up inference a lot. \n\nThe reconstruction result (camera parameters and 3D points) will be automatically saved under ```SCENE_DIR\u002Fsparse``` in the COLMAP format, as ```cameras.bin```, ```images.bin```, and ```points3D.bin```. This format is widely supported by the recent NeRF\u002FGaussian Splatting codebases. You can use [COLMAP GUI](https:\u002F\u002Fcolmap.github.io\u002Fgui.html) or [viser](https:\u002F\u002Fgithub.com\u002Fnerfstudio-project\u002Fviser) to view the reconstruction. \n\nThis sparse reconstruction mode can process up to ```400``` frames at a time. To handle more frames (e.g., over ```1,000``` frames), please refer to the ```Sequential Input``` section below for guidance.\n\n\n### 3. Visualization Options\n\nIf you want to visualize it more easily, we also provide visualization options using [Gradio](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio) and [Visdom](https:\u002F\u002Fgithub.com\u002Ffossasia\u002Fvisdom).\n\n\n\n#### 3.1 Gradio Visualization (recommended)\n\n\u003Cdetails>\n\u003Csummary>Click to expand\u003C\u002Fsummary>\n\nThe easiest way to visualize your results is by using Gradio. Simply set the `gr_visualize` flag to `True`, and a link will be generated that you can open in any web browser in any machine. This is especially useful when running the program on a remote Linux server without a GUI, allowing you to view the results on your local computer. Please note it may take a few seconds to load.\n\n\n```bash\npython demo.py gr_visualize=True ...(other flags)\n```\n\u003C\u002Fdetails>\n\n\n#### 3.2 Visdom Visualization\n\n\u003Cdetails>\n\u003Csummary>Click to expand\u003C\u002Fsummary>\n\nTo begin using Visdom, start the server by entering ```visdom``` in the command line. Once the server is running, access Visdom by navigating to ```http:\u002F\u002Flocalhost:8097``` in your web browser. Now every reconstruction can be visualized and saved to the Visdom server by enabling ```viz_visualize=True```:\n\n```bash\npython demo.py viz_visualize=True ...(other flags)\n```\n\nYou should see an interface like this:\n\n![UI](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_dfc82efb28c2.png)\n\u003C\u002Fdetails>\n\n\n\n#### 3.3 Additional Visualizations\n- **Visualizing 2D Reprojections:**\n  \u003C!-- \u003Cdetails> -->\n  \u003C!-- \u003Csummary>Click to expand\u003C\u002Fsummary> -->\n  - To visualize the 2D reprojections of reconstructed 3D points, set the `make_reproj_video` flag to `True`. This will generate a video named `reproj.mp4` in the `SCENE_DIR\u002Fvisuals` directory. For example:\n  \u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_17b555e13515.gif\" width=\"500\" alt=\"reproj\">\n  \u003C\u002Fp>\n  \u003C!-- \u003C\u002Fdetails> -->\n\n\n- **Visualizing Track Predictions:**\n  \u003Cdetails>\n  \u003Csummary>Click to expand\u003C\u002Fsummary>\n\n  - To visualize the raw predictions from our track predictor, enable ```visual_tracks=True``` to generate ```track.mp4```. In this video, transparent points indicate low visibility or confidence. \n  \u003C\u002Fdetails>\n\n\n### 4. Use Your Own Data\n\nYou only need to specify the address of your data. For example, I would recommend to start from \n\n```bash\npython demo.py SCENE_DIR=\u002FYOUR_FOLDER camera_type=SIMPLE_RADIAL gr_visualize=True make_reproj_video=True\n```\n\nPlease ensure that the images are stored in ```YOUR_FOLDER\u002Fimages```. This folder should contain only the images. Check the ```examples``` folder for the desired data structure.\n\n\n### 5. Generate Denser Point Cloud\n\nTo generate a denser point cloud, you can triangulate additional 3D points by setting the `extra_pt_pixel_interval` parameter. For each frame, a 2D grid is sampled with a pixel interval defined by `extra_pt_pixel_interval`. This grid is used as query points to estimate tracks, which are then triangulated into 3D points. After filtering out noisy 3D points, they are added to the existing point cloud. Since these extra 3D points are not optimized in the bundle adjustment process, this method is quite fast while maintaining reasonable quality. You can generally start from ```python demo.py extra_pt_pixel_interval=10 concat_extra_points=True```. The additional points will be concatenated with the existing points if `concat_extra_points=True`, allowing direct use for Gaussian Splatting. The details of these additional points are saved in `additional\u002Fadditional_points_dict.pt`. You can also set `extra_by_neighbor` to control the number of neighboring frames for each additional point, ensuring efficient inference when dealing with a large number of frames.\n\n\n### 6. Dense Depth Prediction (Beta)\n\n\u003Cdetails>\n\u003Csummary>Click to expand\u003C\u002Fsummary>\nWe support extracting dense depth maps with the help of [Depth-Anything-V2](https:\u002F\u002Fgithub.com\u002FDepthAnything\u002FDepth-Anything-V2). Basically, we align the dense depth prediction from Depth-Anything-V2 using the sparse SfM point cloud predicted by VGGSfM. To enable this, please first git clone Depth-Anything-V2 and install scikit-learn:\n\n```bash\npip install scikit-learn\ngit clone git@github.com:DepthAnything\u002FDepth-Anything-V2.git dependency\u002Fdepth_any_v2\npython -m pip install -e .\n```\n\nTo enable dense depth prediction, set ```dense_depth=True``` when running `demo.py`. The generated depth maps will be saved in the ```depths``` folder under ```cfg.SCENE_DIR```, using the COLMAP format (e.g., ```*.bin```). To visualize the dense point cloud (unprojected dense depth maps) in Visdom, set ```visual_dense_point_cloud=True```. Note that due to the large number of points, we only support ```visual_dense_point_cloud``` in Visdom, not in Gradio.\n\u003C\u002Fdetails>\n\n\n### 7. Sequential Input\n\nGiven ordered frames as input (e.g., videos), we support running reconstruction in a sliding window manner, which allows for the reconstruction of over ```1,000``` frames.\n\nIts launcher ```video_demo.py``` follows the same convention to ```demo.py``` above. You need to put images under  ```YOUR_VIDEO_FOLDER\u002Fimages``` with the their image names ordered, e.g., ```0000.png```, ```0001.png```, ```0002.png```... Then, simply run the following command:\n\n\n```bash\npython video_demo.py SCENE_DIR=\u002FYOUR_VIDEO_FOLDER\n```\n\nPlease note that the configuration for `video_demo.py` is initialized in `cfgs\u002Fvideo_demo.yaml`. You can adjust ```init_window_size``` and ```window_size``` to control the number of frames for each window. The flag ```joint_BA_interval``` is used to control the frequency of joint bundle adjustment over the whole sequence. Other flags, such as thoses regarding output saving or visualization, are exactly the same as in `demo.py`.\n\n\n### 8. Dynamic\u002FMoving Objects\n\nSometimes, the input frames may contain dynamic or moving objects. Our method can generally handle these when the dynamic objects are relatively small. However, if the dynamic objects occupy a significant portion of the frames, especially when the camera motion is minimal, we recommend filtering out these dynamic pixels.\n\n\nThis codebase supports the use of masks to filter out dynamic pixels. The masks should be placed in the `masks` folder under `cfg.SCENE_DIR`, with filenames matching the corresponding images (e.g., `images\u002F0000.png` and `masks\u002F0000.png`). These masks should be binary, with 1 indicating pixels to be filtered out (i.e., dynamic pixels) and 0 for pixels that should remain. You can refer to the masks from the DAVIS dataset as an example. \n\nMasks can be generated using object detection, video segmentation, or manual labeling. Here is an [instruction](https:\u002F\u002Fgithub.com\u002Fvye16\u002Fshape-of-motion\u002Fblob\u002Fmain\u002Fpreproc\u002FREADME.md) on how to build such masks using SAM and Track-Anything. [SAM2](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fsegment-anything-2) is also a good option for generating these masks.\n\n\n### 9. Train a Gaussian Splatting model\n\nIf you have successfully reconstructed a scene using the commands above, you should have a folder named `sparse` under your `SCENE_DIR`, with the following structure:\n``` \nSCENE_DIR\u002F\n├── images\u002F\n└── sparse\u002F\n    ├── cameras.bin\n    ├── images.bin\n    └── points3D.bin\n```\n\nYou can now use [gsplat](https:\u002F\u002Fgithub.com\u002Fnerfstudio-project\u002Fgsplat) to train your own Gaussian Splatting model. Please install `gsplat` according to their official instructions. We assume you are using `gsplat==1.3.0`.\n\nAn example command to train the model is:\n```\ncd gsplat\npython examples\u002Fsimple_trainer.py  default --data_factor 1 --data_dir \u002FYOUR\u002FSCENE_DIR\u002F --result_dir \u002FYOUR\u002FRESULT_DIR\u002F\n```\n\n### 10. FAQs\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>What should I do if I encounter an out-of-memory error?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nWe may encounter an out-of-memory error when the number of input frames or query points is too high. In v2.0, we address this by splitting the points into several chunks and running the prediction separately. This involves two hardcoded hyperparameters: ```max_points_num=163840``` in [predict_tracks](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fblob\u002Fcfbc06e2f30639073b52d65828e6a6d27087c4f4\u002Fvggsfm\u002Frunners\u002Frunner.py#L894C20-L894C26) and ```max_tri_points_num=819200``` in [triangulate_tracks](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fblob\u002Fcfbc06e2f30639073b52d65828e6a6d27087c4f4\u002Fvggsfm\u002Futils\u002Ftriangulation.py#L712). These values are set for a ```32GB``` GPU. If your GPU has less or more memory, reduce or increase these values ​​accordingly.\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>How to handle sparse data with minimal view overlap?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nFor scenarios with sparse views and minimal overlap, the simplest solution is to set ```query_frame_num``` to the total number of your images and use a ```max_query_pts``` of 4096 or more. This ensures all frames are registered. Since we only have sparse views, the inference process remains very fast. For example, the following command took around 20 seconds to reconstruct an 8-frame scene:\n```\npython demo.py SCENE_DIR=a_scene_with_8_frames query_frame_num=8 max_query_pts=4096 query_method=aliked\n```\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>When should I set shared_camera to True?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nSet ```shared_camera``` to True when you know that the input frames were captured by the same camera and the camera focal length did not significantly change during the capture. This assumption is usually valid for images extracted from a video.\n\u003C\u002Fdetails>\n\n\n## Testing \n\nWe are still preparing the testing script for VGGSfM v2. However, you can use our code for VGGSfM v1.1 to reproduce our benchmark results in the paper. Please refer to the branch ```v1.1```.\n\n\n## Acknowledgement\n\nWe are highly inspired by [colmap](https:\u002F\u002Fgithub.com\u002Fcolmap\u002Fcolmap), [pycolmap](https:\u002F\u002Fgithub.com\u002Fcolmap\u002Fpycolmap), [posediffusion](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPoseDiffusion), [cotracker](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fco-tracker), and [kornia](https:\u002F\u002Fgithub.com\u002Fkornia\u002Fkornia).\n\n\n## License\nSee the [LICENSE](.\u002FLICENSE.txt) file for details about the license under which this code is made available.\n\n\n## Citing VGGSfM\nIf you find our repository useful, please consider giving it a star ⭐ and citing our paper in your work:\n\n\n```bibtex\n@inproceedings{wang2024vggsfm,\n  title={VGGSfM: Visual Geometry Grounded Deep Structure From Motion},\n  author={Wang, Jianyuan and Karaev, Nikita and Rupprecht, Christian and Novotny, David},\n  booktitle={Proceedings of the IEEE\u002FCVF Conference on Computer Vision and Pattern Recognition},\n  pages={21686--21697},\n  year={2024}\n}","# VGGSfM：基于视觉几何的深度结构光流\n\n\n![预告片](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_f2a43f82bc2c.gif)\n\n**[Meta AI Research, GenAI](https:\u002F\u002Fai.facebook.com\u002Fresearch\u002F)**；**[牛津大学，VGG](https:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002F)**\n\n\n[Jianyuan Wang](https:\u002F\u002Fjytime.github.io\u002F)、[Nikita Karaev](https:\u002F\u002Fnikitakaraevv.github.io\u002F)、[Christian Rupprecht](https:\u002F\u002Fchrirupp.github.io\u002F)、[David Novotny](https:\u002F\u002Fd-novotny.github.io\u002F)\n\n\n\n\u003Cp \ndir=\"auto\">[\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2312.04563.pdf\" rel=\"nofollow\">论文\u003C\u002Fa>]\n[\u003Ca href=\"https:\u002F\u002Fvggsfm.github.io\u002F\" rel=\"nofollow\">项目页面\u003C\u002Fa>]   \n[\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffacebook\u002Fvggsfm\" rel=\"nofollow\">🤗 演示\u003C\u002Fa>] \n[版本 2.0]\n\u003C\u002Fp> \n\n\n**更新：**\n\n\n- [2024年9月9日] 允许导出稠密点云！\n\n- [2024年9月5日] 增加了如何使用我们的结果训练高斯泼溅模型的说明！ \n\n- [2024年8月26日]\n  - 我们引入了一个视频运行器，可以处理序列帧，例如视频中的帧。它支持超过```1000```个输入帧的重建。通过使用掩码过滤掉移动物体，它还可以有效地从动态视频序列中恢复相机位姿和点云。\n\n- [2024年7月28日] 增加了使用```masks```过滤动态物体的支持。\n\n- [2024年7月10日] 现在我们支持导出稠密深度图！\n\n- 很高兴地分享，我们在CVPR24 IMC挑战赛中，在相机位姿（旋转与平移）估计方面获得了第1名 🥇。\n\n## 目录\n- [安装](#installation)\n- [重建](#reconstruction)\n  - [下载预训练模型](#1-download-pre-trained-model)\n  - [运行演示](#2-run-a-demo)\n  - [可视化选项](#3-visualization-options)\n  - [使用您自己的数据](#4-use-your-own-data)\n  - [生成更稠密的点云](#5-generate-denser-point-cloud)\n  - [稠密深度预测（测试版）](#6-dense-depth-prediction-beta)\n  - [序列输入](#7-sequential-input)\n  - [动态\u002F移动物体](#8-dynamicmoving-objects)\n  - [训练高斯泼溅模型](#9-train-a-gaussian-splatting-model)\n  - [常见问题](#10-faqs)\n\n## 安装\n我们提供了一个简单的安装脚本，默认会设置一个包含Python 3.10、PyTorch 2.1和CUDA 12.1的conda环境。\n\n```.bash\nsource install.sh\npython -m pip install -e .\n```\n\n该脚本会安装官方的```pytorch3d```、```lightglue```、```pycolmap```、```poselib```和```visdom```。如果您无法在您的机器上安装```pytorch3d```，可以跳过它，因为现在我们只将其用于visdom可视化（即```cfg.viz_visualize=True```）。\n\n\n## 重建  \n\n### 1. 下载预训练模型\n检查点将在首次运行时自动从[Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002FVGGSfM\u002Ftree\u002Fmain)下载。或者，您也可以手动从[Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002FVGGSfM\u002Fblob\u002Fmain\u002Fvggsfm_v2_0_0.bin)或[Google Drive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F163bHiqeTJhQ2_UnihRNPRA4Y9X8-gZ1-\u002Fview?usp=sharing)下载。如果您希望手动指定检查点路径，请将`auto_download_ckpt`设置为`False`，并在Hydra配置中将`resume_ckpt`更新为您指定的路径。\n\n\n### 2. 运行演示 \n\n现在是享受您的3D重建的时候了！您可以从我们提供的示例开始：\n\n```bash\n# 使用默认设置\npython demo.py SCENE_DIR=examples\u002Fkitchen \n\n# 指定查询方法：sp+sift（默认：aliked）\npython demo.py SCENE_DIR=examples\u002Fstatue query_method=sp+sift\n\n# 将查询数量增加到4096（默认：2048）\npython demo.py SCENE_DIR=examples\u002Fbritish_museum max_query_pts=4096 \n\n# 假设所有帧共享一个相机模型，并且\n# 使用SIMPLE_RADIAL相机模型代替默认的SIMPLE_PINHOLE\n# 将查询帧数从默认的3帧增加到6帧\npython demo.py shared_camera=True camera_type=SIMPLE_RADIAL query_frame_num=6\n\n# 如果您想要快速重建而无需精细跟踪\npython demo.py SCENE_DIR=examples\u002Fkitchen fine_tracking=False\n```\n\n所有标志的默认设置都已在`cfgs\u002Fdemo.yaml`中指定。您可以根据需要调整这些标志，例如通过```max_query_pts```减少查询点的数量，或增加```query_frame_num`来使用更多的帧作为查询。要强制对场景使用共享相机模型，请将```shared_camera=True```。要使用来自不同方法的查询点，请将```query_method```设置为```sp```、```sift```、```aliked```，或任何组合，如```sp+sift```。此外，```fine_tracking```默认是启用的，但您可以将其设置为False，仅进行粗略匹配，这样可以大大加快推理速度。\n\n重建结果（相机参数和3D点）将自动以COLMAP格式保存在```SCENE_DIR\u002Fsparse```下，分别为```cameras.bin```、```images.bin```和```points3D.bin```。这种格式被最近的NeRF\u002F高斯泼溅代码库广泛支持。您可以使用[COLMAP GUI](https:\u002F\u002Fcolmap.github.io\u002Fgui.html)或[viser](https:\u002F\u002Fgithub.com\u002Fnerfstudio-project\u002Fviser)来查看重建结果。 \n\n这种稀疏重建模式一次最多可以处理```400```帧。如果需要处理更多帧（例如超过```1,000```帧），请参阅下面的“序列输入”部分获取指导。\n\n### 3. 可视化选项\n\n如果您希望更方便地进行可视化，我们还提供了基于 [Gradio](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio) 和 [Visdom](https:\u002F\u002Fgithub.com\u002Ffossasia\u002Fvisdom) 的可视化选项。\n\n\n\n#### 3.1 Gradio 可视化（推荐）\n\n\u003Cdetails>\n\u003Csummary>点击展开\u003C\u002Fsummary>\n\n可视化结果最简单的方式是使用 Gradio。只需将 `gr_visualize` 标志设置为 `True`，系统就会生成一个链接，您可以在任何设备上的任意浏览器中打开。这在远程 Linux 服务器上运行程序且没有图形界面时尤为有用，可以让您在本地计算机上查看结果。请注意，加载可能需要几秒钟。\n\n\n```bash\npython demo.py gr_visualize=True ...(其他标志)\n```\n\u003C\u002Fdetails>\n\n\n#### 3.2 Visdom 可视化\n\n\u003Cdetails>\n\u003Csummary>点击展开\u003C\u002Fsummary>\n\n要开始使用 Visdom，请在命令行中输入 `visdom` 启动服务器。服务器启动后，在您的浏览器中访问 `http:\u002F\u002Flocalhost:8097` 即可进入 Visdom 界面。现在，通过启用 `viz_visualize=True`，每次重建的结果都可以在 Visdom 服务器上可视化并保存：\n\n```bash\npython demo.py viz_visualize=True ...(其他标志)\n```\n\n您应该会看到如下界面：\n\n![UI](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_dfc82efb28c2.png)\n\u003C\u002Fdetails>\n\n\n\n#### 3.3 其他可视化功能\n- **可视化 2D 重投影：**\n  \u003C!-- \u003Cdetails> -->\n  \u003C!-- \u003Csummary>点击展开\u003C\u002Fsummary> -->\n  - 要可视化重建的 3D 点的 2D 重投影，请将 `make_reproj_video` 标志设置为 `True`。这将在 `SCENE_DIR\u002Fvisuals` 目录下生成名为 `reproj.mp4` 的视频。例如：\n  \u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_readme_17b555e13515.gif\" width=\"500\" alt=\"reproj\">\n  \u003C\u002Fp>\n  \u003C!-- \u003C\u002Fdetails> -->\n\n\n- **可视化轨迹预测：**\n  \u003Cdetails>\n  \u003Csummary>点击展开\u003C\u002Fsummary>\n\n  - 若要可视化我们轨迹预测器的原始预测结果，启用 `visual_tracks=True` 将生成 `track.mp4`。在该视频中，透明点表示可见性或置信度较低。\n  \u003C\u002Fdetails>\n\n\n### 4. 使用您自己的数据\n\n您只需指定数据的路径即可。例如，建议从以下命令开始：\n\n```bash\npython demo.py SCENE_DIR=\u002FYOUR_FOLDER camera_type=SIMPLE_RADIAL gr_visualize=True make_reproj_video=True\n```\n\n请确保图像存储在 `YOUR_FOLDER\u002Fimages` 中。该文件夹应仅包含图像。您可以参考 `examples` 文件夹中的数据结构示例。\n\n\n### 5. 生成更密集的点云\n\n要生成更密集的点云，可以通过设置 `extra_pt_pixel_interval` 参数来三角测量额外的 3D 点。对于每一帧，都会以 `extra_pt_pixel_interval` 定义的像素间隔采样一个 2D 网格，该网格用作查询点来估计轨迹，然后将其三角测量为 3D 点。去除噪声点后，这些点会被添加到现有点云中。由于这些额外的 3D 点未在光束法平差过程中优化，因此该方法速度较快，同时仍能保持合理的质量。通常可以从 `python demo.py extra_pt_pixel_interval=10 concat_extra_points=True` 开始。如果 `concat_extra_points=True`，额外的点将与现有点合并，从而可以直接用于高斯溅射。这些额外点的详细信息会保存在 `additional\u002Fadditional_points_dict.pt` 中。您还可以设置 `extra_by_neighbor` 来控制每个额外点所考虑的相邻帧数量，以便在处理大量帧时实现高效的推理。\n\n\n### 6. 密集深度预测（测试版）\n\n\u003Cdetails>\n\u003Csummary>点击展开\u003C\u002Fsummary>\n我们支持借助 [Depth-Anything-V2](https:\u002F\u002Fgithub.com\u002FDepthAnything\u002FDepth-Anything-V2) 提取密集深度图。其基本原理是利用 VGGSfM 预测的稀疏 SfM 点云对 Depth-Anything-V2 的密集深度预测进行配准。要启用此功能，请先克隆 Depth-Anything-V2 并安装 scikit-learn：\n\n```bash\npip install scikit-learn\ngit clone git@github.com:DepthAnything\u002FDepth-Anything-V2.git dependency\u002Fdepth_any_v2\npython -m pip install -e .\n```\n\n要启用密集深度预测，在运行 `demo.py` 时设置 `dense_depth=True` 即可。生成的深度图将保存在 `cfg.SCENE_DIR` 下的 `depths` 文件夹中，采用 COLMAP 格式（如 `*.bin`）。要在 Visdom 中可视化密集点云（未投影的密集深度图），请设置 `visual_dense_point_cloud=True`。请注意，由于点的数量较多，我们仅支持在 Visdom 中进行 `visual_dense_point_cloud`，而不支持在 Gradio 中进行可视化。\n\u003C\u002Fdetails>\n\n\n### 7. 顺序输入\n\n对于有序帧输入（如视频），我们支持以滑动窗口方式执行重建，从而可以处理超过 1,000 帧的数据。\n\n其启动脚本 `video_demo.py` 与上述 `demo.py` 采用相同的约定。您需要将图像按顺序命名为 `0000.png`、`0001.png`、`0002.png` 等，放置在 `YOUR_VIDEO_FOLDER\u002Fimages` 目录下。然后，只需运行以下命令：\n\n\n```bash\npython video_demo.py SCENE_DIR=\u002FYOUR_VIDEO_FOLDER\n```\n\n请注意，`video_demo.py` 的配置已在 `cfgs\u002Fvideo_demo.yaml` 中初始化。您可以调整 `init_window_size` 和 `window_size` 来控制每个窗口的帧数。`joint_BA_interval` 标志用于控制在整个序列中联合光束法平差的频率。其他标志，如有关输出保存或可视化的内容，与 `demo.py` 完全相同。\n\n\n### 8. 动态\u002F移动物体\n\n有时，输入帧中可能包含动态或移动物体。当动态物体相对较小的时候，我们的方法通常能够很好地处理。然而，如果动态物体占据了帧的很大一部分，尤其是在相机运动很小的情况下，我们建议过滤掉这些动态像素。\n\n\n该代码库支持使用掩码来过滤掉动态像素。掩码应放置在 `cfg.SCENE_DIR` 下的 `masks` 文件夹中，文件名需与对应的图像匹配（如 `images\u002F0000.png` 和 `masks\u002F0000.png`）。这些掩码应为二值图像，其中 1 表示需要过滤掉的像素（即动态像素），0 表示保留的像素。您可以参考 DAVIS 数据集中的掩码作为示例。\n\n掩码可以通过目标检测、视频分割或手动标注来生成。这里提供一份关于如何使用 SAM 和 Track-Anything 构建此类掩码的[说明](https:\u002F\u002Fgithub.com\u002Fvye16\u002Fshape-of-motion\u002Fblob\u002Fmain\u002Fpreproc\u002FREADME.md)。[SAM2](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fsegment-anything-2) 也是生成这些掩码的一个不错的选择。\n\n### 9. 训练高斯溅射模型\n\n如果您已使用上述命令成功重建场景，则应在您的 `SCENE_DIR` 下生成一个名为 `sparse` 的文件夹，其结构如下：\n``` \nSCENE_DIR\u002F\n├── images\u002F\n└── sparse\u002F\n    ├── cameras.bin\n    ├── images.bin\n    └── points3D.bin\n```\n\n现在您可以使用 [gsplat](https:\u002F\u002Fgithub.com\u002Fnerfstudio-project\u002Fgsplat) 来训练您自己的高斯溅射模型。请按照其官方说明安装 `gsplat`。我们假设您正在使用 `gsplat==1.3.0`。\n\n训练模型的示例命令如下：\n```\ncd gsplat\npython examples\u002Fsimple_trainer.py  default --data_factor 1 --data_dir \u002FYOUR\u002FSCENE_DIR\u002F --result_dir \u002FYOUR\u002FRESULT_DIR\u002F\n```\n\n### 10. 常见问题解答\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>如果遇到内存不足错误该怎么办？\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n当输入帧数或查询点数量过多时，可能会出现内存不足的错误。在 v2.0 中，我们通过将点分割成若干块并分别进行预测来解决这个问题。这涉及两个硬编码的超参数：[predict_tracks](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fblob\u002Fcfbc06e2f30639073b52d65828e6a6d27087c4f4\u002Fvggsfm\u002Frunners\u002Frunner.py#L894C20-L894C26) 中的 ```max_points_num=163840```，以及 [triangulate_tracks](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fblob\u002Fcfbc06e2f30639073b52d65828e6a6d27087c4f4\u002Fvggsfm\u002Futils\u002Ftriangulation.py#L712) 中的 ```max_tri_points_num=819200```。这些值是针对配备 ```32GB``` 显存的 GPU 设定的。如果您的 GPU 显存较少或较多，请相应地减少或增加这些值。\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>如何处理视图重叠极少的稀疏数据？\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n对于视图稀疏且重叠极少的情况，最简单的解决方案是将 ```query_frame_num``` 设置为您图像的总数量，并将 ```max_query_pts``` 设置为 4096 或更高。这样可以确保所有帧都被注册。由于只有稀疏视图，推理过程仍然非常快速。例如，以下命令大约用了 20 秒就重建了一个包含 8 帧的场景：\n```\npython demo.py SCENE_DIR=a_scene_with_8_frames query_frame_num=8 max_query_pts=4096 query_method=aliked\n```\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>何时应将 shared_camera 设置为 True？\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n当您确定输入帧是由同一台相机拍摄，且相机焦距在拍摄过程中没有显著变化时，可将 ```shared_camera``` 设置为 True。这一假设通常适用于从视频中提取的图像。\n\u003C\u002Fdetails>\n\n\n## 测试 \n\n我们仍在准备 VGGSfM v2 的测试脚本。不过，您可以使用我们的 VGGSfM v1.1 代码来复现论文中的基准测试结果。请参考分支 ```v1.1```。\n\n\n## 致谢\n\n我们深受 [colmap](https:\u002F\u002Fgithub.com\u002Fcolmap\u002Fcolmap)、[pycolmap](https:\u002F\u002Fgithub.com\u002Fcolmap\u002Fpycolmap)、[posediffusion](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPoseDiffusion)、[cotracker](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fco-tracker) 和 [kornia](https:\u002F\u002Fgithub.com\u002Fkornia\u002Fkornia) 的启发。\n\n\n## 许可证\n有关此代码所采用许可证的详细信息，请参阅 [LICENSE](.\u002FLICENSE.txt) 文件。\n\n\n## 引用 VGGSfM\n如果您觉得我们的仓库很有用，请考虑给它点赞 ⭐，并在您的工作中引用我们的论文：\n\n\n```bibtex\n@inproceedings{wang2024vggsfm,\n  title={VGGSfM: 视觉几何驱动的深度结构光运动},\n  author={Wang, Jianyuan and Karaev, Nikita and Rupprecht, Christian and Novotny, David},\n  booktitle={IEEE\u002FCVF 计算机视觉与模式识别会议论文集},\n  pages={21686--21697},\n  year={2024}\n}","# VGGSfM 快速上手指南\n\nVGGSfM (Visual Geometry Grounded Deep Structure From Motion) 是由 Meta AI 和牛津大学 VGG 组联合推出的深度学习运动恢复结构（SfM）工具。它擅长从图像序列中高精度地恢复相机姿态和稀疏点云，支持处理动态物体、长视频序列，并可导出稠密点云及深度图，完美适配 NeRF 和 Gaussian Splatting 工作流。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux (推荐 Ubuntu)\n*   **GPU**: 支持 CUDA 的 NVIDIA 显卡\n*   **基础环境**: \n    *   Python 3.10\n    *   PyTorch 2.1\n    *   CUDA 12.1\n*   **依赖库**: 项目脚本将自动安装 `pytorch3d`, `lightglue`, `pycolmap`, `poselib`, `visdom` 等核心依赖。\n    *   *注*: 若 `pytorch3d` 安装失败可跳过，仅会影响 Visdom 可视化功能，不影响核心重建。\n\n> **国内加速建议**：\n> 由于模型权重托管在 Hugging Face，国内用户下载可能较慢。建议配置镜像源或使用代理。\n> 手动下载权重备用地址：[Google Drive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F163bHiqeTJhQ2_UnihRNPRA4Y9X8-gZ1-\u002Fview?usp=sharing) 或 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002FVGGSfM\u002Fblob\u002Fmain\u002Fvggsfm_v2_0_0.bin)。\n\n## 安装步骤\n\n项目提供了自动化安装脚本，推荐使用 Conda 进行环境隔离。\n\n1.  **克隆仓库并进入目录**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fvggsfm\u002Fvggsfm.git\n    cd vggsfm\n    ```\n\n2.  **运行安装脚本**\n    该脚本会自动创建 Conda 环境并安装所有必要依赖。\n    ```bash\n    source install.sh\n    ```\n\n3.  **安装本地包**\n    ```bash\n    python -m pip install -e .\n    ```\n\n## 基本使用\n\n### 1. 准备数据\n将您的图片放入一个文件夹中，结构如下：\n```text\nYOUR_SCENE_DIR\u002F\n└── images\u002F\n    ├── 0000.png\n    ├── 0001.png\n    └── ...\n```\n*注意：该文件夹下应仅包含图片文件。*\n\n### 2. 运行重建\n首次运行时，程序会自动从 Hugging Face 下载预训练模型（`vggsfm_v2_0_0.bin`）。\n\n**最简单的运行命令（使用示例数据）：**\n```bash\npython demo.py SCENE_DIR=examples\u002Fkitchen\n```\n\n**使用自定义数据：**\n```bash\npython demo.py SCENE_DIR=\u002FYOUR_FOLDER camera_type=SIMPLE_RADIAL gr_visualize=True\n```\n*   `SCENE_DIR`: 指向包含 `images` 子文件夹的根目录。\n*   `camera_type`: 推荐设置为 `SIMPLE_RADIAL` 以适应大多数镜头。\n*   `gr_visualize=True`: 启用 Gradio 网页可视化，生成链接后可在浏览器查看结果（特别适合远程服务器）。\n\n### 3. 查看结果\n重建完成后，结果会自动保存在 `SCENE_DIR\u002Fsparse` 目录下，格式为 COLMAP 标准格式：\n*   `cameras.bin`: 相机参数\n*   `images.bin`: 图像姿态\n*   `points3D.bin`: 稀疏点云\n\n您可以使用以下工具查看：\n*   **COLMAP GUI**: 传统的 SfM 查看器。\n*   **Viser**: 现代化的神经渲染查看器 (`pip install viser`)。\n*   **Web 浏览器**: 如果运行了 `gr_visualize=True`，直接点击终端输出的链接即可。\n\n### 进阶提示\n*   **处理视频\u002F长序列 (>1000 帧)**: 请使用 `video_demo.py` 替代 `demo.py`，它采用滑动窗口机制处理有序帧。\n    ```bash\n    python video_demo.py SCENE_DIR=\u002FYOUR_VIDEO_FOLDER\n    ```\n*   **过滤动态物体**: 若场景中有移动物体，可在 `SCENE_DIR\u002Fmasks` 放置与图片同名的二值掩码（1 为动态区域，0 为静态），程序会自动忽略动态像素。\n*   **生成稠密点云**: 添加参数 `extra_pt_pixel_interval=10 concat_extra_points=True` 可快速三角化更多点，便于后续 Gaussian Splatting 训练。","某考古团队正在对一处动态拍摄的古建筑遗址进行数字化复原，需从手持摄像机拍摄的长视频中重建高精度 3D 模型。\n\n### 没有 vggsfm 时\n- 传统算法难以处理视频中行人和车辆等动态物体，导致重建模型出现大量伪影和空洞。\n- 面对超过 1000 帧的连续视频输入，现有工具计算效率极低，甚至因内存溢出而中途崩溃。\n- 相机姿态估计误差较大，尤其在纹理重复或弱纹理区域，无法生成连贯的空间结构。\n- 仅能获取稀疏点云，缺乏深度细节，无法满足后续高保真渲染或测量分析的需求。\n- 流程繁琐，需人工分段处理视频并手动剔除动态干扰，耗时数天且依赖专家经验。\n\n### 使用 vggsfm 后\n- 利用内置的动态物体掩膜过滤功能，自动识别并排除行人车辆干扰，还原纯净的静态建筑几何结构。\n- 专为序列帧设计的视频运行器轻松支持千帧级输入，高效完成长视频的全程自动化重建。\n- 凭借 CVPR 冠军级的姿态估计能力，在复杂光照和弱纹理下仍能精准锁定相机轨迹，确保模型几何一致性。\n- 直接输出稠密点云与深度图，细节丰富完整，可无缝对接 Gaussian Splatting 进行照片级实时渲染。\n- 一键式流水线大幅降低操作门槛，将原本数天的工作缩短至数小时，让非视觉专家也能独立完成高质量复原。\n\nvggsfm 通过深度融合视觉几何与深度学习，彻底解决了动态场景下长视频 3D 重建的精度与效率难题。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_vggsfm_dfc82efb.png","facebookresearch","Meta Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ffacebookresearch_449342bd.png","",null,"https:\u002F\u002Fopensource.fb.com","https:\u002F\u002Fgithub.com\u002Ffacebookresearch",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",99.8,{"name":88,"color":89,"percentage":90},"Shell","#89e051",0.2,1373,112,"2026-04-04T14:02:42","NOASSERTION","Linux","需要 NVIDIA GPU，支持 CUDA 12.1（安装脚本默认配置），显存需求未明确说明（建议 8GB+ 以处理大规模重建）","未说明",{"notes":99,"python":100,"dependencies":101},"官方提供安装脚本默认创建包含 Python 3.10、PyTorch 2.1 和 CUDA 12.1 的 conda 环境。若无法安装 pytorch3d 可跳过，该库仅用于 Visdom 可视化。首次运行会自动从 Hugging Face 下载预训练模型。处理超过 400 帧的图像序列需使用视频运行器（video_demo.py）。若需生成稠密深度图，需额外克隆并安装 Depth-Anything-V2 依赖。","3.10",[102,103,104,105,106,107,108,109],"torch==2.1","pytorch3d","lightglue","pycolmap","poselib","visdom","scikit-learn","gradio",[15,52,62],"2026-03-27T02:49:30.150509","2026-04-07T10:52:02.046034",[114,119,124,129,134,139],{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},21788,"如何在自己的数据集上运行 VGGSfM 并生成 COLMAP 格式的输出？","项目已升级至 v2 版本，支持在自定义数据上运行。请注意以下关键点：\n1. 图片命名规范：将图片命名为 image_0, image_1...（不要带 .jpg 后缀，尽管文件本身是 jpg 格式）。\n2. 内存优化：v2 版本仅需之前 30%-50% 的显存。\n3. 具体步骤请参考 README 中关于自定义数据的详细说明，后续也会提供针对 mipnerf360 等数据进行高斯泼溅（Gaussian Splatting）的分步教程。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F2",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},21789,"运行 demo.py 时出现 'core dump' 错误怎么办？","这通常是由于 poselib 库的版本不兼容导致的。请尝试以下步骤解决：\n1. 卸载当前版本：pip uninstall poselib\n2. 重新安装指定版本：pip install poselib==2.0.2\n如果问题仍然存在，请检查是否在导入相关模块时即使未安装 poselib 也报错，这可能意味着环境配置有其他冲突。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F16",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},21790,"使用 video_runner 处理自定义视频数据时遇到 'IndexError: index 0 is out of bounds' 错误如何解决？","该错误通常发生在查询帧数量（query frames）设置不当导致索引越界时。解决方案是减少查询帧的数量。例如，如果您有 8 张图像并将窗口大小设为 8，尝试将查询帧数量从 9 减少到 8 或其他较小的值，这通常能解决收敛后的索引错误并提高结果稳定性。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F65",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},21791,"相机预测器（camera_predictor）中的阈值为什么设置为 3000？场景尺度恢复后变得非常大正常吗？","将阈值设置为 3000 主要是为了避免数值稳定性问题。在执行 bundle_adjustment（光束法平差）后，恢复的场景尺度显著变大是预期行为，这是为了保持数值计算的稳定性。只要重建几何结构正确，尺度的绝对大小变化不影响相对位姿的准确性。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F48",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},21792,"VGGSfM 的追踪器（Tracker T）是如何训练的？是否使用了滑动窗口？","VGGSfM 的追踪器训练代码已部分开源（包括 imc, re10k 和 kubric 数据集的代码）。与 CoTracker 不同，VGGSfM 的追踪器设计不假设时间连续性，因此理论上可以避免滑动窗口方法而直接关注所有输入帧。具体的训练配置（如 Kubric 上是否使用 sliding_window=24）需参考已发布的训练代码实现细节。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F21",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},21793,"v2 版本出现 OutOfMemoryError (显存不足) 该如何调整？","v2 版本已优化显存使用。如果遇到显存不足，可以通过调整配置文件中的参数来降低消耗：\n1. 减小 max_points_num（最大点数）。\n2. 减小 max_tri_points_num（最大三角化点数）。\n请参考 README 中的 FAQ 章节获取针对不同 GPU 的具体调整指南。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvggsfm\u002Fissues\u002F63",[]]