[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-iSEE-Laboratory--LLMDet":3,"tool-iSEE-Laboratory--LLMDet":62},[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,2,"2026-04-10T11:39:34",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"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",[43,13,15,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},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",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},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,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":68,"readme_en":69,"readme_zh":70,"quickstart_zh":71,"use_case_zh":72,"hero_image_url":73,"owner_login":74,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":100,"forks":101,"last_commit_at":102,"license":103,"difficulty_score":10,"env_os":104,"env_gpu":105,"env_ram":104,"env_deps":106,"category_tags":119,"github_topics":77,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":162},7496,"iSEE-Laboratory\u002FLLMDet","LLMDet","(CVPR 2025 highlight✨) Official repository of paper \"LLMDet: Learning Strong Open-Vocabulary Object Detectors under the Supervision of Large Language Models\"","LLMDet 是一款荣获 CVPR 2025 亮点论文殊荣的开源目标检测工具，旨在突破传统开放词汇检测器的性能瓶颈。它创新性地引入大型语言模型（LLM）作为“导师”，通过为图像生成详细的区域级和全局描述，让检测器在训练过程中同时学习定位物体与理解语义。这种方法有效解决了现有模型在缺乏大量标注数据时，难以识别未见类别或复杂场景的难题，显著提升了模型的泛化能力和检测精度。\n\n该技术最大的亮点在于构建了名为 GroundingCap-1M 的新数据集，并实现了检测器与大语言模型的协同进化：不仅 LLM 指导检测器变得更强大，优化后的检测器也能反哺多模态大模型，形成互利共赢的闭环。目前，LLMDet 已正式合并至主流的 Transformers 库中，并提供了便捷的 Hugging Face 在线演示，降低了使用门槛。\n\nLLMDet 非常适合计算机视觉领域的研究人员、算法工程师以及希望探索多模态融合技术的开发者使用。无论是需要构建高精度的通用物体识别系统，还是致力于研究开放词汇检测的前沿学术团队，都能从中获得强大的基线模型与技术启发。凭借其卓越的性能表现和开放的生态集成，LLMDet 正成为","LLMDet 是一款荣获 CVPR 2025 亮点论文殊荣的开源目标检测工具，旨在突破传统开放词汇检测器的性能瓶颈。它创新性地引入大型语言模型（LLM）作为“导师”，通过为图像生成详细的区域级和全局描述，让检测器在训练过程中同时学习定位物体与理解语义。这种方法有效解决了现有模型在缺乏大量标注数据时，难以识别未见类别或复杂场景的难题，显著提升了模型的泛化能力和检测精度。\n\n该技术最大的亮点在于构建了名为 GroundingCap-1M 的新数据集，并实现了检测器与大语言模型的协同进化：不仅 LLM 指导检测器变得更强大，优化后的检测器也能反哺多模态大模型，形成互利共赢的闭环。目前，LLMDet 已正式合并至主流的 Transformers 库中，并提供了便捷的 Hugging Face 在线演示，降低了使用门槛。\n\nLLMDet 非常适合计算机视觉领域的研究人员、算法工程师以及希望探索多模态融合技术的开发者使用。无论是需要构建高精度的通用物体识别系统，还是致力于研究开放词汇检测的前沿学术团队，都能从中获得强大的基线模型与技术启发。凭借其卓越的性能表现和开放的生态集成，LLMDet 正成为连接视觉感知与语言理解的重要桥梁。","\n\n## LLMDet: Learning Strong Open-Vocabulary Object Detectors under the Supervision of Large Language Models\n\nThis is the official PyTorch implementation of [LLMDet](https:\u002F\u002Farxiv.org\u002Fabs\u002F2501.18954).\n\n🎉🎉🎉 Our paper is accepted by CVPR 2025 as a highlight paper✨, congratulations and many thanks to the co-authors!\n\nIf you find our work helpful, please kindly give us a star🌟\n\n### Updates\n\n- **[2026.02.03]** We release the first MLLM-based object embedding model [ObjEmbed](https:\u002F\u002Fgithub.com\u002FWeChatCV\u002FObjEmbed).\n- **[2025.12.16]** We release a series of more advanced model [WeDetect](https:\u002F\u002Fgithub.com\u002FWeChatCV\u002FWeDetect).\n- **[2025.08.06]** 🔥🔥🔥 LLMDet is merged into official `transformers==4.55.0` ! Install the latest `transformers` and try out LLMDet.\n- **[2025.06.06]** 🔥🔥🔥 Added [Gradio demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fmrdbourke\u002FLLMDet-demo) to Hugging Face, you can now try out LLMDet in your browser. (Thanks to [Daniel Bourke](https:\u002F\u002Fgithub.com\u002Fmrdbourke) for valuable contributions)\n- **[2025.04.07]** Update demo in huggingface. Release huggingface checkpoints.\n- **[2025.04.04]** Our paper was selected as a highlight paper in CVPR2025.\n- **[2025.03.25]** Update demo in mmdet.\n- **[2025.02.27]** Our paper was accepted by CVPR2025.\n- **[2025.01.31]** Release the code and paper.\n\n### 1 Introduction\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_730a1d083713.png\" style=\"zoom:30%;\" \u002F>\n\nRecent open-vocabulary detectors achieve promising performance with abundant region-level annotated data. In this work, we show that an open-vocabulary detector co-training with a large language model by generating image-level detailed captions for each image can further improve performance. To achieve the goal, we first collect a dataset, GroundingCap-1M, wherein each image is accompanied by associated grounding labels and an image-level detailed caption. With this dataset, we finetune an open-vocabulary detector with training objectives including a standard grounding loss and a caption generation loss. We take advantage of a large language model to generate both region-level short captions for each region of interest and image-level long captions for the whole image. Under the supervision of the large language model, the resulting detector, LLMDet, outperforms the baseline by a clear margin, enjoying superior open-vocabulary ability. Further, we show that the improved LLMDet can in turn build a stronger large multi-modal model, achieving mutual benefits.\n\n### 2 Model Zoo\n\n| Model                         | AP\u003Csup>mini\u003C\u002Fsup> | AP\u003Csub>r\u003C\u002Fsub> | AP\u003Csub>c\u003C\u002Fsub> | AP\u003Csub>f\u003C\u002Fsub> | AP\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>r\u003C\u002Fsub> | AP\u003Csub>c\u003C\u002Fsub> | AP\u003Csub>f\u003C\u002Fsub> |\n| ----------------------------- | ----------------- | -------------- | -------------- | -------------- | ---------------- | -------------- | -------------- | -------------- |\n| LLMDet Swin-T only p5         | 44.5              | 38.6           | 39.3           | 50.3           | 34.6             | 25.5           | 29.9           | 43.8           |\n| LLMDet Swin-T                 | 44.7              | 37.3           | 39.5           | 50.7           | 34.9             | 26.0           | 30.1           | 44.3           |\n| LLMDet Swin-B                 | 48.3              | 40.8           | 43.1           | 54.3           | 38.5             | 28.2           | 34.3           | 47.8           |\n| LLMDet Swin-L                 | 51.1              | 45.1           | 46.1           | 56.6           | 42.0             | 31.6           | 38.8           | 50.2           |\n| LLMDet Swin-L (chunk size 80) | 52.4              | 44.3           | 48.8           | 57.1           | 43.2             | 32.8           | 40.5           | 50.8           |\n\n**NOTE:**\n\n1. AP\u003Csup>mini\u003C\u002Fsup>: evaluated on LVIS `minival`.\n2. AP\u003Csup>val\u003C\u002Fsup>: evaluated on LVIS `val 1.0`.\n3. AP is fixed AP.\n4. All the checkpoints and logs can be found in [huggingface](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) and [modelscope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet).\n5. Other benchmarks are tested using `LLMDet Swin-T only p5`.\n\n### 3 Our Experiment Environment\n\nNote: other environments may also work.\n\n- pytorch==2.2.1+cu121\n- transformers==4.37.2\n- numpy==1.22.2 (numpy should be lower than 1.24, recommend for numpy==1.23 or 1.22)\n- mmcv==2.2.0, mmengine==0.10.5\n- timm, deepspeed, pycocotools, lvis, jsonlines, fairscale, nltk, peft, wandb\n\n### 4 Data Preparation (GroundingCap-1M)\n\n```\n｜--huggingface\n｜  |--bert-base-uncased\n｜  |--siglip-so400m-patch14-384\n｜  |--my_llava-onevision-qwen2-0.5b-ov-2\n｜  |--mm_grounding_dino\n｜  |  |--grounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det_20231204_095047-b448804b.pth\n｜  |  |--grounding_dino_swin-b_pretrain_obj365_goldg_v3de-f83eef00.pth\n｜  |  |--grounding_dino_swin-l_pretrain_obj365_goldg-34dcdc53.pth\n｜--grounding_data\n｜  |--coco\n｜  |  |--annotations\n｜  |  |  |--instances_train2017_vg_merged6.jsonl\n｜  |  |  |--instances_val2017.json\n｜  |  |  |--lvis_v1_minival_inserted_image_name.json\n｜  |  |  |--lvis_od_val.json\n｜  |  |--train2017\n｜  |  |--val2017\n｜  |--flickr30k_entities\n｜  |  |--flickr_train_vg7.jsonl\n｜  |  |--flickr30k_images\n｜  |--gqa\n｜  |  |--gqa_train_vg7.jsonl\n｜  |  |--images\n｜  |--llava_cap\n｜  |  |--LLaVA-ReCap-558K_tag_box_vg7.jsonl\n｜  |  |--images\n｜  |--v3det\n｜  |  |--annotations\n｜  |  |  |--v3det_2023_v1_train_vg7.jsonl\n｜  |  |--images\n｜--LLMDet (code)\n```\n\n- pretrained models\n  - `bert-base-uncased`, `siglip-so400m-patch14-384` are directly downloaded from huggingface.\n  - To fully reproduce our results, please download `my_llava-onevision-qwen2-0.5b-ov-2` from [huggingface](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) or [modelscope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet), which is slightly fine-tuned by us in early exploration. We find that the original `llava-onevision-qwen2-0.5b-ov` is still OK to reproduce our results but users should pretrain the projector.\n  - Since LLMDet is fine-tuned from`mm_grounding_dino`, please download their checkpoints [swin-t](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det\u002Fgrounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det_20231204_095047-b448804b.pth), [swin-b](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-b_pretrain_obj365_goldg_v3det\u002Fgrounding_dino_swin-b_pretrain_obj365_goldg_v3de-f83eef00.pth), [swin-l](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-l_pretrain_obj365_goldg\u002Fgrounding_dino_swin-l_pretrain_obj365_goldg-34dcdc53.pth) for training.\n- grounding data (GroundingCap-1M)\n  - `coco`: You can download it from the [COCO](https:\u002F\u002Fcocodataset.org\u002F) official website or from [opendatalab](https:\u002F\u002Fopendatalab.com\u002FOpenDataLab\u002FCOCO_2017).\n  - `lvis`: LVIS shares the same images with COCO. You can download the minival annotation file from [here](https:\u002F\u002Fhuggingface.co\u002FGLIPModel\u002FGLIP\u002Fblob\u002Fmain\u002Flvis_v1_minival_inserted_image_name.json), and the val 1.0 annotation file from [here](https:\u002F\u002Fhuggingface.co\u002FGLIPModel\u002FGLIP\u002Fblob\u002Fmain\u002Flvis_od_val.json). \n  - `flickr30k_entities`：[Flickr30k images](http:\u002F\u002Fshannon.cs.illinois.edu\u002FDenotationGraph\u002F).\n  - `gqa`： [GQA images](https:\u002F\u002Fnlp.stanford.edu\u002Fdata\u002Fgqa\u002Fimages.zip).\n  - `llava_cap`：[images](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fliuhaotian\u002FLLaVA-Pretrain\u002Fblob\u002Fmain\u002Fimages.zip) .\n  - `v3det`：The V3Det dataset can be downloaded from [opendatalab](https:\u002F\u002Fopendatalab.com\u002FV3Det\u002FV3Det). \n  - Our generated jsonls can be found in [huggingface](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) or [modelscope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet).\n  - For other evalation datasets, please refer to [MM-GDINO](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmdetection\u002Fblob\u002Fmain\u002Fconfigs\u002Fmm_grounding_dino\u002Fdataset_prepare.md).\n\n### 5 Usage\n\n#### 5.1 Training\n\n```\nbash dist_train.sh configs\u002Fgrounding_dino_swin_t.py 8 --amp\n```\n\n#### 5.2 Evaluation\n\n```\nbash dist_test.sh configs\u002Fgrounding_dino_swin_t.py tiny.pth 8\n```\n\n#### 5.3 Demo\n\n```\nimport nltk\nnltk.download('punkt')\nnltk.download('averaged_perceptron_tagger')\nnltk.download('punkt_tab')\nnltk.download('averaged_perceptron_tagger_eng')\nnltk.download('stopwords')\n```\n\n- For Phrase Grounding and Referential Expression Comprehension, users should first download `nltk` packages.\n- If you do not want to load the llm during inference, please modify the config `lmm=None`.\n\n1. Open-Vocabuary Object Detection (开放词汇目标检测)\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'apple .' -c --pred-score-thr 0.4\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_982bec143d2c.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n2. Phrase Grounding (短语定位)\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'There are many apples here.' --pred-score-thr 0.35\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_6029e0b12ca7.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n3. Referential Expression Comprehension (指代性表达式理解)\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'red apple.' --tokens-positive -1 --pred-score-thr 0.4\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_dc2209e6a08d.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n#### 5.4 Use LLMDet in Huggingface\n\n- LLMDet is now merged into official `transformers==4.55.0`. You can use LLMDet with just a few lines of code!\n```\nimport torch\nfrom transformers import AutoModelForZeroShotObjectDetection, AutoProcessor\nfrom transformers.image_utils import load_image\n\n\n# Prepare processor and model\nmodel_id = \"iSEE-Laboratory\u002Fllmdet_tiny\"\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nprocessor = AutoProcessor.from_pretrained(model_id)\nmodel = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)\n\n# Prepare inputs\nimage_url = \"http:\u002F\u002Fimages.cocodataset.org\u002Fval2017\u002F000000039769.jpg\"\nimage = load_image(image_url)\ntext_labels = [[\"a cat\", \"a remote control\"]]\ninputs = processor(images=image, text=text_labels, return_tensors=\"pt\").to(device)\n\n# Run inference\nwith torch.no_grad():\n    outputs = model(**inputs)\n\n# Postprocess outputs\nresults = processor.post_process_grounded_object_detection(\n    outputs,\n    threshold=0.4,\n    target_sizes=[(image.height, image.width)]\n)\n\n# Retrieve the first image result\nresult = results[0]\nfor box, score, labels in zip(result[\"boxes\"], result[\"scores\"], result[\"labels\"]):\n    box = [round(x, 2) for x in box.tolist()]\n    print(f\"Detected {labels} with confidence {round(score.item(), 3)} at location {box}\")\n```\n- For users with other versions, please refer to [hf_readme](https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Ftree\u002Fmain\u002Fhf_model).\n\n### 6 License\n\nLLMDet is released under the Apache 2.0 license. Please see the LICENSE file for more information.\n\n### 7 Bibtex\n\nIf you find our work helpful for your research, please consider citing our paper.\n\n```\n@article{fu2025llmdet,\n  title={LLMDet: Learning Strong Open-Vocabulary Object Detectors under the Supervision of Large Language Models},\n  author={Fu, Shenghao and Yang, Qize and Mo, Qijie and Yan, Junkai and Wei, Xihan and Meng, Jingke and Xie, Xiaohua and Zheng, Wei-Shi},\n  journal={arXiv preprint arXiv:2501.18954},\n  year={2025}\n}\n```\n\n### 8 Acknowledgement\n\nOur LLMDet is heavily inspired by many outstanding prior works, including\n\n- [MM-Grounding-DINO](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmdetection\u002Ftree\u002Fmain\u002Fconfigs\u002Fmm_grounding_dino)\n- [LLaVA1.5](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002FLLaVA)\n- [LLaVA OneVision](https:\u002F\u002Fgithub.com\u002FLLaVA-VL\u002FLLaVA-NeXT)\n- [ShareGPT4V](https:\u002F\u002Fgithub.com\u002FShareGPT4Omni\u002FShareGPT4V)\n- [ASv2](https:\u002F\u002Fgithub.com\u002FOpenGVLab\u002Fall-seeing)\n- [RAM](https:\u002F\u002Fgithub.com\u002Fxinyu1205\u002Frecognize-anything)\n\nThank the authors of above projects for open-sourcing their assets!\n","## LLMDet：在大型语言模型监督下学习强大的开放词汇目标检测器\n\n这是 [LLMDet](https:\u002F\u002Farxiv.org\u002Fabs\u002F2501.18954) 的官方 PyTorch 实现。\n\n🎉🎉🎉 我们的论文已被 CVPR 2025 接收为亮点论文✨，祝贺并衷心感谢所有合作作者！\n\n如果您觉得我们的工作有所帮助，请为我们点个赞🌟\n\n### 更新\n\n- **[2026.02.03]** 我们发布了首个基于 MLLM 的目标嵌入模型 [ObjEmbed](https:\u002F\u002Fgithub.com\u002FWeChatCV\u002FObjEmbed)。\n- **[2025.12.16]** 我们发布了一系列更先进的模型 [WeDetect](https:\u002F\u002Fgithub.com\u002FWeChatCV\u002FWeDetect)。\n- **[2025.08.06]** 🔥🔥🔥 LLMDet 已合并到官方 `transformers==4.55.0` 中！安装最新版的 `transformers` 即可体验 LLMDet。\n- **[2025.06.06]** 🔥🔥🔥 在 Hugging Face 上新增了 [Gradio 演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fmrdbourke\u002FLLMDet-demo)，您现在可以直接在浏览器中试用 LLMDet。（感谢 [Daniel Bourke](https:\u002F\u002Fgithub.com\u002Fmrdbourke) 的宝贵贡献）\n- **[2025.04.07]** 更新了 Hugging Face 上的演示，并发布了 Hugging Face 检查点。\n- **[2025.04.04]** 我们的论文被选为 CVPR2025 的亮点论文。\n- **[2025.03.25]** 更新了 mmdet 中的演示。\n- **[2025.02.27]** 我们的论文被 CVPR2025 接受。\n- **[2025.01.31]** 发布了代码和论文。\n\n### 1 引言\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_730a1d083713.png\" style=\"zoom:30%;\" \u002F>\n\n近年来，开放词汇目标检测器在丰富的区域级标注数据支持下取得了令人瞩目的性能。在本工作中，我们表明，通过为每张图像生成图像级详细描述，与大型语言模型进行联合训练，可以进一步提升开放词汇目标检测器的性能。为此，我们首先收集了一个数据集 GroundingCap-1M，其中每张图像都配有相关的定位标签和一张图像级详细描述。利用该数据集，我们对开放词汇目标检测器进行了微调，训练目标包括标准的定位损失和描述生成损失。我们借助大型语言模型为每个感兴趣区域生成区域级短描述，并为整张图像生成图像级长描述。在大型语言模型的监督下，最终得到的检测器 LLMDet 显著优于基线模型，展现出更强的开放词汇能力。此外，我们还证明，改进后的 LLMDet 可以反过来构建一个更强大的多模态大模型，实现互利共赢。\n\n### 2 模型库\n\n| 模型                         | AP\u003Csup>mini\u003C\u002Fsup> | AP\u003Csub>r\u003C\u002Fsub> | AP\u003Csub>c\u003C\u002Fsub> | AP\u003Csub>f\u003C\u002Fsub> | AP\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>r\u003C\u002Fsub> | AP\u003Csub>c\u003C\u002Fsub> | AP\u003Csub>f\u003C\u002Fsub> |\n| ----------------------------- | ----------------- | -------------- | -------------- | -------------- | ---------------- | -------------- | -------------- | -------------- |\n| LLMDet Swin-T only p5         | 44.5              | 38.6           | 39.3           | 50.3           | 34.6             | 25.5           | 29.9           | 43.8           |\n| LLMDet Swin-T                 | 44.7              | 37.3           | 39.5           | 50.7           | 34.9             | 26.0           | 30.1           | 44.3           |\n| LLMDet Swin-B                 | 48.3              | 40.8           | 43.1           | 54.3           | 38.5             | 28.2           | 34.3           | 47.8           |\n| LLMDet Swin-L                 | 51.1              | 45.1           | 46.1           | 56.6           | 42.0             | 31.6           | 38.8           | 50.2           |\n| LLMDet Swin-L (chunk size 80) | 52.4              | 44.3           | 48.8           | 57.1           | 43.2             | 32.8           | 40.5           | 50.8           |\n\n**注：**\n\n1. AP\u003Csup>mini\u003C\u002Fsup>：在 LVIS `minival` 数据集上评估。\n2. AP\u003Csup>val\u003C\u002Fsup>：在 LVIS `val 1.0` 数据集上评估。\n3. AP 均为固定 AP。\n4. 所有检查点和日志均可在 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) 和 [ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet) 上找到。\n5. 其他基准测试均使用 `LLMDet Swin-T only p5` 进行。\n\n### 3 我们的实验环境\n\n注意：其他环境也可能适用。\n\n- pytorch==2.2.1+cu121\n- transformers==4.37.2\n- numpy==1.22.2（numpy 应低于 1.24，建议使用 1.23 或 1.22 版本）\n- mmcv==2.2.0, mmengine==0.10.5\n- timm, deepspeed, pycocotools, lvis, jsonlines, fairscale, nltk, peft, wandb\n\n### 4 数据准备（GroundingCap-1M）\n\n```\n｜--huggingface\n｜  |--bert-base-uncased\n｜  |--siglip-so400m-patch14-384\n｜  |--my_llava-onevision-qwen2-0.5b-ov-2\n｜  |--mm_grounding_dino\n｜  |  |--grounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det_20231204_095047-b448804b.pth\n｜  |  |--grounding_dino_swin-b_pretrain_obj365_goldg_v3de-f83eef00.pth\n｜  |  |--grounding_dino_swin-l_pretrain_obj365_goldg-34dcdc53.pth\n｜--grounding_data\n｜  |--coco\n｜  |  |--annotations\n｜  |  |  |--instances_train2017_vg_merged6.jsonl\n｜  |  |  |--instances_val2017.json\n｜  |  |  |--lvis_v1_minival_inserted_image_name.json\n｜  |  |  |--lvis_od_val.json\n｜  |  |--train2017\n｜  |  |--val2017\n｜  |--flickr30k_entities\n｜  |  |--flickr_train_vg7.jsonl\n｜  |  |--flickr30k_images\n｜  |--gqa\n｜  |  |--gqa_train_vg7.jsonl\n｜  |  |--images\n｜  |--llava_cap\n｜  |  |--LLaVA-ReCap-558K_tag_box_vg7.jsonl\n｜  |  |--images\n｜  |--v3det\n｜  |  |--annotations\n｜  |  |  |--v3det_2023_v1_train_vg7.jsonl\n｜  |  |--images\n｜--LLMDet (code)\n```\n\n- 预训练模型\n  - `bert-base-uncased` 和 `siglip-so400m-patch14-384` 直接从 Hugging Face 下载。\n  - 为完全复现我们的结果，请从 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) 或 [ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet) 下载 `my_llava-onevision-qwen2-0.5b-ov-2`，该模型是我们早期探索中稍作微调的版本。我们发现原始的 `llava-onevision-qwen2-0.5b-ov` 同样可以复现结果，但用户需要先对投影器进行预训练。\n  - 由于 LLMDet 是基于 `mm_grounding_dino` 微调的，请下载其检查点：[swin-t](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det\u002Fgrounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det_20231204_095047-b448804b.pth)、[swin-b](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-b_pretrain_obj365_goldg_v3det\u002Fgrounding_dino_swin-b_pretrain_obj365_goldg_v3de-f83eef00.pth)、[swin-l](https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-l_pretrain_obj365_goldg\u002Fgrounding_dino_swin-l_pretrain_obj365_goldg-34dcdc53.pth)，用于训练。\n- 接地数据（GroundingCap-1M）\n  - `coco`：可从 [COCO](https:\u002F\u002Fcocodataset.org\u002F) 官方网站或 [opendatalab](https:\u002F\u002Fopendatalab.com\u002FOpenDataLab\u002FCOCO_2017) 下载。\n  - `lvis`：LVIS 与 COCO 使用相同的图像。您可以从 [这里](https:\u002F\u002Fhuggingface.co\u002FGLIPModel\u002FGLIP\u002Fblob\u002Fmain\u002Flvis_v1_minival_inserted_image_name.json) 下载 minival 注释文件，从 [这里](https:\u002F\u002Fhuggingface.co\u002FGLIPModel\u002FGLIP\u002Fblob\u002Fmain\u002Flvis_od_val.json) 下载 val 1.0 注释文件。\n  - `flickr30k_entities`：[Flickr30k 图像](http:\u002F\u002Fshannon.cs.illinois.edu\u002FDenotationGraph\u002F)。\n  - `gqa`：[GQA 图像](https:\u002F\u002Fnlp.stanford.edu\u002Fdata\u002Fgqa\u002Fimages.zip)。\n  - `llava_cap`：[图像](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fliuhaotian\u002FLLaVA-Pretrain\u002Fblob\u002Fmain\u002Fimages.zip)。\n  - `v3det`：V3Det 数据集可从 [opendatalab](https:\u002F\u002Fopendatalab.com\u002FV3Det\u002FV3Det) 下载。\n  - 我们生成的 jsonl 文件可在 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) 或 [ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet) 中找到。\n  - 对于其他评估数据集，请参考 [MM-GDINO](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmdetection\u002Fblob\u002Fmain\u002Fconfigs\u002Fmm_grounding_dino\u002Fdataset_prepare.md)。\n\n### 5 使用方法\n\n#### 5.1 训练\n\n```\nbash dist_train.sh configs\u002Fgrounding_dino_swin_t.py 8 --amp\n```\n\n#### 5.2 评估\n\n```\nbash dist_test.sh configs\u002Fgrounding_dino_swin_t.py tiny.pth 8\n```\n\n#### 5.3 演示\n\n```\nimport nltk\nnltk.download('punkt')\nnltk.download('averaged_perceptron_tagger')\nnltk.download('punkt_tab')\nnltk.download('averaged_perceptron_tagger_eng')\nnltk.download('stopwords')\n```\n\n- 对于短语接地和指代性表达理解任务，用户应首先下载 `nltk` 包。\n- 如果在推理过程中不希望加载 LLM，请将配置中的 `lmm=None` 进行修改。\n\n1. 开放词汇目标检测\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'apple .' -c --pred-score-thr 0.4\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_982bec143d2c.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n2. 短语接地\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'There are many apples here.' --pred-score-thr 0.35\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_6029e0b12ca7.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n3. 指代性表达理解\n\n```\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'red apple.' --tokens-positive -1 --pred-score-thr 0.4\n```\n\n\u003Cdiv align=center>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_readme_dc2209e6a08d.jpeg\" width=\"70%\"\u002F>\n\u003C\u002Fdiv>\n\n#### 5.4 在 Hugging Face 中使用 LLMDet\n\n- LLMDet 现已合并到官方 `transformers==4.55.0` 中。只需几行代码即可使用 LLMDet！\n```\nimport torch\nfrom transformers import AutoModelForZeroShotObjectDetection, AutoProcessor\nfrom transformers.image_utils import load_image\n\n\n# 准备处理器和模型\nmodel_id = \"iSEE-Laboratory\u002Fllmdet_tiny\"\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nprocessor = AutoProcessor.from_pretrained(model_id)\n模型 = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)\n\n# 准备输入\nimage_url = \"http:\u002F\u002Fimages.cocodataset.org\u002Fval2017\u002F000000039769.jpg\"\nimage = load_image(image_url)\ntext_labels = [[\"a cat\", \"a remote control\"]]\ninputs = processor(images=image， text=text_labels， return_tensors=\"pt\").to(device)\n\n# 运行推理\nwith torch.no_grad():\n    outputs = model(**inputs)\n\n# 后处理输出\nresults = processor.post_process_grounded_object_detection(\n    outputs，\n    threshold=0.4，\n    target_sizes=[(image.height， image.width)]\n)\n\n# 获取第一个图像结果\nresult = results[0]\nfor box， score， labels in zip(result[\"boxes\"]， result[\"scores\"]， result[\"labels\"])：\n    box = [round(x， 2) for x in box.tolist()]\n    print(f\"Detected {labels} with confidence {round(score.item()， 3)} at location {box}\")\n```\n- 对于使用其他版本的用户，请参阅 [hf_readme](https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Ftree\u002Fmain\u002Fhf_model)。\n\n### 6 许可证\n\nLLMDet 根据 Apache 2.0 许可证发布。更多信息请参阅 LICENSE 文件。\n\n### 7 参考文献\n\n如果您认为我们的工作对您的研究有所帮助，请考虑引用我们的论文。\n\n```\n@article{fu2025llmdet,\n  title={LLMDet: Learning Strong Open-Vocabulary Object Detectors under the Supervision of Large Language Models},\n  author={Fu， Shenghao and Yang， Qize and Mo， Qijie and Yan， Junkai and Wei， Xihan and Meng， Jingke and Xie， Xiaohua and Zheng， Wei-Shi},\n  journal={arXiv preprint arXiv:2501.18954},\n  year={2025}\n}\n```\n\n### 8 致谢\n\n我们的 LLMDet 受到众多优秀开源工作的启发，其中包括：\n\n- [MM-Grounding-DINO](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmdetection\u002Ftree\u002Fmain\u002Fconfigs\u002Fmm_grounding_dino)\n- [LLaVA1.5](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002FLLaVA)\n- [LLaVA OneVision](https:\u002F\u002Fgithub.com\u002FLLaVA-VL\u002FLLaVA-NeXT)\n- [ShareGPT4V](https:\u002F\u002Fgithub.com\u002FShareGPT4Omni\u002FShareGPT4V)\n- [ASv2](https:\u002F\u002Fgithub.com\u002FOpenGVLab\u002Fall-seeing)\n- [RAM](https:\u002F\u002Fgithub.com\u002Fxinyu1205\u002Frecognize-anything)\n\n感谢上述项目作者开放其代码和资源！","# LLMDet 快速上手指南\n\nLLMDet 是一个在大语言模型（LLM）监督下学习的强开放词汇目标检测器。该项目已合并至官方 `transformers` 库，支持通过简单的代码调用实现强大的零样本物体检测能力。\n\n## 1. 环境准备\n\n### 系统要求\n- **Python**: 推荐 Python 3.8+\n- **GPU**: 支持 CUDA 的 NVIDIA 显卡（推荐显存 16GB+ 以运行大模型版本）\n- **操作系统**: Linux (Ubuntu\u002FCentOS) 或 Windows (WSL2 推荐)\n\n### 前置依赖\n核心依赖如下，建议创建独立的虚拟环境：\n- `pytorch` >= 2.2.1 (cu121)\n- `transformers` >= 4.55.0 (已原生集成 LLMDet)\n- `mmcv` == 2.2.0 (如需从头训练或修改配置)\n- `nltk` (用于演示中的短语定位功能)\n\n> **注意**：若需复现论文结果或使用完整训练功能，需安装 `mmcv`, `mmdetection` 等相关组件；若仅使用推理，仅需 `transformers` 即可。\n\n## 2. 安装步骤\n\n### 方案 A：快速推理安装（推荐）\n只需安装最新版 `transformers` 即可直接使用：\n\n```bash\npip install -U transformers torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n```\n\n*国内用户可使用清华源加速：*\n```bash\npip install -U transformers torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121 -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 方案 B：完整开发环境安装（含训练）\n如果需要从头训练或修改模型结构，请克隆源码并安装依赖：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet.git\ncd LLMDet\n\n# 安装核心依赖\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 安装 nltk 数据 (用于 Demo)\npython -c \"import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger'); nltk.download('stopwords')\"\n```\n\n## 3. 基本使用\n\n### 方法一：使用 Hugging Face Transformers (最简单)\n无需下载额外代码，几行代码即可实现开放词汇检测。\n\n```python\nimport torch\nfrom transformers import AutoModelForZeroShotObjectDetection, AutoProcessor\nfrom transformers.image_utils import load_image\n\n# 1. 加载模型和处理器\nmodel_id = \"iSEE-Laboratory\u002Fllmdet_tiny\"\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nprocessor = AutoProcessor.from_pretrained(model_id)\nmodel = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)\n\n# 2. 准备输入\nimage_url = \"http:\u002F\u002Fimages.cocodataset.org\u002Fval2017\u002F000000039769.jpg\"\nimage = load_image(image_url)\n# 支持任意文本标签，无需预定义类别\ntext_labels = [[\"a cat\", \"a remote control\"]] \ninputs = processor(images=image, text=text_labels, return_tensors=\"pt\").to(device)\n\n# 3. 推理\nwith torch.no_grad():\n    outputs = model(**inputs)\n\n# 4. 后处理与结果输出\nresults = processor.post_process_grounded_object_detection(\n    outputs,\n    threshold=0.4,\n    target_sizes=[(image.height, image.width)]\n)\n\nresult = results[0]\nfor box, score, labels in zip(result[\"boxes\"], result[\"scores\"], result[\"labels\"]):\n    box = [round(x, 2) for x in box.tolist()]\n    print(f\"Detected {labels} with confidence {round(score.item(), 3)} at location {box}\")\n```\n\n### 方法二：本地命令行 Demo\n如果您克隆了源代码，可以使用提供的脚本进行更丰富的测试（如短语定位、指代理解）。\n\n**开放词汇目标检测：**\n```bash\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'apple .' -c --pred-score-thr 0.4\n```\n\n**短语定位 (Phrase Grounding)：**\n```bash\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'There are many apples here.' --pred-score-thr 0.35\n```\n\n**指代性表达式理解：**\n```bash\npython image_demo.py images\u002Fdemo.jpeg \\\n  configs\u002Fgrounding_dino_swin_t.py --weight tiny.pth \\\n  --text 'red apple.' --tokens-positive -1 --pred-score-thr 0.4\n```\n\n> **提示**：首次运行上述命令前，请确保已从 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Ffushh7\u002FLLMDet) 或 [ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Ffushh7\u002FLLMDet) 下载对应的权重文件 (`tiny.pth` 等) 并放置在正确目录。","某电商平台的算法团队正致力于构建一个能自动识别海量商品图中长尾类别（如特定款式“复古铆钉包”或稀有“多肉植物”）的智能审核系统。\n\n### 没有 LLMDet 时\n- **冷启动困难**：面对从未在训练集中出现的新品类，传统检测器完全无法识别，必须重新收集数千张标注数据并重新训练模型。\n- **语义理解缺失**：模型只能机械匹配预定义类别 ID，无法理解“带流苏的红色手提包”这类复杂的自然语言描述，导致检索命中率极低。\n- **标注成本高昂**：为了覆盖更多类别，团队需耗费大量人力进行像素级区域标注，项目上线周期被严重拖延。\n- **泛化能力薄弱**：对于同一物体的不同形态或罕见视角，模型表现不稳定，漏检率居高不下。\n\n### 使用 LLMDet 后\n- **零样本即时检测**：借助大语言模型的监督能力，LLMDet 无需额外训练即可直接检测用户输入的任意新类别名称，实现真正的“开箱即用”。\n- **复杂指令精准响应**：模型能深度理解图像级详细标题与区域描述的关联，准确框选出符合“阳光下枯萎的仙人掌”等细粒度描述的目标。\n- **大幅降低标注依赖**：利用 LLM 自动生成的高质量图文对进行协同训练，减少了对昂贵人工区域标注的依赖，数据准备效率提升数倍。\n- **开放词汇性能跃升**：在 LVIS 等长尾数据集上，LLMDet 展现出远超基线的泛化能力，显著降低了稀有商品的漏检率。\n\nLLMDet 通过引入大语言模型的语义监督，彻底打破了传统目标检测器对封闭类别集的依赖，让视觉系统具备了像人类一样的开放认知与举一反三能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FiSEE-Laboratory_LLMDet_730a1d08.png","iSEE-Laboratory","iSEE","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FiSEE-Laboratory_ab9d488c.jpg",null,"https:\u002F\u002Fwww.isee-ai.cn\u002F~zhwshi\u002F","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory",[81,85,89,92,96],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.2,{"name":86,"color":87,"percentage":88},"Shell","#89e051",0.3,{"name":90,"color":91,"percentage":88},"JavaScript","#f1e05a",{"name":93,"color":94,"percentage":95},"HTML","#e34c26",0.2,{"name":97,"color":98,"percentage":99},"CSS","#663399",0,580,32,"2026-04-14T05:31:16","Apache-2.0","未说明","需要 NVIDIA GPU，CUDA 12.1 (基于 pytorch==2.2.1+cu121)，显存需求视模型大小而定 (Swin-L 大模型建议高显存)",{"notes":107,"python":104,"dependencies":108},"1. numpy 版本必须低于 1.24，推荐 1.22 或 1.23。2. 该工具已合并至官方 transformers==4.55.0，可直接安装最新版使用。3. 运行演示前需下载 nltk 数据包 (punkt, averaged_perceptron_tagger 等)。4. 训练需准备 GroundingCap-1M 数据集及多个预训练权重 (BERT, SigLIP, LLaVA-OneVision, Grounding DINO)。5. 推理时若不想加载 LLM，需在配置中设置 lmm=None。",[109,110,111,112,113,114,115,116,117,118],"pytorch==2.2.1+cu121","transformers==4.37.2 (或 >=4.55.0)","numpy\u003C1.24","mmcv==2.2.0","mmengine==0.10.5","timm","deepspeed","peft","nltk","pycocotools",[15,120],"其他","2026-03-27T02:49:30.150509","2026-04-15T04:26:15.858736",[124,129,134,139,144,149,154,158],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},33602,"配置文件中 ODVGDataset 的 actual_dataset_mode 设置为 'OD' 和 'VG' 有什么区别？","actual_dataset_mode 用于区分数据集的任务类型：'OD' 代表目标检测（Object Detection），通常使用带有明确边界框标注的数据集（如 COCO）；'VG' 代表视觉定位（Visual Grounding），使用包含短语和对应区域的数据集（如 Flickr30k, GQA）。虽然数据类型都是 ODVGDataset，但该参数告诉模型在训练时如何解析和处理标注信息以适应不同的任务模式。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F50",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},33603,"微调时遇到 'RuntimeError: torch.cat(): expected a non-empty list of Tensors' 错误怎么办？","该错误通常与数据标注或批次大小有关。解决方案包括：1. 检查数据集中的 grounding 字段，确保 caption 和 regions 匹配，特别是当某些样本没有对应的正样本时可能导致列表为空；2. 尝试调整 batchsize（例如从 1 调整为 2 或更大）；3. 更新依赖库版本（推荐 transformers 4.37.2, numpy 1.23.0, tokenizers 0.15.2）；4. 如果确实存在负样本（类别未出现在图中但保留在 caption 中），需要修改数据处理流程以正确处理这些情况，避免 cat 操作失败。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F63",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},33604,"LCS-558k 数据集的伪边界框（pseudo boxes）是如何生成的？","生成步骤如下：1. 使用传统语言解析器从图片标题（captions）中解析名词短语；2. 利用预训练的 MM Grounding DINO (Swin-L) 模型为每个短语生成边界框。使用的具体模型权重为：https:\u002F\u002Fdownload.openmmlab.com\u002Fmmdetection\u002Fv3.0\u002Fmm_grounding_dino\u002Fgrounding_dino_swin-l_pretrain_all\u002Fgrounding_dino_swin-l_pretrain_all-56d69e78.pth；3. 过滤掉生成边界框数量少于 3 个的图片；4. 将同一图片中的所有短语拼接作为 grounding text。代码参考附件 get_pseudo_box.txt。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F48",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},33605,"我的检测数据集没有长描述（long caption）和区域级描述，可以进行微调吗？","可以。即使没有长描述和区域级描述，您仍然可以使用该模型在纯检测数据集上进行微调以提升检测能力。您可以直接使用 MMDetection 官方的代码加载本项目的预训练权重（ckpt）进行微调。如果注释掉 LLM 相关部分，模型行为将退化为标准的 MM-Grounding-DINO。若希望利用开放预训练权重，也可以使用其他大模型（如 Qwen）生成英文描述来构建训练数据，目前模型主要支持英文。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F53",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},33606,"训练数据中的 'conversations' 和 'grounding' 字段分别是如何生成的？","数据生成过程分为两部分：1. 'grounding' 字段下的所有数据（包括 caption 和 regions）来源于 MM-GroundingDINO 对原始数据集的处理结果，保留了数据集的原始标注信息；2. 'conversations' 字段下的对话数据是使用 Qwen2-VL 模型生成的。具体的数据集准备流程可参考 MMDetection 官方文档：https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmdetection\u002Fblob\u002Fmain\u002Fconfigs\u002Fmm_grounding_dino\u002Fdataset_prepare.md。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F22",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},33607,"如何使用模型生成区域性描述和图像级描述？","该功能主要通过模型的投影层（Projection Layer）实现。相关的代码位于 llava\u002Fmodel\u002Fmultimodal_encoder\u002Fmm_grounding_dino.py。要使用此功能，您需要运行特定的训练或推理脚本（如 scripts\u002Fmy_pretrain.sh），确保加载了包含投影层的完整模型架构。这允许模型不仅进行检测，还能根据检测到的区域生成相应的文本描述。","https:\u002F\u002Fgithub.com\u002FiSEE-Laboratory\u002FLLMDet\u002Fissues\u002F36",{"id":155,"question_zh":156,"answer_zh":157,"source_url":133},33608,"Grounding 字段中的 caption 是否必须包含图像中出现的所有类别？","不一定。Grounding 字段中的 caption 是数据集的原始标注，它可以包含一些未在图像中实际出现的类别（即负样本），这对于训练模型的判别能力是有益的。如果您认为这些负样本重要，可以保留它们，但可能需要调整数据处理代码（特别是涉及 torch.cat 的部分）以确保程序能正常运行而不报错。",{"id":159,"question_zh":160,"answer_zh":161,"source_url":128},33609,"推荐的训练 Batch Size 是多少？","根据维护者的建议，Batch Size (bs) 设置为 16 效果较好，最低建议不要低于 8。如果在小样本数据集上微调遇到内存或报错问题，可以尝试适当调整 batchsize（例如从 1 增加到 2 或更高）来规避某些张量拼接错误。",[]]