[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-cvg--GeoCalib":3,"tool-cvg--GeoCalib":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 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[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":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":84,"forks":85,"last_commit_at":86,"license":87,"difficulty_score":32,"env_os":88,"env_gpu":89,"env_ram":90,"env_deps":91,"category_tags":98,"github_topics":99,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":103,"updated_at":104,"faqs":105,"releases":135},9001,"cvg\u002FGeoCalib","GeoCalib","GeoCalib: Learning Single-image Calibration with Geometric Optimization (ECCV 2024)","GeoCalib 是一款基于深度学习的开源算法，专为单张图像的相机标定而设计。它只需输入一张照片，就能精准估算出相机的内参（如焦距、畸变系数）以及重力方向，无需依赖多视角图像或复杂的标定板。\n\n在传统视觉任务中，获取准确的相机参数往往需要专业设备或多帧数据，这在处理历史照片或单图场景时极具挑战。GeoCalib 巧妙地将几何优化技术与深度学习模型相结合，不仅提升了标定的准确性，还增强了对不同畸变类型的适应能力，有效解决了单图条件下参数估计难的问题。\n\n这款工具非常适合计算机视觉开发者、科研人员以及需要处理图像几何信息的工程师使用。无论是用于三维重建、增强现实，还是摄影测量分析，GeoCalib 都能提供可靠的底层参数支持。其独特的技术亮点在于引入了可微分的几何优化层，让神经网络不仅能“猜测”参数，还能通过几何约束进行自我修正。此外，项目提供了便捷的 Python 接口、Colab 在线演示以及实时摄像头交互功能，让用户能快速上手验证效果，极大地降低了单图标定的使用门槛。","\u003Cp align=\"center\">\n  \u003Ch1 align=\"center\">\u003Cins>GeoCalib\u003C\u002Fins> 📸\u003Cbr>Single-image Calibration with Geometric Optimization\u003C\u002Fh1>\n  \u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Falexander-veicht\u002F\">Alexander Veicht\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fpsarlin.com\u002F\">Paul-Edouard&nbsp;Sarlin\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fphilipplindenberger\u002F\">Philipp Lindenberger\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fresearch\u002Fpeople\u002Fmapoll\u002F\">Marc&nbsp;Pollefeys\u003C\u002Fa>\n  \u003C\u002Fp>\n  \u003Ch2 align=\"center\">\n    \u003Cp>ECCV 2024\u003C\u002Fp>\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2409.06704\" align=\"center\">Paper\u003C\u002Fa> | \n    \u003Ca href=\"https:\u002F\u002Fveichta-geocalib.hf.space\" align=\"center\">Demo 🤗\u003C\u002Fa> | \n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K\" align=\"center\">Colab\u003C\u002Fa> |\n    \u003Ca href=\"https:\u002F\u002Fyoutu.be\u002FuOmTwvKreM4\" align=\"center\">Video\u003C\u002Fa>\n  \u003C\u002Fh2>\n  \n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcvg_GeoCalib_readme_784d26f5a050.gif\" alt=\"example\" width=80%>\u003C\u002Fa> \u003C!--TODO: update link-->\n    \u003Cbr>\n    \u003Cem>\n      GeoCalib accurately estimates the camera intrinsics and gravity direction from a single image \n      \u003Cbr>\n      by combining geometric optimization with deep learning.\n    \u003C\u002Fem>\n\u003C\u002Fp>\n\n##\n\nGeoCalib is an algorithm for single-image calibration: it estimates the camera intrinsics and gravity direction from a single image only. By combining geometric optimization with deep learning, GeoCalib provides a more flexible and accurate calibration compared to previous approaches. This repository hosts the [inference](#setup-and-demo), [evaluation](#evaluation), and [training](#training) code for GeoCalib and instructions to download our training set [OpenPano](#openpano-dataset).\n\n\n## Setup and demo \n\n[![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K)\n[![Hugging Face](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGradio-Demo-blue)](https:\u002F\u002Fveichta-geocalib.hf.space)\n\nWe provide a small inference package [`geocalib`](geocalib) that requires only minimal dependencies and Python >= 3.9. First clone the repository and install the dependencies:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib.git && cd GeoCalib\npython -m pip install -e .\n# OR\npython -m pip install -e \"git+https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib#egg=geocalib\"\n```\n\nHere is a minimal usage example:\n\n```python\nimport torch\nfrom geocalib import GeoCalib\n\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel = GeoCalib().to(device)\n\n# load image as tensor in range [0, 1] with shape [C, H, W]\nimage = model.load_image(\"path\u002Fto\u002Fimage.jpg\").to(device)\nresult = model.calibrate(image)\n\nprint(\"camera:\", result[\"camera\"])\nprint(\"gravity:\", result[\"gravity\"])\n```\n\nCheck out our [demo notebook](demo.ipynb) for a full working example.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>[Interactive demo for your webcam - click to expand]\u003C\u002Fb>\u003C\u002Fsummary>\nRun the following command:\n  \n```bash\npython -m geocalib.interactive_demo --camera_id 0\n```\n\nThe demo will open a window showing the camera feed and the calibration results. If `--camera_id` is not provided, the demo will ask for the IP address of a [droidcam](https:\u002F\u002Fdroidcam.app) camera.\n\nControls:\n\n>Toggle the different features using the following keys:\n>\n>- ```h```: Show the estimated horizon line\n>- ```u```: Show the estimated up-vectors\n>- ```l```: Show the estimated latitude heatmap\n>- ```c```: Show the confidence heatmap for the up-vectors and latitudes\n>- ```d```: Show undistorted image, will overwrite the other features\n>- ```g```: Shows a virtual grid of points\n>- ```b```: Shows a virtual box object\n>\n>Change the camera model using the following keys:\n>\n>- ```1```: Pinhole -> Simple and fast\n>- ```2```: Simple Radial -> For small distortions\n>- ```3```: Simple Divisional -> For large distortions\n>\n>Press ```q``` to quit the demo.\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>[Load GeoCalib with torch hub - click to expand]\u003C\u002Fb>\u003C\u002Fsummary>\n\n```python\nmodel = torch.hub.load(\"cvg\u002FGeoCalib\", \"GeoCalib\", trust_repo=True)\n```\n\n\u003C\u002Fdetails>\n\n### Camera models\nGeoCalib currently supports the following camera models via the `camera_model` parameter:\n1. `pinhole` (default) models only the focal lengths `fx` and `fy` but no lens distortion.\n2. `simple_radial` models weak distortions with a single polynomial distortion parameter `k1`.\n3. `radial` models stronger distortions with polynomial distortion parameters `k1`, `k2` (thanks to [RuibinMa #25](https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fpull\u002F25)).\n4. `simple_divisional` models strong fisheye distortions with a single distortion parameter `k1`, as proposed by Fitzgibbon in [_Simultaneous linear estimation of multiple view geometry and lens distortion_](https:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fpublications\u002F2001\u002FFitzgibbon01b\u002Ffitzgibbon01b.pdf) (CVPR 2001).\n\nThe default model is optimized for pinhole images. To handle lens distortion, use the following:\n```python\nmodel = GeoCalib(weights=\"distorted\")  # default is \"pinhole\"\nresult = model.calibrate(image, camera_model=\"simple_radial\")  # or pinhole, simple_divisional\n```\nThe principal point is assumed to be at the center of the image and is not optimized. Additional models can be implemented by extending the [`Camera`](geocalib\u002Fcamera.py) object.\n\n### Partial calibration\nWhen either the intrinsics or the gravity are already known, they can be provided as follows:\n\n```python\n# known intrinsics:\nresult = model.calibrate(image, priors={\"focal\": focal_length_tensor})\n\n# known gravity:\nresult = model.calibrate(image, priors={\"gravity\": gravity_direction_tensor})\n```\n\n### Multi-image calibration\nTo calibrate multiple images captured by the same camera, pass a list of images to GeoCalib:\n```python\n# batch is a list of tensors, each with shape [C, H, W]\nresult = model.calibrate(batch, shared_intrinsics=True)\n```\n\n## Evaluation\n\nThe full evaluation and training code is provided in the single-image calibration library [`siclib`](siclib), which can be installed as:\n```bash\npython -m pip install -e siclib\n```\n\nRunning the evaluation commands will write the results to `outputs\u002Fresults\u002F`.\n\n### LaMAR\n\nRunning the evaluation commands will download the dataset to ```data\u002Flamar2k``` which will take around 400 MB of disk space.\n\n\u003Cdetails>\n\u003Csummary>[Evaluate GeoCalib]\u003C\u002Fsummary>\n\nTo evaluate GeoCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.lamar2k --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate DeepCalib]\u003C\u002Fsummary>\n\nTo evaluate DeepCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.lamar2k --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate Perspective Fields]\u003C\u002Fsummary>\n\nTo evaluate Perspective Fields, first setup the files following the instructions in the [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) repository. Then run:\n\n```bash\npython -m siclib.eval.lamar2k --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\nTo evaluate the model trained on our OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.lamar2k --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate UVP]\u003C\u002Fsummary>\n\nTo evaluate UVP, install the [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity) under ```third_party\u002FVP-Estimation-with-Prior-Gravity```. Then run:\n\n```bash\npython -m siclib.eval.lamar2k --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate your own model]\u003C\u002Fsummary>\n\nIf you have trained your own model, you can evaluate it by running:\n\n```bash\npython -m siclib.eval.lamar2k --checkpoint \u003Cexperiment name> --tag \u003Ceval name> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>[Results]\u003C\u002Fsummary>\n\nHere are the results for the Area Under the Curve (AUC) for the roll, pitch and field of view (FoV) errors at 1\u002F5\u002F10 degrees for the different methods:\n\n| Approach            | Roll               | Pitch              | FoV                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 44.1 \u002F 73.9 \u002F 84.8 | 10.8 \u002F 28.3 \u002F 49.8 | 00.7 \u002F 13.0 \u002F 24.0 |\n| ParamNet            | 38.7 \u002F 69.4 \u002F 82.8 | 19.0 \u002F 44.7 \u002F 65.7 | 01.8 \u002F 06.2 \u002F 13.2 |\n| ParamNet (OpenPano) | 51.7 \u002F 77.0 \u002F 86.0 | 27.0 \u002F 52.7 \u002F 70.2 | 02.8 \u002F 06.8 \u002F 14.3 |\n| UVP                 | 72.7 \u002F 81.8 \u002F 85.7 | 42.3 \u002F 59.9 \u002F 69.4 | 15.6 \u002F 30.6 \u002F 43.5 |\n| GeoCalib            | 86.4 \u002F 92.5 \u002F 95.0 | 55.0 \u002F 76.9 \u002F 86.2 | 19.1 \u002F 41.5 \u002F 60.0 |\n\u003C\u002Fdetails>\n\n### MegaDepth\n\nRunning the evaluation commands will download the dataset to ```data\u002Fmegadepth2k``` or ```data\u002Fmemegadepth2k-radial``` which will take around 2.1 GB and 1.47 GB of disk space respectively.\n\n\u003Cdetails>\n\u003Csummary>[Evaluate GeoCalib]\u003C\u002Fsummary>\n\nTo evaluate GeoCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.megadepth2k --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\nTo run the eval on the radial distorted images, run:\n\n```bash\npython -m siclib.eval.megadepth2k_radial --conf geocalib-pinhole --tag geocalib --overwrite model.camera_model=simple_radial\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate DeepCalib]\u003C\u002Fsummary>\n\nTo evaluate DeepCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.megadepth2k --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate Perspective Fields]\u003C\u002Fsummary>\n\nTo evaluate Perspective Fields, first setup the files following the instructions in the [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) repository. Then run:\n\n```bash\npython -m siclib.eval.megadepth2k --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\nTo evaluate the model trained on our OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.megadepth2k --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate UVP]\u003C\u002Fsummary>\n\nTo evaluate UVP, install the [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity) under ```third_party\u002FVP-Estimation-with-Prior-Gravity```. Then run:\n\n```bash\npython -m siclib.eval.megadepth2k --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate your own model]\u003C\u002Fsummary>\n\nIf you have trained your own model, you can evaluate it by running:\n\n```bash\npython -m siclib.eval.megadepth2k --checkpoint \u003Cexperiment name> --tag \u003Ceval name> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Results]\u003C\u002Fsummary>\n\nHere are the results for the Area Under the Curve (AUC) for the roll, pitch and field of view (FoV) errors at 1\u002F5\u002F10 degrees for the different methods:\n\n| Approach            | Roll               | Pitch              | FoV                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 34.6 \u002F 65.4 \u002F 79.4 | 11.9 \u002F 27.8 \u002F 44.8 | 5.6 \u002F 12.1 \u002F 22.9  |\n| ParamNet            | 37.0 \u002F 66.4 \u002F 80.8 | 15.8 \u002F 37.3 \u002F 57.1 | 5.3 \u002F 12.8 \u002F 24.0  |\n| ParamNet (OpenPano) | 43.4 \u002F 70.7 \u002F 82.2 | 15.4 \u002F 34.5 \u002F 53.3 | 3.2 \u002F 10.1 \u002F 21.3  |\n| UVP                 | 69.2 \u002F 81.6 \u002F 86.9 | 21.6 \u002F 36.2 \u002F 47.4 | 8.2 \u002F 18.7 \u002F 29.8  |\n| GeoCalib            | 82.6 \u002F 90.6 \u002F 94.0 | 32.4 \u002F 53.3 \u002F 67.5 | 13.6 \u002F 31.7 \u002F 48.2 |\n\u003C\u002Fdetails>\n\n### TartanAir\n\nRunning the evaluation commands will download the dataset to ```data\u002Ftartanair``` which will take around 1.85 GB of disk space.\n\n\u003Cdetails>\n\u003Csummary>[Evaluate GeoCalib]\u003C\u002Fsummary>\n\nTo evaluate GeoCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.tartanair --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate DeepCalib]\u003C\u002Fsummary>\n\nTo evaluate DeepCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.tartanair --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate Perspective Fields]\u003C\u002Fsummary>\n\nTo evaluate Perspective Fields, first setup the files following the instructions in the [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) repository. Then run:\n\n```bash\npython -m siclib.eval.tartanair --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\nTo evaluate the model trained on our OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.tartanair --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate UVP]\u003C\u002Fsummary>\n\nTo evaluate UVP, install the [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity) under ```third_party\u002FVP-Estimation-with-Prior-Gravity```. Then run:\n\n```bash\npython -m siclib.eval.tartanair --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate your own model]\u003C\u002Fsummary>\n\nIf you have trained your own model, you can evaluate it by running:\n\n```bash\npython -m siclib.eval.tartanair --checkpoint \u003Cexperiment name> --tag \u003Ceval name> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Results]\u003C\u002Fsummary>\n\nHere are the results for the Area Under the Curve (AUC) for the roll, pitch and field of view (FoV) errors at 1\u002F5\u002F10 degrees for the different methods:\n\n| Approach            | Roll               | Pitch              | FoV                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 24.7 \u002F 55.4 \u002F 71.5 | 16.3 \u002F 38.8 \u002F 58.5 | 01.5 \u002F 08.8 \u002F 27.2 |\n| ParamNet            | 23.3 \u002F 51.4 \u002F 71.0 | 19.9 \u002F 43.8 \u002F 62.9 | 08.5 \u002F 22.5 \u002F 40.8 |\n| ParamNet (OpenPano) | 34.5 \u002F 59.2 \u002F 73.9 | 19.4 \u002F 42.0 \u002F 60.3 | 06.0 \u002F 16.8 \u002F 31.6 |\n| UVP                 | 52.1 \u002F 64.8 \u002F 71.9 | 36.2 \u002F 48.8 \u002F 58.6 | 15.8 \u002F 25.8 \u002F 35.7 |\n| GeoCalib            | 71.3 \u002F 83.8 \u002F 89.8 | 38.2 \u002F 62.9 \u002F 76.6 | 14.1 \u002F 30.4 \u002F 47.6 |\n\u003C\u002Fdetails>\n\n### Stanford2D3D\n\nBefore downloading and running the evaluation, you will need to agree to the [terms of use](https:\u002F\u002Fdocs.google.com\u002Fforms\u002Fd\u002Fe\u002F1FAIpQLScFR0U8WEUtb7tgjOhhnl31OrkEs73-Y8bQwPeXgebqVKNMpQ\u002Fviewform?c=0&w=1) for the Stanford2D3D dataset.\nRunning the evaluation commands will download the dataset to ```data\u002Fstanford2d3d``` which will take around 885 MB of disk space.\n\n\u003Cdetails>\n\u003Csummary>[Evaluate GeoCalib]\u003C\u002Fsummary>\n\nTo evaluate GeoCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.stanford2d3d --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate DeepCalib]\u003C\u002Fsummary>\n\nTo evaluate DeepCalib trained on the OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.stanford2d3d --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate Perspective Fields]\u003C\u002Fsummary>\n\nTo evaluate Perspective Fields, first setup the files following the instructions in the [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) repository. Then run:\n\n```bash\npython -m siclib.eval.stanford2d3d --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\nTo evaluate the model trained on our OpenPano dataset, run:\n\n```bash\npython -m siclib.eval.stanford2d3d --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate UVP]\u003C\u002Fsummary>\n\nTo evaluate UVP, install the [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity) under ```third_party\u002FVP-Estimation-with-Prior-Gravity```. Then run:\n\n```bash\npython -m siclib.eval.stanford2d3d --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Evaluate your own model]\u003C\u002Fsummary>\n\nIf you have trained your own model, you can evaluate it by running:\n\n```bash\npython -m siclib.eval.stanford2d3d --checkpoint \u003Cexperiment name> --tag \u003Ceval name> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Results]\u003C\u002Fsummary>\n\nHere are the results for the Area Under the Curve (AUC) for the roll, pitch and field of view (FoV) errors at 1\u002F5\u002F10 degrees for the different methods:\n\n| Approach            | Roll               | Pitch              | FoV                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 33.8 \u002F 63.9 \u002F 79.2 | 21.6 \u002F 46.9 \u002F 65.7 | 08.1 \u002F 20.6 \u002F 37.6 |\n| ParamNet            | 20.6 \u002F 48.5 \u002F 68.1 | 20.9 \u002F 44.2 \u002F 61.5 | 07.4 \u002F 18.0 \u002F 33.2 |\n| ParamNet (OpenPano) | 44.6 \u002F 73.9 \u002F 84.8 | 29.2 \u002F 56.7 \u002F 73.1 | 05.8 \u002F 14.3 \u002F 27.8 |\n| UVP                 | 65.3 \u002F 74.6 \u002F 79.1 | 51.2 \u002F 63.0 \u002F 69.2 | 22.2 \u002F 39.5 \u002F 51.3 |\n| GeoCalib            | 83.1 \u002F 91.8 \u002F 94.8 | 52.3 \u002F 74.8 \u002F 84.6 | 17.4 \u002F 40.0 \u002F 59.4 |\n\n\u003C\u002Fdetails>\n\n### Evaluation options\n\nIf you want to provide priors during the evaluation, you can add one or multiple of the following flags:\n\n```bash\npython -m siclib.eval.\u003Cbenchmark> --conf \u003Cconfig> \\\n    --tag \u003Ctag> \\\n    data.use_prior_focal=true \\\n    data.use_prior_gravity=true \\\n    data.use_prior_k1=true\n```\n\n\u003Cdetails>\n\u003Csummary>[Visual inspection]\u003C\u002Fsummary>\n\nTo visually inspect the results of the evaluation, you can run the following command:\n\n```bash\npython -m siclib.eval.inspect \u003Cbenchmark> \u003Cone or multiple tags>\n\n```\nFor example, to inspect the results of the evaluation of the GeoCalib model on the LaMAR dataset, you can run:\n```bash\npython -m siclib.eval.inspect lamar2k geocalib\n```\n\u003C\u002Fdetails>\n\n## OpenPano Dataset\n\nThe OpenPano dataset is a new dataset for single-image calibration which contains about 2.8k panoramas from various sources, namely [HDRMAPS](https:\u002F\u002Fhdrmaps.com\u002Fhdris\u002F), [PolyHaven](https:\u002F\u002Fpolyhaven.com\u002Fhdris), and the [Laval Photometric Indoor HDR dataset](http:\u002F\u002Fhdrdb.com\u002Findoor-hdr-photometric\u002F). While this dataset is smaller than previous ones, it is publicly available and it provides a better balance between indoor and outdoor scenes.\n\n\u003Cdetails>\n\u003Csummary>[Downloading and preparing the dataset]\u003C\u002Fsummary>\n\nIn order to assemble the training set, first download the Laval dataset following the instructions on [the corresponding project page](http:\u002F\u002Fhdrdb.com\u002Findoor-hdr-photometric\u002F) and place the panoramas in ```data\u002FindoorDatasetCalibrated```. Then, tonemap the HDR images using the following command:\n\n```bash\npython -m siclib.datasets.utils.tonemapping --hdr_dir data\u002FindoorDatasetCalibrated --out_dir data\u002Flaval-tonemap\n```\n\nWe provide a script to download the PolyHaven and HDRMAPS panos. The script will create folders ```data\u002Fopenpano\u002Fpanoramas\u002F{split}``` containing the panoramas specified by the ```{split}_panos.txt``` files. To run the script, execute the following commands:\n\n```bash\npython -m siclib.datasets.utils.download_openpano --name openpano --laval_dir data\u002Flaval-tonemap\n```\nAlternatively, you can download the PolyHaven and HDRMAPS panos from [here](https:\u002F\u002Fpolybox.ethz.ch\u002Findex.php\u002Fs\u002FXK4oM1l6ZqSIXw9).\n\u003C!-- Alternatively, you can download the PolyHaven and HDRMAPS panos from [here](https:\u002F\u002Fcvg-data.inf.ethz.ch\u002FGeoCalib_ECCV2024\u002F). -->\n\n\nAfter downloading the panoramas, you can create the training set by running the following command:\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano\n```\n\nThe dataset creation can be sped up by using multiple workers and a GPU. To do so, add the following arguments to the command:\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano n_workers=10 device=cuda\n```\n\nThis will create the training set in ```data\u002Fopenpano\u002Fopenpano``` with about 37k images for training, 2.1k for validation, and 2.1k for testing.\n\n\u003Cdetails>\n\u003Csummary>[Distorted OpenPano]\u003C\u002Fsummary>\n\nTo create the OpenPano dataset with radial distortion, run the following command:\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano_radial\n```\n\n\u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n## Training\n\nAs for the evaluation, the training code is provided in the single-image calibration library [`siclib`](siclib), which can be installed by:\n\n```bash\npython -m pip install -e siclib\n```\n\nOnce the [OpenPano Dataset](#openpano-dataset) has been downloaded and prepared, we can train GeoCalib with it:\n\nFirst download the pre-trained weights for the [MSCAN-B](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fc15b25a6745946618462\u002F) backbone:\n\n```bash\nmkdir weights\nwget \"https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fc15b25a6745946618462\u002Ffiles\u002F?p=%2Fmscan_b.pth&dl=1\" -O weights\u002Fmscan_b.pth\n```\n\nThen, start the training with the following command:\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano --conf geocalib --distributed\n```\n\nFeel free to use any other experiment name. By default, the checkpoints will be written to ```outputs\u002Ftraining\u002F```. The default batch size is 24 which requires 2x 4090 GPUs with 24GB of VRAM each. Configurations are managed by [Hydra](https:\u002F\u002Fhydra.cc\u002F) and can be overwritten from the command line.\nFor example, to train GeoCalib on a single GPU with a batch size of 5, run:\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano \\\n    --conf geocalib \\\n    data.train_batch_size=5 # for 1x 2080 GPU\n```\n\nBe aware that this can impact the overall performance. You might need to adjust the learning rate and number of training steps accordingly.\n\nIf you want to log the training progress to [tensorboard](https:\u002F\u002Fwww.tensorflow.org\u002Ftensorboard) or [wandb](https:\u002F\u002Fwandb.ai\u002F), you can set the ```train.writer``` option:\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano \\\n    --conf geocalib \\\n    --distributed \\\n    train.writer=tensorboard\n```\n\nThe model can then be evaluated using its experiment name:\n\n```bash\npython -m siclib.eval.\u003Cbenchmark> --checkpoint geocalib-pinhole-openpano \\\n    --tag geocalib-retrained\n```\n\n\u003Cdetails>\n\u003Csummary>[Training DeepCalib]\u003C\u002Fsummary>\n\nTo train DeepCalib on the OpenPano dataset, run:\n\n```bash\npython -m siclib.train deepcalib-openpano --conf deepcalib --distributed\n```\n\nMake sure that you have generated the [OpenPano Dataset](#openpano-dataset) with radial distortion or add\nthe flag ```data=openpano``` to the command to train on the pinhole images.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[Training Perspective Fields]\u003C\u002Fsummary>\n\nTo train Perspective Fields, first setup the files following the instructions in the [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) repository. Then run:\n\nFirst train the perspective network:\n\n```bash\npython -m siclib.train perspective-net --conf perspective-net --distributed\n```\n\nThen put the trained weights in the ```weights\u002Fpersnet-pano-old.tar``` file and train the full model:\n\n```bash\npython -m siclib.train param-net --conf param-net --distributed\n```\n\n\u003C\u002Fdetails>\n\n## BibTeX citation\n\nIf you use any ideas from the paper or code from this repo, please consider citing:\n\n```bibtex\n@inproceedings{veicht2024geocalib,\n  author    = {Alexander Veicht and\n               Paul-Edouard Sarlin and\n               Philipp Lindenberger and\n               Marc Pollefeys},\n  title     = {{GeoCalib: Single-image Calibration with Geometric Optimization}},\n  booktitle = {ECCV},\n  year      = {2024}\n}\n```\n\n## License\n\nThe code is provided under the [Apache-2.0 License](LICENSE) while the weights of the trained model are provided under the [Creative Commons Attribution 4.0 International Public License](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode). Thanks to the authors of the [Laval Indoor HDR dataset](http:\u002F\u002Fhdrdb.com\u002Findoor\u002F#presentation) for allowing this.\n\n","\u003Cp align=\"center\">\n  \u003Ch1 align=\"center\">\u003Cins>GeoCalib\u003C\u002Fins> 📸\u003Cbr>基于几何优化的单张图像标定\u003C\u002Fh1>\n  \u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Falexander-veicht\u002F\">Alexander Veicht\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fpsarlin.com\u002F\">Paul-Edouard&nbsp;Sarlin\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fphilipplindenberger\u002F\">Philipp Lindenberger\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fresearch\u002Fpeople\u002Fmapoll\u002F\">Marc&nbsp;Pollefeys\u003C\u002Fa>\n  \u003C\u002Fp>\n  \u003Ch2 align=\"center\">\n    \u003Cp>ECCV 2024\u003C\u002Fp>\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2409.06704\" align=\"center\">论文\u003C\u002Fa> | \n    \u003Ca href=\"https:\u002F\u002Fveichta-geocalib.hf.space\" align=\"center\">Demo 🤗\u003C\u002Fa> | \n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K\" align=\"center\">Colab\u003C\u002Fa> |\n    \u003Ca href=\"https:\u002F\u002Fyoutu.be\u002FuOmTwvKreM4\" align=\"center\">视频\u003C\u002Fa>\n  \u003C\u002Fh2>\n  \n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcvg_GeoCalib_readme_784d26f5a050.gif\" alt=\"example\" width=80%>\u003C\u002Fa> \u003C!--TODO: update link-->\n    \u003Cbr>\n    \u003Cem>\n      GeoCalib通过将几何优化与深度学习相结合，能够从单张图像中精确估计相机内参和重力方向。\n    \u003C\u002Fem>\n\u003C\u002Fp>\n\n##\n\nGeoCalib是一种用于单张图像标定的算法：它仅需一张图像即可估计相机内参和重力方向。通过结合几何优化与深度学习，GeoCalib相比以往的方法提供了更灵活、更准确的标定结果。本仓库包含了GeoCalib的[推理](#setup-and-demo)、[评估](#evaluation)和[训练](#training)代码，以及下载我们的训练数据集[OpenPano](#openpano-dataset)的说明。\n\n\n\n## 设置与演示\n\n[![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K)\n[![Hugging Face](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGradio-Demo-blue)](https:\u002F\u002Fveichta-geocalib.hf.space)\n\n我们提供了一个小型的推理包[`geocalib`](geocalib)，它只需要极少的依赖项和Python >= 3.9。首先克隆仓库并安装依赖：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib.git && cd GeoCalib\npython -m pip install -e .\n# 或者\npython -m pip install -e \"git+https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib#egg=geocalib\"\n```\n\n以下是一个最小使用示例：\n\n```python\nimport torch\nfrom geocalib import GeoCalib\n\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel = GeoCalib().to(device)\n\n# 加载图像为范围 [0, 1] 的张量，形状为 [C, H, W]\nimage = model.load_image(\"path\u002Fto\u002Fimage.jpg\").to(device)\nresult = model.calibrate(image)\n\nprint(\"camera:\", result[\"camera\"])\nprint(\"gravity:\", result[\"gravity\"])\n```\n\n请查看我们的[演示笔记本](demo.ipynb)，以获取完整的运行示例。\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>[针对你的摄像头的交互式演示 - 点击展开]\u003C\u002Fb>\u003C\u002Fsummary>\n运行以下命令：\n  \n```bash\npython -m geocalib.interactive_demo --camera_id 0\n```\n\n演示会打开一个窗口，显示摄像头画面和标定结果。如果未提供`--camera_id`，演示会提示输入[droidcam](https:\u002F\u002Fdroidcam.app)摄像头的IP地址。\n\n控制方式：\n\n> 使用以下按键切换不同的功能：\n>\n>- ```h```: 显示估计的地平线\n>- ```u```: 显示估计的向上向量\n>- ```l```: 显示估计的纬度热图\n>- ```c```: 显示向上向量和纬度的置信度热图\n>- ```d```: 显示去畸变后的图像，会覆盖其他功能\n>- ```g```: 显示虚拟网格点\n>- ```b```: 显示虚拟盒子物体\n>\n> 使用以下按键更改相机模型：\n>\n>- ```1```: 小孔模型 -> 简单快速\n>- ```2```: 简单径向模型 -> 适用于小畸变\n>- ```3```: 简单分割模型 -> 适用于大畸变\n>\n> 按下```q```退出演示。\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>[使用torch hub加载GeoCalib - 点击展开]\u003C\u002Fb>\u003C\u002Fsummary>\n\n```python\nmodel = torch.hub.load(\"cvg\u002FGeoCalib\", \"GeoCalib\", trust_repo=True)\n```\n\n\u003C\u002Fdetails>\n\n### 相机模型\nGeoCalib目前通过`camera_model`参数支持以下相机模型：\n1. `pinhole`（默认）仅建模焦距`fx`和`fy`，不考虑镜头畸变。\n2. `simple_radial`用单个多项式畸变参数`k1`建模弱畸变。\n3. `radial`用多项式畸变参数`k1`、`k2`建模较强畸变（感谢[RuibinMa #25](https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fpull\u002F25)）。\n4. `simple_divisional`按照Fitzgibbon在[_Simultaneous linear estimation of multiple view geometry and lens distortion_](https:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fpublications\u002F2001\u002FFitzgibbon01b\u002Ffitzgibbon01b.pdf)（CVPR 2001）的建议，用单个畸变参数`k1`建模强鱼眼畸变。\n\n默认模型针对小孔图像进行了优化。若需处理镜头畸变，请使用以下方法：\n```python\nmodel = GeoCalib(weights=\"distorted\")  # 默认是“pinhole”\nresult = model.calibrate(image, camera_model=\"simple_radial\")  # 或 pinhole、simple_divisional\n```\n\n主点被假定位于图像中心，且不会被优化。可以通过扩展[`Camera`](geocalib\u002Fcamera.py)对象来实现更多模型。\n\n### 部分标定\n当内参或重力方向已知时，可以按如下方式提供先验信息：\n\n```python\n# 已知内参：\nresult = model.calibrate(image, priors={\"focal\": focal_length_tensor})\n\n# 已知重力方向：\nresult = model.calibrate(image, priors={\"gravity\": gravity_direction_tensor})\n```\n\n### 多图像标定\n要标定由同一台相机拍摄的多张图像，可以将图像列表传递给GeoCalib：\n```python\n# batch 是一个张量列表，每个张量的形状为 [C, H, W]\nresult = model.calibrate(batch，shared_intrinsics=True）\n```\n\n## 评估\n\n完整的评估和训练代码包含在单张图像标定库[`siclib`](siclib)中，可通过以下方式安装：\n```bash\npython -m pip install -e siclib\n```\n\n运行评估命令后，结果将被写入`outputs\u002Fresults\u002F`目录。\n\n### LaMAR\n\n运行评估命令会将数据集下载到 ```data\u002Flamar2k``` 目录下，大约需要 400 MB 的磁盘空间。\n\n\u003Cdetails>\n\u003Csummary>[评估 GeoCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 GeoCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.lamar2k --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 DeepCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 DeepCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.lamar2k --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 Perspective Fields]\u003C\u002Fsummary>\n\n要评估 Perspective Fields 模型，首先按照 [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) 仓库中的说明设置文件。然后运行：\n\n```bash\npython -m siclib.eval.lamar2k --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\n要评估在我们的 OpenPano 数据集上训练的模型，请运行：\n\n```bash\npython -m siclib.eval.lamar2k --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 UVP]\u003C\u002Fsummary>\n\n要评估 UVP 模型，需先在 ```third_party\u002FVP-Estimation-with-Prior-Gravity``` 目录下安装 [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity)。然后运行：\n\n```bash\npython -m siclib.eval.lamar2k --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估您自己的模型]\u003C\u002Fsummary>\n\n如果您训练了自己的模型，可以通过以下命令进行评估：\n\n```bash\npython -m siclib.eval.lamar2k --checkpoint \u003C实验名称> --tag \u003C评估名称> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>[结果]\u003C\u002Fsummary>\n\n以下是不同方法在滚转、俯仰和视场角（FoV）误差方面，于 1\u002F5\u002F10 度阈值下的曲线下面积（AUC）结果：\n\n| 方法            | 滚转               | 俯仰              | 视场角                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 44.1 \u002F 73.9 \u002F 84.8 | 10.8 \u002F 28.3 \u002F 49.8 | 00.7 \u002F 13.0 \u002F 24.0 |\n| ParamNet            | 38.7 \u002F 69.4 \u002F 82.8 | 19.0 \u002F 44.7 \u002F 65.7 | 01.8 \u002F 06.2 \u002F 13.2 |\n| ParamNet (OpenPano) | 51.7 \u002F 77.0 \u002F 86.0 | 27.0 \u002F 52.7 \u002F 70.2 | 02.8 \u002F 06.8 \u002F 14.3 |\n| UVP                 | 72.7 \u002F 81.8 \u002F 85.7 | 42.3 \u002F 59.9 \u002F 69.4 | 15.6 \u002F 30.6 \u002F 43.5 |\n| GeoCalib            | 86.4 \u002F 92.5 \u002F 95.0 | 55.0 \u002F 76.9 \u002F 86.2 | 19.1 \u002F 41.5 \u002F 60.0 |\n\u003C\u002Fdetails>\n\n### MegaDepth\n\n运行评估命令会将数据集下载到 ```data\u002Fmegadepth2k``` 或 ```data\u002Fmemegadepth2k-radial``` 目录下，分别需要约 2.1 GB 和 1.47 GB 的磁盘空间。\n\n\u003Cdetails>\n\u003Csummary>[评估 GeoCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 GeoCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.megadepth2k --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n若要在径向畸变图像上运行评估，则执行以下命令：\n\n```bash\npython -m siclib.eval.megadepth2k_radial --conf geocalib-pinhole --tag geocalib --overwrite model.camera_model=simple_radial\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 DeepCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 DeepCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.megadepth2k --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 Perspective Fields]\u003C\u002Fsummary>\n\n要评估 Perspective Fields 模型，首先按照 [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) 仓库中的说明设置文件。然后运行：\n\n```bash\npython -m siclib.eval.megadepth2k --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\n要评估在我们的 OpenPano 数据集上训练的模型，请运行：\n\n```bash\npython -m siclib.eval.megadepth2k --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 UVP]\u003C\u002Fsummary>\n\n要评估 UVP 模型，需先在 ```third_party\u002FVP-Estimation-with-Prior-Gravity``` 目录下安装 [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity)。然后运行：\n\n```bash\npython -m siclib.eval.megadepth2k --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估您自己的模型]\u003C\u002Fsummary>\n\n如果您训练了自己的模型，可以通过以下命令进行评估：\n\n```bash\npython -m siclib.eval.megadepth2k --checkpoint \u003C实验名称> --tag \u003C评估名称> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[结果]\u003C\u002Fsummary>\n\n以下是不同方法在滚转、俯仰和视场角（FoV）误差方面，于 1\u002F5\u002F10 度阈值下的曲线下面积（AUC）结果：\n\n| 方法            | 滚转               | 俯仰              | 视场角                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 34.6 \u002F 65.4 \u002F 79.4 | 11.9 \u002F 27.8 \u002F 44.8 | 5.6 \u002F 12.1 \u002F 22.9  |\n| ParamNet            | 37.0 \u002F 66.4 \u002F 80.8 | 15.8 \u002F 37.3 \u002F 57.1 | 5.3 \u002F 12.8 \u002F 24.0  |\n| ParamNet (OpenPano) | 43.4 \u002F 70.7 \u002F 82.2 | 15.4 \u002F 34.5 \u002F 53.3 | 3.2 \u002F 10.1 \u002F 21.3  |\n| UVP                 | 69.2 \u002F 81.6 \u002F 86.9 | 21.6 \u002F 36.2 \u002F 47.4 | 8.2 \u002F 18.7 \u002F 29.8  |\n| GeoCalib            | 82.6 \u002F 90.6 \u002F 94.0 | 32.4 \u002F 53.3 \u002F 67.5 | 13.6 \u002F 31.7 \u002F 48.2 |\n\u003C\u002Fdetails>\n\n### TartanAir\n\n运行评估命令会将数据集下载到 ```data\u002Ftartanair``` 目录下，大约需要 1.85 GB 的磁盘空间。\n\n\u003Cdetails>\n\u003Csummary>[评估 GeoCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 GeoCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.tartanair --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 DeepCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 DeepCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.tartanair --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 Perspective Fields]\u003C\u002Fsummary>\n\n要评估 Perspective Fields 模型，首先请按照 [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) 仓库中的说明设置文件。然后运行：\n\n```bash\npython -m siclib.eval.tartanair --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\n要评估在我们的 OpenPano 数据集上训练的模型，请运行：\n\n```bash\npython -m siclib.eval.tartanair --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 UVP]\u003C\u002Fsummary>\n\n要评估 UVP 模型，请先在 ```third_party\u002FVP-Estimation-with-Prior-Gravity``` 目录下安装 [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity)。然后运行：\n\n```bash\npython -m siclib.eval.tartanair --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估您自己的模型]\u003C\u002Fsummary>\n\n如果您训练了自己的模型，可以通过以下命令进行评估：\n\n```bash\npython -m siclib.eval.tartanair --checkpoint \u003C实验名称> --tag \u003C评估名称> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[结果]\u003C\u002Fsummary>\n\n以下是不同方法在滚转、俯仰和视场角（FoV）误差方面，于 1\u002F5\u002F10 度下的曲线下面积（AUC）结果：\n\n| 方法            | 滚转               | 俯仰              | 视场角                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 24.7 \u002F 55.4 \u002F 71.5 | 16.3 \u002F 38.8 \u002F 58.5 | 01.5 \u002F 08.8 \u002F 27.2 |\n| ParamNet            | 23.3 \u002F 51.4 \u002F 71.0 | 19.9 \u002F 43.8 \u002F 62.9 | 08.5 \u002F 22.5 \u002F 40.8 |\n| ParamNet (OpenPano) | 34.5 \u002F 59.2 \u002F 73.9 | 19.4 \u002F 42.0 \u002F 60.3 | 06.0 \u002F 16.8 \u002F 31.6 |\n| UVP                 | 52.1 \u002F 64.8 \u002F 71.9 | 36.2 \u002F 48.8 \u002F 58.6 | 15.8 \u002F 25.8 \u002F 35.7 |\n| GeoCalib            | 71.3 \u002F 83.8 \u002F 89.8 | 38.2 \u002F 62.9 \u002F 76.6 | 14.1 \u002F 30.4 \u002F 47.6 |\n\n\u003C\u002Fdetails>\n\n### Stanford2D3D\n\n在下载并运行评估之前，您需要同意 Stanford2D3D 数据集的 [使用条款](https:\u002F\u002Fdocs.google.com\u002Fforms\u002Fd\u002Fe\u002F1FAIpQLScFR0U8WEUtb7tgjOhhnl31OrkEs73-Y8bQwPeXgebqVKNMpQ\u002Fviewform?c=0&w=1)。运行评估命令会将数据集下载到 ```data\u002Fstanford2d3d``` 目录下，大约需要 885 MB 的磁盘空间。\n\n\u003Cdetails>\n\u003Csummary>[评估 GeoCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 GeoCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.stanford2d3d --conf geocalib-pinhole --tag geocalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 DeepCalib]\u003C\u002Fsummary>\n\n要评估在 OpenPano 数据集上训练的 DeepCalib 模型，请运行：\n\n```bash\npython -m siclib.eval.stanford2d3d --conf deepcalib --tag deepcalib --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 Perspective Fields]\u003C\u002Fsummary>\n\n要评估 Perspective Fields 模型，首先请按照 [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) 仓库中的说明设置文件。然后运行：\n\n```bash\npython -m siclib.eval.stanford2d3d --conf perspective-cities data.preprocessing.resize_backend=\"PIL\" --overwrite\n```\n\n要评估在我们的 OpenPano 数据集上训练的模型，请运行：\n\n```bash\npython -m siclib.eval.stanford2d3d --conf perspective-openpano --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估 UVP]\u003C\u002Fsummary>\n\n要评估 UVP 模型，请先在 ```third_party\u002FVP-Estimation-with-Prior-Gravity``` 目录下安装 [VP-Estimation-with-Prior-Gravity](https:\u002F\u002Fgithub.com\u002Fcvg\u002FVP-Estimation-with-Prior-Gravity)。然后运行：\n\n```bash\npython -m siclib.eval.stanford2d3d --conf uvp --tag uvp --overwrite data.preprocessing.edge_divisible_by=null\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[评估您自己的模型]\u003C\u002Fsummary>\n\n如果您训练了自己的模型，可以通过以下命令进行评估：\n\n```bash\npython -m siclib.eval.stanford2d3d --checkpoint \u003C实验名称> --tag \u003C评估名称> --overwrite\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[结果]\u003C\u002Fsummary>\n\n以下是不同方法在滚转、俯仰和视场角（FoV）误差方面，于 1\u002F5\u002F10 度下的曲线下面积（AUC）结果：\n\n| 方法            | 滚转               | 俯仰              | 视场角                |\n| ------------------- | ------------------ | ------------------ | ------------------ |\n| DeepCalib           | 33.8 \u002F 63.9 \u002F 79.2 | 21.6 \u002F 46.9 \u002F 65.7 | 08.1 \u002F 20.6 \u002F 37.6 |\n| ParamNet            | 20.6 \u002F 48.5 \u002F 68.1 | 20.9 \u002F 44.2 \u002F 61.5 | 07.4 \u002F 18.0 \u002F 33.2 |\n| ParamNet (OpenPano) | 44.6 \u002F 73.9 \u002F 84.8 | 29.2 \u002F 56.7 \u002F 73.1 | 05.8 \u002F 14.3 \u002F 27.8 |\n| UVP                 | 65.3 \u002F 74.6 \u002F 79.1 | 51.2 \u002F 63.0 \u002F 69.2 | 22.2 \u002F 39.5 \u002F 51.3 |\n| GeoCalib            | 83.1 \u002F 91.8 \u002F 94.8 | 52.3 \u002F 74.8 \u002F 84.6 | 17.4 \u002F 40.0 \u002F 59.4 |\n\n\u003C\u002Fdetails>\n\n### 评估选项\n\n如果您希望在评估过程中提供先验信息，可以添加以下一个或多个标志：\n\n```bash\npython -m siclib.eval.\u003Cbenchmark> --conf \u003Cconfig> \\\n    --tag \u003Ctag> \\\n    data.use_prior_focal=true \\\n    data.use_prior_gravity=true \\\n    data.use_prior_k1=true\n```\n\n\u003Cdetails>\n\u003Csummary>[可视化检查]\u003C\u002Fsummary>\n\n要对评估结果进行可视化检查，可以运行以下命令：\n\n```bash\npython -m siclib.eval.inspect \u003Cbenchmark> \u003C一个或多个标签>\n```\n\n例如，要检查 GeoCalib 模型在 LaMAR 数据集上的评估结果，可以运行：\n\n```bash\npython -m siclib.eval.inspect lamar2k geocalib\n```\n\n\u003C\u002Fdetails>\n\n## OpenPano 数据集\n\nOpenPano 数据集是一个用于单张图像标定的新数据集，包含来自不同来源的约 2,800 张全景图，具体来源包括 [HDRMAPS](https:\u002F\u002Fhdrmaps.com\u002Fhdris\u002F)、[PolyHaven](https:\u002F\u002Fpolyhaven.com\u002Fhdris\u002F) 以及 [Laval 光度学室内 HDR 数据集](http:\u002F\u002Fhdrdb.com\u002Findoor-hdr-photometric\u002F)。尽管该数据集规模小于以往的数据集，但它面向公众开放，并且在室内与室外场景之间提供了更好的平衡。\n\n\u003Cdetails>\n\u003Csummary>[下载和准备数据集]\u003C\u002Fsummary>\n\n为了构建训练集，首先按照 [相应项目页面](http:\u002F\u002Fhdrdb.com\u002Findoor-hdr-photometric\u002F) 的说明下载 Laval 数据集，并将全景图放置在 ```data\u002FindoorDatasetCalibrated``` 目录下。然后，使用以下命令对 HDR 图像进行色调映射：\n\n```bash\npython -m siclib.datasets.utils.tonemapping --hdr_dir data\u002FindoorDatasetCalibrated --out_dir data\u002Flaval-tonemap\n```\n\n我们提供了一个脚本用于下载 PolyHaven 和 HDRMAPS 的全景图。该脚本会创建 ```data\u002Fopenpano\u002Fpanoramas\u002F{split}``` 文件夹，其中包含由 ```{split}_panos.txt``` 文件指定的全景图。要运行该脚本，请执行以下命令：\n\n```bash\npython -m siclib.datasets.utils.download_openpano --name openpano --laval_dir data\u002Flaval-tonemap\n```\n或者，您也可以从 [这里](https:\u002F\u002Fpolybox.ethz.ch\u002Findex.php\u002Fs\u002FXK4oM1l6ZqSIXw9) 下载 PolyHaven 和 HDRMAPS 的全景图。\n\u003C!-- 或者，您也可以从 [这里](https:\u002F\u002Fcvg-data.inf.ethz.ch\u002FGeoCalib_ECCV2024\u002F) 下载 PolyHaven 和 HDRMAPS 的全景图。 -->\n\n\n下载完全景图后，可以通过运行以下命令来创建训练集：\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano\n```\n\n为了加快数据集的创建过程，可以使用多个工作进程和 GPU。为此，在命令中添加以下参数：\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano n_workers=10 device=cuda\n```\n\n这将在 ```data\u002Fopenpano\u002Fopenpano``` 中创建训练集，包含约 37,000 张用于训练的图像、2,100 张用于验证的图像以及 2,100 张用于测试的图像。\n\n\u003Cdetails>\n\u003Csummary>[带有径向畸变的 OpenPano]\u003C\u002Fsummary>\n\n要创建带有径向畸变的 OpenPano 数据集，可运行以下命令：\n\n```bash\npython -m siclib.datasets.create_dataset_from_pano --config-name openpano_radial\n```\n\n\u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n## 训练\n\n关于评估部分，训练代码已包含在单张图像标定库 [`siclib`](siclib) 中，可通过以下命令安装：\n\n```bash\npython -m pip install -e siclib\n```\n\n一旦 [OpenPano 数据集](#openpano-dataset) 下载并准备好，我们就可以使用它来训练 GeoCalib：\n\n首先下载 [MSCAN-B](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fc15b25a6745946618462\u002F) 主干网络的预训练权重：\n\n```bash\nmkdir weights\nwget \"https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fc15b25a6745946618462\u002Ffiles\u002F?p=%2Fmscan_b.pth&dl=1\" -O weights\u002Fmscan_b.pth\n```\n\n然后，使用以下命令开始训练：\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano --conf geocalib --distributed\n```\n\n您可以自由选择其他实验名称。默认情况下，检查点将被写入 ```outputs\u002Ftraining\u002F``` 目录。默认批量大小为 24，需要两块配备 24GB 显存的 4090 GPU。配置由 [Hydra](https:\u002F\u002Fhydra.cc\u002F) 管理，可通过命令行覆盖。\n例如，要在单块 2080 GPU 上以 5 的批量大小训练 GeoCalib，可运行：\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano \\\n    --conf geocalib \\\n    data.train_batch_size=5 # 对于 1x 2080 GPU\n```\n\n请注意，这可能会影响整体性能。您可能需要相应地调整学习率和训练步数。\n\n如果您希望将训练进度记录到 [tensorboard](https:\u002F\u002Fwww.tensorflow.org\u002Ftensorboard) 或 [wandb](https:\u002F\u002Fwandb.ai\u002F) 中，可以设置 ```train.writer``` 选项：\n\n```bash\npython -m siclib.train geocalib-pinhole-openpano \\\n    --conf geocalib \\\n    --distributed \\\n    train.writer=tensorboard\n```\n\n随后，可以使用实验名称对该模型进行评估：\n\n```bash\npython -m siclib.eval.\u003Cbenchmark> --checkpoint geocalib-pinhole-openpano \\\n    --tag geocalib-retrained\n```\n\n\u003Cdetails>\n\u003Csummary>[训练 DeepCalib]\u003C\u002Fsummary>\n\n要使用 OpenPano 数据集训练 DeepCalib，可运行：\n\n```bash\npython -m siclib.train deepcalib-openpano --conf deepcalib --distributed\n```\n\n请确保您已经生成了带有径向畸变的 [OpenPano 数据集](#openpano-dataset)，或者在命令中添加 ```data=openpano``` 标志，以便在针孔图像上进行训练。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>[训练 Perspective Fields]\u003C\u002Fsummary>\n\n要训练 Perspective Fields，首先按照 [ParamNet-siclib](https:\u002F\u002Fgithub.com\u002Fveichta\u002FParamNet-siclib) 仓库中的说明设置文件。然后执行以下步骤：\n\n首先训练透视网络：\n\n```bash\npython -m siclib.train perspective-net --conf perspective-net --distributed\n```\n\n接着将训练好的权重保存到 ```weights\u002Fpersnet-pano-old.tar``` 文件中，再训练完整模型：\n\n```bash\npython -m siclib.train param-net --conf param-net --distributed\n```\n\n\u003C\u002Fdetails>\n\n## BibTeX 引用\n\n如果您使用了本文中的任何想法或本仓库中的代码，请考虑引用以下文献：\n\n```bibtex\n@inproceedings{veicht2024geocalib,\n  author    = {Alexander Veicht and\n               Paul-Edouard Sarlin and\n               Philipp Lindenberger and\n               Marc Pollefeys},\n  title     = {{GeoCalib: Single-image Calibration with Geometric Optimization}},\n  booktitle = {ECCV},\n  year      = {2024}\n}\n```\n\n## 许可证\n\n代码采用 [Apache-2.0 许可证](LICENSE) 发布，而训练后的模型权重则采用 [知识共享署名 4.0 国际许可协议](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode) 发布。感谢 [Laval 室内 HDR 数据集](http:\u002F\u002Fhdrdb.com\u002Findoor\u002F#presentation) 的作者允许我们使用其数据。","# GeoCalib 快速上手指南\n\nGeoCalib 是一个基于单张图像进行相机标定的算法，结合几何优化与深度学习，能够准确估计相机内参（焦距、畸变等）和重力方向。\n\n## 环境准备\n\n- **操作系统**：Linux \u002F macOS \u002F Windows\n- **Python 版本**：>= 3.9\n- **依赖库**：PyTorch（支持 CUDA 可选，用于 GPU 加速）\n- **磁盘空间**：基础安装约需 200MB，若需运行评估或训练请预留更多空间\n\n> 💡 建议在国内使用清华或阿里镜像源加速 PyTorch 及相关依赖安装：\n> ```bash\n> pip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n> # 或 CPU 版本\n> # pip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n> ```\n\n## 安装步骤\n\n克隆仓库并安装 `geocalib` 包：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib.git && cd GeoCalib\npython -m pip install -e .\n```\n\n或通过 Git 直接安装（无需克隆）：\n\n```bash\npython -m pip install -e \"git+https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib#egg=geocalib\"\n```\n\n> 🇨🇳 国内用户如遇 GitHub 访问慢，可尝试使用镜像：\n> ```bash\n> git clone https:\u002F\u002Fgitee.com\u002Fmirrors\u002FGeoCalib.git\n> ```\n> （注：若官方未同步镜像，请自行查找可靠镜像源或使用代理）\n\n## 基本使用\n\n以下是最小化使用示例，加载一张图片并获取相机内参与重力方向：\n\n```python\nimport torch\nfrom geocalib import GeoCalib\n\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel = GeoCalib().to(device)\n\n# 加载图像为 [C, H, W] 形状、值域 [0, 1] 的 tensor\nimage = model.load_image(\"path\u002Fto\u002Fimage.jpg\").to(device)\nresult = model.calibrate(image)\n\nprint(\"camera:\", result[\"camera\"])\nprint(\"gravity:\", result[\"gravity\"])\n```\n\n### 支持相机模型\n\n默认使用针孔模型（`pinhole`），也可指定其他模型处理畸变：\n\n```python\n# 使用简单径向畸变模型\nmodel = GeoCalib(weights=\"distorted\")\nresult = model.calibrate(image, camera_model=\"simple_radial\")\n```\n\n支持的模型包括：\n- `pinhole`（默认）\n- `simple_radial`\n- `radial`\n- `simple_divisional`\n\n### 批量标定（多张同相机图像）\n\n```python\nbatch = [image1, image2, image3]  # 每个元素为 [C, H, W] tensor\nresult = model.calibrate(batch, shared_intrinsics=True)\n```\n\n### 已知先验信息（部分标定）\n\n若已知焦距或重力方向，可作为先验传入：\n\n```python\n# 已知焦距\nresult = model.calibrate(image, priors={\"focal\": focal_length_tensor})\n\n# 已知重力方向\nresult = model.calibrate(image, priors={\"gravity\": gravity_direction_tensor})\n```\n\n---\n\n✅ 更多功能（如交互式 Webcam 演示、评估、训练）请参考官方仓库中的 `demo.ipynb` 或完整文档。","一位城市街景采集工程师正在处理由手持设备拍摄的数万张非专业监控照片，需要快速构建高精度的 3D 地图模型。\n\n### 没有 GeoCalib 时\n- **依赖昂贵硬件**：必须使用预先经过严格标定的专业工业相机，普通手机或运动相机拍摄的照片因缺乏内参数据而无法直接用于重建。\n- **人工干预繁琐**：面对海量单张图片，工程师需手动估算焦距和畸变参数，或运行耗时的多视图几何算法，一旦图片重叠度不足即宣告失败。\n- **重力方向缺失**：由于无法自动识别地平面，生成的 3D 模型往往发生倾斜或旋转，后期需要大量人工操作才能将建筑物“扶正”。\n- **容错率极低**：对于存在明显镜头畸变的广角照片，传统方法极易计算发散，导致整批数据作废，严重影响项目交付进度。\n\n### 使用 GeoCalib 后\n- **单图即时标定**：GeoCalib 能直接从任意单张 JPG 图片中精准推算出相机内参（焦距、主点）及畸变系数，让低成本消费级相机也能产出专业级数据。\n- **自动化流水线**：结合深度学习与几何优化，GeoCalib 无需多视角约束即可批量处理独立图片，将原本数小时的预处理工作压缩至分钟级。\n- **自动垂直校正**：GeoCalib 同步输出精确的重力方向向量，自动修正图像姿态，确保重建出的街道和建筑天然保持垂直于地面，无需后期手动调整。\n- **强抗畸变能力**：针对鱼眼或大广角镜头产生的严重形变，GeoCalib 展现出卓越的鲁棒性，显著提升了复杂场景下的三维重建成功率。\n\nGeoCalib 通过单图即可实现高精度相机标定与重力对齐，彻底打破了 3D 视觉重建对专业硬件和多视图约束的依赖。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcvg_GeoCalib_fc6ec564.png","cvg","Computer Vision and Geometry Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fcvg_d85caeeb.png","",null,"http:\u002F\u002Fcvg.ethz.ch","https:\u002F\u002Fgithub.com\u002Fcvg",[80],{"name":81,"color":82,"percentage":83},"Python","#3572A5",100,825,59,"2026-04-17T14:37:57","Apache-2.0","Linux, macOS, Windows","可选（支持 CPU 运行）。若使用 GPU，需支持 CUDA 的 NVIDIA 显卡（具体型号和显存未说明），通过 `torch.cuda.is_available()` 自动检测。","未说明",{"notes":92,"python":93,"dependencies":94},"该工具主要依赖 PyTorch，支持在 CPU 或 GPU 上运行。安装可通过 pip 直接安装本地包或从 GitHub 安装。评估部分需要额外安装 `siclib` 库。部分评估任务（如 LaMAR, MegaDepth）会自动下载数据集，需预留数百 MB 至 2GB+ 的磁盘空间。交互式演示支持 webcam 或 DroidCam。","3.9+",[95,96,97],"torch","geocalib (内置)","siclib (用于评估和训练)",[14],[100,101,102],"camera-calibration","deep-learning","optimization","2026-03-27T02:49:30.150509","2026-04-18T17:04:05.975254",[106,111,116,121,126,131],{"id":107,"question_zh":108,"answer_zh":109,"source_url":110},40371,"运行代码时遇到模型未移动到 GPU 的错误，如何解决？","确保在初始化模型后将其移动到正确的设备。代码应修改为：\n`model = GeoCalib(weights=\"distorted\").to(device)`\n而不是仅写 `model = GeoCalib(weights=\"distorted\")`。同时加载图像后也要执行 `.to(device)`。","https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fissues\u002F3",{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},40372,"如何使用多张图像进行联合优化（共享内参）？","目前 `calibrate` 函数不直接支持传入图像列表（list）。你需要先将图像堆叠成一个 Batch 维度的 Tensor。\n示例代码逻辑如下：\n1. 遍历文件夹加载所有图像并转换为 Tensor。\n2. 使用 `torch.stack()` 将列表转换为形状为 `[B, C, H, W]` 的 Tensor。\n3. 调用 `model.calibrate(batch_tensor, shared_intrinsics=True)`。\n注意：如果直接传入 list 会报错 `'list' object has no attribute 'shape'`。","https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fissues\u002F35",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},40373,"共享内参（shared_intrinsics）功能是否支持畸变相机模型？","是的，项目已在后续更新（PR #27）中合并了相关代码，现在完全支持任意畸变相机模型的共享内参优化。请确保拉取最新版本的代码即可使用该功能。","https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fissues\u002F23",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},40374,"对于非针孔相机模型，是否可以直接平均内参矩阵来替代多帧优化？","简单平均内参矩阵虽然可行，但效果不如论文图 8 所示的联合优化（joint optimization）好。目前该功能主要针对针孔相机，若需用于其他模型，可能需要自行适配优化器中的计算逻辑。","https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fissues\u002F5",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},40375,"无法下载 Laval HDR 数据集或链接失效怎么办？","官方文档曾链接到错误的数据集地址。正确的数据集是 \"Laval Photometric Indoor HDR dataset\"，请访问 http:\u002F\u002Fhdrdb.com\u002Findoor-hdr-photometric\u002F 申请下载。如果网站暂时无法访问，建议直接发送邮件给数据集作者 Jean-François Lalonde 获取，因为项目维护者无权直接分发该数据集。","https:\u002F\u002Fgithub.com\u002Fcvg\u002FGeoCalib\u002Fissues\u002F16",{"id":132,"question_zh":133,"answer_zh":134,"source_url":110},40376,"GeoCalib 计算的内参格式是什么（Fx, Fy, Cx, Cy 及畸变参数）？","GeoCalib 输出的结果包含在 `result` 字典中。调用 `model.calibrate` 后，可以通过 `result[\"camera\"]` 获取相机内参，通过 `result[\"gravity\"]` 获取重力方向。具体的内参格式取决于选择的 `camera_model` 参数（如 \"pinhole\", \"simple_radial\" 等），通常包含焦距和主点坐标，若选择畸变模型则还包含畸变系数。",[136],{"id":137,"version":138,"summary_zh":76,"released_at":139},323758,"v1.0","2024-09-08T13:05:40"]