[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-KaiyangZhou--deep-person-reid":3,"tool-KaiyangZhou--deep-person-reid":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 真正成长为懂上",155373,2,"2026-04-14T11:34:08",[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":75,"owner_location":75,"owner_email":75,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":107,"forks":108,"last_commit_at":109,"license":110,"difficulty_score":10,"env_os":111,"env_gpu":112,"env_ram":113,"env_deps":114,"category_tags":128,"github_topics":130,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":142,"updated_at":143,"faqs":144,"releases":174},7468,"KaiyangZhou\u002Fdeep-person-reid","deep-person-reid","Torchreid: Deep learning person re-identification in PyTorch.","deep-person-reid 是一个基于 PyTorch 开发的深度学习行人重识别（Re-ID）开源库，旨在帮助开发者高效训练和评估行人追踪模型。它的核心任务是解决“跨摄像头行人匹配”难题，即在不同监控视角下，准确判断出现的行人是否为同一人，广泛应用于智能安防与视频分析领域。\n\n该工具特别适合计算机视觉研究人员、算法工程师及高校学生使用。它极大地降低了 ReID 任务的门槛，提供了从数据准备、多 GPU 训练到端到端评估的一站式解决方案。用户不仅可以轻松调用多种业界领先的预训练模型，还能便捷地扩展自定义数据集或网络结构。\n\n其技术亮点在于高度的灵活性与实用性：支持图像与视频双重模态，内置多数据集联合训练及跨域评估的标准协议，并集成了 TensorBoard 等可视化手段。此外，项目持续更新，近期已支持将模型导出为 ONNX、OpenVINO 和 TFLite 格式，便于在边缘设备部署；同时收录了著名的 OSNet 架构及其在域泛化方面的最新研究成果，是探索通用性行人重识别技术的理想起点。","Torchreid\n===========\nTorchreid is a library for deep-learning person re-identification, written in `PyTorch \u003Chttps:\u002F\u002Fpytorch.org\u002F>`_ and developed for our ICCV'19 project, `Omni-Scale Feature Learning for Person Re-Identification \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_.\n\nIt features:\n\n- multi-GPU training\n- support both image- and video-reid\n- end-to-end training and evaluation\n- incredibly easy preparation of reid datasets\n- multi-dataset training\n- cross-dataset evaluation\n- standard protocol used by most research papers\n- highly extensible (easy to add models, datasets, training methods, etc.)\n- implementations of state-of-the-art deep reid models\n- access to pretrained reid models\n- advanced training techniques\n- visualization tools (tensorboard, ranks, etc.)\n\n\nCode: https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid.\n\nDocumentation: https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002F.\n\nHow-to instructions: https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002Fuser_guide.\n\nModel zoo: https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO.\n\nTech report: https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.10093.\n\nYou can find some research projects that are built on top of Torchreid `here \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Ftree\u002Fmaster\u002Fprojects>`_.\n\nThe model weights are also available on Huggingface: https:\u002F\u002Fhuggingface.co\u002Fkaiyangzhou\u002Fosnet.\n\n\nWhat's new\n------------\n- [Aug 2022] We have added model export capabilities to the following frameworks: ONNX, OpenVINO and TFLite. The export script can be found `here \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftools\u002Fexport.py>`_\n- [Aug 2021] We have released the ImageNet-pretrained models of ``osnet_ain_x0_75``, ``osnet_ain_x0_5`` and ``osnet_ain_x0_25``. The pretraining setup follows `pycls \u003Chttps:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fpycls\u002Fblob\u002Fmaster\u002Fconfigs\u002Farchive\u002Fimagenet\u002Fresnet\u002FR-50-1x64d_step_8gpu.yaml>`_.\n- [Apr 2021] We have updated the appendix in the `TPAMI version of OSNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06827v5>`_ to include results in the multi-source domain generalization setting. The trained models can be found in the `Model Zoo \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO.html>`_.\n- [Apr 2021] We have added a script to automate the process of calculating average results over multiple splits. For more details please see ``tools\u002Fparse_test_res.py``.\n- [Apr 2021] ``v1.4.0``: We added the person search dataset, `CUHK-SYSU \u003Chttp:\u002F\u002Fwww.ee.cuhk.edu.hk\u002F~xgwang\u002FPS\u002Fdataset.html>`_.  Please see the `documentation \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002F>`_ regarding how to download the dataset (it contains cropped person images).\n- [Apr 2021] All models in the model zoo have been moved to google drive. Please raise an issue if any model's performance is inconsistent with the numbers shown in the model zoo page (could be caused by wrong links).\n- [Mar 2021] `OSNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06827>`_ will appear in the TPAMI journal! Compared with the conference version, which focuses on discriminative feature learning using the omni-scale building block, this journal extension further considers generalizable feature learning by integrating `instance normalization layers \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1607.08022>`_ with the OSNet architecture. We hope this journal paper can motivate more future work to taclke the generalization issue in cross-dataset re-ID.\n- [Mar 2021] Generalization across domains (datasets) in person re-ID is crucial in real-world applications, which is closely related to the topic of *domain generalization*. Interested in learning how the field of domain generalization has developed over the last decade? Check our recent survey in this topic at https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.02503, with coverage on the history, datasets, related problems, methodologies, potential directions, and so on (*methods designed for generalizable re-ID are also covered*!).\n- [Feb 2021] ``v1.3.6`` Added `University-1652 \u003Chttps:\u002F\u002Fdl.acm.org\u002Fdoi\u002Fabs\u002F10.1145\u002F3394171.3413896>`_, a new dataset for multi-view multi-source geo-localization (credit to `Zhedong Zheng \u003Chttps:\u002F\u002Fgithub.com\u002Flayumi>`_).\n- [Feb 2021] ``v1.3.5``: Now the `cython code \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fpull\u002F412>`_ works on Windows (credit to `lablabla \u003Chttps:\u002F\u002Fgithub.com\u002Flablabla>`_).\n- [Jan 2021] Our recent work, `MixStyle \u003Chttps:\u002F\u002Fopenreview.net\u002Fforum?id=6xHJ37MVxxp>`_ (mixing instance-level feature statistics of samples of different domains for improving domain generalization), has been accepted to ICLR'21. The code has been released at https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fmixstyle-release where the person re-ID part is based on Torchreid.\n- [Jan 2021] A new evaluation metric called `mean Inverse Negative Penalty (mINP)` for person re-ID has been introduced in `Deep Learning for Person Re-identification: A Survey and Outlook (TPAMI 2021) \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F2001.04193>`_. Their code can be accessed at `\u003Chttps:\u002F\u002Fgithub.com\u002Fmangye16\u002FReID-Survey>`_.\n- [Aug 2020] ``v1.3.3``: Fixed bug in ``visrank`` (caused by not unpacking ``dsetid``).\n- [Aug 2020] ``v1.3.2``: Added ``_junk_pids`` to ``grid`` and ``prid``. This avoids using mislabeled gallery images for training when setting ``combineall=True``.\n- [Aug 2020] ``v1.3.0``: (1) Added ``dsetid`` to the existing 3-tuple data source, resulting in ``(impath, pid, camid, dsetid)``. This variable denotes the dataset ID and is useful when combining multiple datasets for training (as a dataset indicator). E.g., when combining ``market1501`` and ``cuhk03``, the former will be assigned ``dsetid=0`` while the latter will be assigned ``dsetid=1``. (2) Added ``RandomDatasetSampler``. Analogous to ``RandomDomainSampler``, ``RandomDatasetSampler`` samples a certain number of images (``batch_size \u002F\u002F num_datasets``) from each of specified datasets (the amount is determined by ``num_datasets``).\n- [Aug 2020] ``v1.2.6``: Added ``RandomDomainSampler`` (it samples ``num_cams`` cameras each with ``batch_size \u002F\u002F num_cams`` images to form a mini-batch).\n- [Jun 2020] ``v1.2.5``: (1) Dataloader's output from ``__getitem__`` has been changed from ``list`` to ``dict``. Previously, an element, e.g. image tensor, was fetched with ``imgs=data[0]``. Now it should be obtained by ``imgs=data['img']``. See this `commit \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002Faefe335d68f39a20160860e6d14c2d34f539b8a5>`_ for detailed changes. (2) Added ``k_tfm`` as an option to image data loader, which allows data augmentation to be applied ``k_tfm`` times *independently* to an image. If ``k_tfm > 1``, ``imgs=data['img']`` returns a list with ``k_tfm`` image tensors.\n- [May 2020] Added the person attribute recognition code used in `Omni-Scale Feature Learning for Person Re-Identification (ICCV'19) \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_. See ``projects\u002Fattribute_recognition\u002F``.\n- [May 2020] ``v1.2.1``: Added a simple API for feature extraction (``torchreid\u002Futils\u002Ffeature_extractor.py``). See the `documentation \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002Fuser_guide.html>`_ for the instruction.\n- [Apr 2020] Code for reproducing the experiments of `deep mutual learning \u003Chttps:\u002F\u002Fzpascal.net\u002Fcvpr2018\u002FZhang_Deep_Mutual_Learning_CVPR_2018_paper.pdf>`_ in the `OSNet paper \u003Chttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1905.00953v6.pdf>`__ (Supp. B) has been released at ``projects\u002FDML``.\n- [Apr 2020] Upgraded to ``v1.2.0``. The engine class has been made more model-agnostic to improve extensibility. See `Engine \u003Ctorchreid\u002Fengine\u002Fengine.py>`_ and `ImageSoftmaxEngine \u003Ctorchreid\u002Fengine\u002Fimage\u002Fsoftmax.py>`_ for more details. Credit to `Dassl.pytorch \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002FDassl.pytorch>`_.\n- [Dec 2019] Our `OSNet paper \u003Chttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1905.00953v6.pdf>`_ has been updated, with additional experiments (in section B of the supplementary) showing some useful techniques for improving OSNet's performance in practice.\n- [Nov 2019] ``ImageDataManager`` can load training data from target datasets by setting ``load_train_targets=True``, and the train-loader can be accessed with ``train_loader_t = datamanager.train_loader_t``. This feature is useful for domain adaptation research.\n\n\nInstallation\n---------------\n\nMake sure `conda \u003Chttps:\u002F\u002Fwww.anaconda.com\u002Fdistribution\u002F>`_ is installed.\n\n\n.. code-block:: bash\n\n    # cd to your preferred directory and clone this repo\n    git clone https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid.git\n\n    # create environment\n    cd deep-person-reid\u002F\n    conda create --name torchreid python=3.7\n    conda activate torchreid\n\n    # install dependencies\n    # make sure `which python` and `which pip` point to the correct path\n    pip install -r requirements.txt\n\n    # install torch and torchvision (select the proper cuda version to suit your machine)\n    conda install pytorch torchvision cudatoolkit=9.0 -c pytorch\n\n    # install torchreid (don't need to re-build it if you modify the source code)\n    python setup.py develop\n\nAnother way to install is to run everything inside docker container:\n\n- build: ``make build-image``\n- run: ``make run``\n\nGet started: 30 seconds to Torchreid\n-------------------------------------\n1. Import ``torchreid``\n\n.. code-block:: python\n    \n    import torchreid\n\n2. Load data manager\n\n.. code-block:: python\n    \n    datamanager = torchreid.data.ImageDataManager(\n        root=\"reid-data\",\n        sources=\"market1501\",\n        targets=\"market1501\",\n        height=256,\n        width=128,\n        batch_size_train=32,\n        batch_size_test=100,\n        transforms=[\"random_flip\", \"random_crop\"]\n    )\n\n3 Build model, optimizer and lr_scheduler\n\n.. code-block:: python\n    \n    model = torchreid.models.build_model(\n        name=\"resnet50\",\n        num_classes=datamanager.num_train_pids,\n        loss=\"softmax\",\n        pretrained=True\n    )\n\n    model = model.cuda()\n\n    optimizer = torchreid.optim.build_optimizer(\n        model,\n        optim=\"adam\",\n        lr=0.0003\n    )\n\n    scheduler = torchreid.optim.build_lr_scheduler(\n        optimizer,\n        lr_scheduler=\"single_step\",\n        stepsize=20\n    )\n\n4. Build engine\n\n.. code-block:: python\n    \n    engine = torchreid.engine.ImageSoftmaxEngine(\n        datamanager,\n        model,\n        optimizer=optimizer,\n        scheduler=scheduler,\n        label_smooth=True\n    )\n\n5. Run training and test\n\n.. code-block:: python\n    \n    engine.run(\n        save_dir=\"log\u002Fresnet50\",\n        max_epoch=60,\n        eval_freq=10,\n        print_freq=10,\n        test_only=False\n    )\n\n\nA unified interface\n-----------------------\nIn \"deep-person-reid\u002Fscripts\u002F\", we provide a unified interface to train and test a model. See \"scripts\u002Fmain.py\" and \"scripts\u002Fdefault_config.py\" for more details. The folder \"configs\u002F\" contains some predefined configs which you can use as a starting point.\n\nBelow we provide an example to train and test `OSNet (Zhou et al. ICCV'19) \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_. Assume :code:`PATH_TO_DATA` is the directory containing reid datasets. The environmental variable :code:`CUDA_VISIBLE_DEVICES` is omitted, which you need to specify if you have a pool of gpus and want to use a specific set of them.\n\nConventional setting\n^^^^^^^^^^^^^^^^^^^^^\n\nTo train OSNet on Market1501, do\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    --transforms random_flip random_erase \\\n    --root $PATH_TO_DATA\n\n\nThe config file sets Market1501 as the default dataset. If you wanna use DukeMTMC-reID, do\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    -s dukemtmcreid \\\n    -t dukemtmcreid \\\n    --transforms random_flip random_erase \\\n    --root $PATH_TO_DATA \\\n    data.save_dir log\u002Fosnet_x1_0_dukemtmcreid_softmax_cosinelr\n\nThe code will automatically (download and) load the ImageNet pretrained weights. After the training is done, the model will be saved as \"log\u002Fosnet_x1_0_market1501_softmax_cosinelr\u002Fmodel.pth.tar-250\". Under the same folder, you can find the `tensorboard \u003Chttps:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftensorboard.html>`_ file. To visualize the learning curves using tensorboard, you can run :code:`tensorboard --logdir=log\u002Fosnet_x1_0_market1501_softmax_cosinelr` in the terminal and visit :code:`http:\u002F\u002Flocalhost:6006\u002F` in your web browser.\n\nEvaluation is automatically performed at the end of training. To run the test again using the trained model, do\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    --root $PATH_TO_DATA \\\n    model.load_weights log\u002Fosnet_x1_0_market1501_softmax_cosinelr\u002Fmodel.pth.tar-250 \\\n    test.evaluate True\n\n\nCross-domain setting\n^^^^^^^^^^^^^^^^^^^^^\n\nSuppose you wanna train OSNet on DukeMTMC-reID and test its performance on Market1501, you can do\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad.yaml \\\n    -s dukemtmcreid \\\n    -t market1501 \\\n    --transforms random_flip color_jitter \\\n    --root $PATH_TO_DATA\n\nHere we only test the cross-domain performance. However, if you also want to test the performance on the source dataset, i.e. DukeMTMC-reID, you can set :code:`-t dukemtmcreid market1501`, which will evaluate the model on the two datasets separately.\n\nDifferent from the same-domain setting, here we replace :code:`random_erase` with :code:`color_jitter`. This can improve the generalization performance on the unseen target dataset.\n\nPretrained models are available in the `Model Zoo \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO.html>`_.\n\n\nDatasets\n--------\n\nImage-reid datasets\n^^^^^^^^^^^^^^^^^^^^^\n- `Market1501 \u003Chttps:\u002F\u002Fwww.cv-foundation.org\u002Fopenaccess\u002Fcontent_iccv_2015\u002Fpapers\u002FZheng_Scalable_Person_Re-Identification_ICCV_2015_paper.pdf>`_\n- `CUHK03 \u003Chttps:\u002F\u002Fwww.cv-foundation.org\u002Fopenaccess\u002Fcontent_cvpr_2014\u002Fpapers\u002FLi_DeepReID_Deep_Filter_2014_CVPR_paper.pdf>`_\n- `DukeMTMC-reID \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1701.07717>`_\n- `MSMT17 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.08565>`_\n- `VIPeR \u003Chttp:\u002F\u002Fciteseerx.ist.psu.edu\u002Fviewdoc\u002Fdownload?doi=10.1.1.331.7285&rep=rep1&type=pdf>`_\n- `GRID \u003Chttp:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~txiang\u002Fpublications\u002FLoyXiangGong_cvpr_2009.pdf>`_\n- `CUHK01 \u003Chttp:\u002F\u002Fwww.ee.cuhk.edu.hk\u002F~xgwang\u002Fpapers\u002FliZWaccv12.pdf>`_\n- `SenseReID \u003Chttp:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_cvpr_2017\u002Fpapers\u002FZhao_Spindle_Net_Person_CVPR_2017_paper.pdf>`_\n- `QMUL-iLIDS \u003Chttp:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~sgg\u002Fpapers\u002FZhengGongXiang_BMVC09.pdf>`_\n- `PRID \u003Chttps:\u002F\u002Fpdfs.semanticscholar.org\u002F4c1b\u002Ff0592be3e535faf256c95e27982db9b3d3d3.pdf>`_\n\nGeo-localization datasets\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n- `University-1652 \u003Chttps:\u002F\u002Fdl.acm.org\u002Fdoi\u002Fabs\u002F10.1145\u002F3394171.3413896>`_\n\nVideo-reid datasets\n^^^^^^^^^^^^^^^^^^^^^^^\n- `MARS \u003Chttp:\u002F\u002Fwww.liangzheng.org\u002F1320.pdf>`_\n- `iLIDS-VID \u003Chttps:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~sgg\u002Fpapers\u002FWangEtAl_ECCV14.pdf>`_\n- `PRID2011 \u003Chttps:\u002F\u002Fpdfs.semanticscholar.org\u002F4c1b\u002Ff0592be3e535faf256c95e27982db9b3d3d3.pdf>`_\n- `DukeMTMC-VideoReID \u003Chttp:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_cvpr_2018\u002Fpapers\u002FWu_Exploit_the_Unknown_CVPR_2018_paper.pdf>`_\n\n\nModels\n-------\n\nImageNet classification models\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n- `ResNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1512.03385>`_\n- `ResNeXt \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1611.05431>`_\n- `SENet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1709.01507>`_\n- `DenseNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1608.06993>`_\n- `Inception-ResNet-V2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07261>`_\n- `Inception-V4 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07261>`_\n- `Xception \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1610.02357>`_\n- `IBN-Net \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1807.09441>`_\n\nLightweight models\n^^^^^^^^^^^^^^^^^^^\n- `NASNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1707.07012>`_\n- `MobileNetV2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1801.04381>`_\n- `ShuffleNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1707.01083>`_\n- `ShuffleNetV2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1807.11164>`_\n- `SqueezeNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07360>`_\n\nReID-specific models\n^^^^^^^^^^^^^^^^^^^^^^\n- `MuDeep \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1709.05165>`_\n- `ResNet-mid \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.08106>`_\n- `HACNN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1802.08122>`_\n- `PCB \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.09349>`_\n- `MLFN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1803.09132>`_\n- `OSNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_\n- `OSNet-AIN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06827>`_\n\n\nUseful links\n-------------\n- `OSNet-IBN1-Lite (test-only code with lite docker container) \u003Chttps:\u002F\u002Fgithub.com\u002FRodMech\u002FOSNet-IBN1-Lite>`_\n- `Deep Learning for Person Re-identification: A Survey and Outlook \u003Chttps:\u002F\u002Fgithub.com\u002Fmangye16\u002FReID-Survey>`_\n\n\nCitation\n---------\nIf you use this code or the models in your research, please give credit to the following papers:\n\n.. code-block:: bash\n\n    @article{torchreid,\n      title={Torchreid: A Library for Deep Learning Person Re-Identification in Pytorch},\n      author={Zhou, Kaiyang and Xiang, Tao},\n      journal={arXiv preprint arXiv:1910.10093},\n      year={2019}\n    }\n    \n    @inproceedings{zhou2019osnet,\n      title={Omni-Scale Feature Learning for Person Re-Identification},\n      author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},\n      booktitle={ICCV},\n      year={2019}\n    }\n\n    @article{zhou2021osnet,\n      title={Learning Generalisable Omni-Scale Representations for Person Re-Identification},\n      author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},\n      journal={TPAMI},\n      year={2021}\n    }\n","Torchreid\n===========\nTorchreid 是一个基于 `PyTorch \u003Chttps:\u002F\u002Fpytorch.org\u002F>`_ 编写的深度学习行人重识别库，专为我们在 ICCV'19 上发表的项目——“面向行人重识别的全尺度特征学习”（`arXiv:1905.00953 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_）而开发。\n\n其主要特性包括：\n\n- 多 GPU 训练\n- 同时支持图像和视频的行人重识别任务\n- 端到端的训练与评估\n- 极其简便的重识别数据集准备流程\n- 多数据集联合训练\n- 跨数据集评估\n- 采用大多数研究论文通用的标准协议\n- 高度可扩展性（易于添加模型、数据集、训练方法等）\n- 实现了当前最先进的深度行人重识别模型\n- 提供预训练的重识别模型\n- 先进的训练技巧\n- 可视化工具（TensorBoard、Rank 指标等）\n\n\n代码：https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid。\n\n文档：https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002F。\n\n使用指南：https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002Fuser_guide。\n\n模型库：https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO。\n\n技术报告：https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.10093。\n\n基于 Torchreid 构建的一些研究项目可以在这里找到：`https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Ftree\u002Fmaster\u002Fprojects`_。\n\n模型权重也在 Hugging Face 上提供：https:\u002F\u002Fhuggingface.co\u002Fkaiyangzhou\u002Fosnet。\n\n新增内容\n------------\n- [2022年8月] 我们为以下框架添加了模型导出功能：ONNX、OpenVINO 和 TFLite。导出脚本可在此处找到：`here \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftools\u002Fexport.py>`_\n- [2021年8月] 我们发布了 ``osnet_ain_x0_75``、``osnet_ain_x0_5`` 和 ``osnet_ain_x0_25`` 的 ImageNet 预训练模型。预训练设置遵循 `pycls \u003Chttps:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fpycls\u002Fblob\u002Fmaster\u002Fconfigs\u002Farchive\u002Fimagenet\u002Fresnet\u002FR-50-1x64d_step_8gpu.yaml>`_。\n- [2021年4月] 我们更新了 OSNet 的 TPAMI 版本附录，以包含多源域泛化设置下的结果。训练好的模型可在 `Model Zoo \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO.html>`_ 中找到。\n- [2021年4月] 我们添加了一个脚本，用于自动化计算多个划分的平均结果的过程。更多详情请参阅 ``tools\u002Fparse_test_res.py``。\n- [2021年4月] ``v1.4.0``：我们增加了行人搜索数据集 `CUHK-SYSU \u003Chttp:\u002F\u002Fwww.ee.cuhk.edu.hk\u002F~xgwang\u002FPS\u002Fdataset.html>`_。请参阅 `文档 \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002F>`_ 了解如何下载该数据集（其中包含裁剪后的行人图像）。\n- [2021年4月] 模型库中的所有模型已迁移到 Google Drive。如果任何模型的性能与模型库页面上显示的数字不一致，请提交 issue（可能是链接错误所致）。\n- [2021年3月] `OSNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06827>`_ 将发表在 TPAMI 期刊上！与专注于使用全尺度构建模块进行判别特征学习的会议版本相比，该期刊扩展版进一步考虑了通过将 `实例归一化层 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1607.08022>`_ 整合到 OSNet 架构中来实现可泛化特征学习。我们希望这篇期刊论文能够激励更多的未来工作，以解决跨数据集重识别中的泛化问题。\n- [2021年3月] 行人重识别中跨域（数据集）的泛化在实际应用中至关重要，这与 *域泛化* 主题密切相关。您是否想了解过去十年中域泛化领域的发展情况？请查看我们在该主题上的最新综述：https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.02503，其中涵盖了历史、数据集、相关问题、方法论、潜在方向等内容（*适用于可泛化重识别的方法也包含在内*！）。\n- [2021年2月] ``v1.3.6`` 新增了 `University-1652 \u003Chttps:\u002F\u002Fdl.acm.org\u002Fdoi\u002Fabs\u002F10.1145\u002F3394171.3413896>`_，这是一个用于多视角多源地理定位的新数据集（感谢 `Zhedong Zheng \u003Chttps:\u002F\u002Fgithub.com\u002Flayumi>`_）。\n- [2021年2月] ``v1.3.5``：现在 `cython 代码 \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fpull\u002F412>`_ 可以在 Windows 上运行（感谢 `lablabla \u003Chttps:\u002F\u002Fgithub.com\u002Flablabla>`_）。\n- [2021年1月] 我们的最新工作 `MixStyle \u003Chttps:\u002F\u002Fopenreview.net\u002Fforum?id=6xHJ37MVxxp>`_（混合不同域样本的实例级特征统计以提高域泛化能力）已被 ICLR'21 接受。代码已在 https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fmixstyle-release 上发布，其中行人重识别部分基于 Torchreid。\n- [2021年1月] 在 `深度学习在行人重识别中的应用：综述与展望（TPAMI 2021） \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F2001.04193>`_ 中，引入了一种新的行人重识别评估指标，称为 `平均逆向负惩罚 (mINP)`。其代码可在 `\u003Chttps:\u002F\u002Fgithub.com\u002Fmangye16\u002FReID-Survey>`_ 获取。\n- [2020年8月] ``v1.3.3``：修复了 ``visrank`` 中的 bug（由于未解包 ``dsetid`` 所致）。\n- [2020年8月] ``v1.3.2``：在 ``grid`` 和 ``prid`` 中添加了 ``_junk_pids``。这样可以在设置 ``combineall=True`` 时避免使用标记错误的图库图像进行训练。\n- [2020年8月] ``v1.3.0``：(1) 在现有的三元组数据源中添加了 ``dsetid``，从而得到 ``(impath, pid, camid, dsetid)``。该变量表示数据集 ID，在合并多个数据集进行训练时非常有用（作为数据集标识）。例如，当合并 ``market1501`` 和 ``cuhk03`` 时，前者将被分配 ``dsetid=0``，而后者则被分配 ``dsetid=1``。 (2) 添加了 ``RandomDatasetSampler``。类似于 ``RandomDomainSampler``，``RandomDatasetSampler`` 会从每个指定的数据集中抽取一定数量的图像（``batch_size \u002F\u002F num_datasets``），抽取的数量由 ``num_datasets`` 决定。\n- [2020年8月] ``v1.2.6``：添加了 ``RandomDomainSampler``（它会从 ``num_cams`` 个摄像头中各抽取 ``batch_size \u002F\u002F num_cams`` 张图像，组成一个小批次）。\n- [2020年6月] ``v1.2.5``：(1) 数据加载器从 ``__getitem__`` 返回的结果由原来的 ``list`` 改为 ``dict``。以前，可以通过 ``imgs=data[0]`` 来获取某个元素，比如图像张量。现在则应通过 ``imgs=data['img']`` 来获取。有关详细更改，请参阅此 `提交 \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002Faefe335d68f39a20160860e6d14c2d34f539b8a5>`_。 (2) 添加了 ``k_tfm`` 作为图像数据加载器的一个选项，允许对一张图像独立地应用 ``k_tfm`` 次数据增强。如果 ``k_tfm > 1``，``imgs=data['img']`` 将返回一个包含 ``k_tfm`` 张图像张量的列表。\n- [2020年5月] 添加了用于 `面向行人重识别的全尺度特征学习（ICCV'19） \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_ 中的行人属性识别代码。请参阅 ``projects\u002Fattribute_recognition\u002F``。\n- [2020年5月] ``v1.2.1``：添加了一个简单的特征提取 API（``torchreid\u002Futils\u002Ffeature_extractor.py``）。有关说明，请参阅 `文档 \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002Fuser_guide.html>`_。\n- [2020年4月] 用于复现 `深度互学习 \u003Chttps:\u002F\u002Fzpascal.net\u002Fcvpr2018\u002FZhang_Deep_Mutual_Learning_CVPR_2018_paper.pdf>`_ 实验的代码，已在 `OSNet 论文 \u003Chttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1905.00953v6.pdf>`_（补充 B）的 `projects\u002FDML` 中发布。\n- [2020年4月] 升级至 ``v1.2.0``。引擎类变得更加模型无关，以提高可扩展性。有关详细信息，请参阅 `Engine \u003Ctorchreid\u002Fengine\u002Fengine.py>`_ 和 `ImageSoftmaxEngine \u003Ctorchreid\u002Fengine\u002Fimage\u002Fsoftmax.py>`_。感谢 `Dassl.pytorch \u003Chttps:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002FDassl.pytorch>`_。\n- [2019年12月] 我们的 `OSNet 论文 \u003Chttps:\u002F\u002Farxiv.org\u002Fpdf\u002F1905.00953v6.pdf>`_ 已更新，补充部分 B 中增加了额外的实验，展示了一些在实践中提升 OSNet 性能的实用技术。\n- [2019年11月] `ImageDataManager`` 可以通过设置 ``load_train_targets=True`` 从目标数据集加载训练数据，并可通过 ``train_loader_t = datamanager.train_loader_t`` 访问训练加载器。此功能对域适应研究非常有用。\n\n\n安装\n-------\n确保已安装 `conda \u003Chttps:\u002F\u002Fwww.anaconda.com\u002Fdistribution\u002F>`_。\n\n\n.. code-block:: bash\n\n# 切换到您 preferred 的目录并克隆此仓库\n    git clone https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid.git\n\n    # 创建环境\n    cd deep-person-reid\u002F\n    conda create --name torchreid python=3.7\n    conda activate torchreid\n\n    # 安装依赖\n    # 确保 `which python` 和 `which pip` 指向正确的路径\n    pip install -r requirements.txt\n\n    # 安装 PyTorch 和 torchvision（根据您的机器选择合适的 CUDA 版本）\n    conda install pytorch torchvision cudatoolkit=9.0 -c pytorch\n\n    # 安装 torchreid（如果您修改了源代码，则无需重新构建）\n    python setup.py develop\n\n另一种安装方式是在 Docker 容器中运行所有步骤：\n\n- 构建：``make build-image``\n- 运行：``make run``\n\n快速入门：30 秒掌握 Torchreid\n-------------------------------------\n1. 导入 ``torchreid``\n\n.. code-block:: python\n    \n    import torchreid\n\n2. 加载数据管理器\n\n.. code-block:: python\n    \n    datamanager = torchreid.data.ImageDataManager(\n        root=\"reid-data\",\n        sources=\"market1501\",\n        targets=\"market1501\",\n        height=256,\n        width=128,\n        batch_size_train=32,\n        batch_size_test=100,\n        transforms=[\"random_flip\", \"random_crop\"]\n    )\n\n3 构建模型、优化器和学习率调度器\n\n.. code-block:: python\n    \n    model = torchreid.models.build_model(\n        name=\"resnet50\",\n        num_classes=datamanager.num_train_pids,\n        loss=\"softmax\",\n        pretrained=True\n    )\n\n    model = model.cuda。\n\n    optimizer = torchreid.optim.build_optimizer(\n        model,\n        optim=\"adam\",\n        lr=0.0003\n    )\n\n    scheduler = torchreid.optim.build_lr_scheduler(\n        optimizer,\n        lr_scheduler=\"single_step\",\n        stepsize=20\n    )\n\n4. 构建训练引擎\n\n.. code-block:: python\n    \n    engine = torchreid.engine.ImageSoftmaxEngine(\n        datamanager,\n        model,\n        optimizer=optimizer,\n        scheduler=scheduler,\n        label_smooth=True\n    )\n\n5. 开始训练和测试\n\n.. code-block:: python\n    \n    engine.run(\n        save_dir=\"log\u002Fresnet50\",\n        max_epoch=60,\n        eval_freq=10,\n        print_freq=10,\n        test_only=False\n    )\n\n\n统一接口\n-----------------------\n在“deep-person-reid\u002Fscripts\u002F”中，我们提供了一个统一的接口来训练和测试模型。更多细节请参阅“scripts\u002Fmain.py”和“scripts\u002Fdefault_config.py”。文件夹“configs\u002F”包含一些预定义的配置文件，您可以将其作为起点。\n\n下面提供一个训练和测试 `OSNet (Zhou et al. ICCV'19) \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_ 的示例。假设 :code:`PATH_TO_DATA` 是包含 reid 数据集的目录。环境变量 :code:`CUDA_VISIBLE_DEVICES` 被省略，如果您有一组 GPU 并希望使用其中特定的一组，则需要指定该变量。\n\n常规设置\n^^^^^^^^^^^^^^^^^\n\n要在 Market1501 上训练 OSNet，请执行以下命令：\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    --transforms random_flip random_erase \\\n    --root $PATH_TO_DATA\n\n\n配置文件将 Market1501 设置为默认数据集。如果您想使用 DukeMTMC-reID，则可以执行以下命令：\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    -s dukemtmcreid \\\n    -t dukemtmcreid \\\n    --transforms random_flip random_erase \\\n    --root $PATH_TO_DATA \\\n    data.save_dir log\u002Fosnet_x1_0_dukemtmcreid_softmax_cosinelr\n\n代码会自动（下载并）加载 ImageNet 预训练权重。训练完成后，模型将保存为 “log\u002Fosnet_x1_0_market1501_softmax_cosinelr\u002Fmodel.pth.tar-250”。在同一文件夹下，您还可以找到 `tensorboard \u003Chttps:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftensorboard.html>`_ 文件。要使用 tensorboard 可视化学习曲线，可以在终端中运行 :code:`tensorboard --logdir=log\u002Fosnet_x1_0_market1501_softmax_cosinelr`，然后在浏览器中访问 :code:`http:\u002F\u002Flocalhost:6006\u002F`。\n\n训练结束时会自动进行评估。要使用已训练好的模型再次进行测试，可以执行以下命令：\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n    --root $PATH_TO_DATA \\\n    model.load_weights log\u002Fosnet_x1_0_market1501_softmax_cosinelr\u002Fmodel.pth.tar-250 \\\n    test.evaluate True\n\n\n跨域设置\n^^^^^^^^^^^^^^^^^\n\n假设您想在 DukeMTMC-reID 上训练 OSNet，并在 Market1501 上测试其性能，可以执行以下命令：\n\n.. code-block:: bash\n\n    python scripts\u002Fmain.py \\\n    --config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad.yaml \\\n    -s dukemtmcreid \\\n    -t market1501 \\\n    --transforms random_flip color_jitter \\\n    --root $PATH_TO_DATA\n\n在这里，我们仅测试跨域性能。然而，如果您还想测试源数据集（即 DukeMTMC-reID）上的性能，可以设置 :code:`-t dukemtmcreid market1501`，这将分别在两个数据集上评估模型。\n\n与同域设置不同，这里我们将 :code:`random_erase` 替换为 :code:`color_jitter`。这可以提高模型在未见过的目标数据集上的泛化能力。\n\n预训练模型可在 `Model Zoo \u003Chttps:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002FMODEL_ZOO.html>`_ 中找到。\n\n\n数据集\n--------\n\n图像 reid 数据集\n^^^^^^^^^^^^^^^^^^^^^\n- `Market1501 \u003Chttps:\u002F\u002Fwww.cv-foundation.org\u002Fopenaccess\u002Fcontent_iccv_2015\u002Fpapers\u002FZheng_Scalable_Person_Re-Identification_ICCV_2015_paper.pdf>`_\n- `CUHK03 \u003Chttps:\u002F\u002Fwww.cv-foundation.org\u002Fopenaccess\u002Fcontent_cvpr_2014\u002Fpapers\u002FLi_DeepReID_Deep_Filter_2014_CVPR_paper.pdf>`_\n- `DukeMTMC-reID \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1701.07717>`_\n- `MSMT17 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.08565>`_\n- `VIPeR \u003Chttp:\u002F\u002Fciteseerx.ist.psu.edu\u002Fviewdoc\u002Fdownload?doi=10.1.1.331.7285&rep=rep1&type=pdf>`_\n- `GRID \u003Chttp:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~txiang\u002Fpublications\u002FLoyXiangGong_cvpr_2009.pdf>`_\n- `CUHK01 \u003Chttp:\u002F\u002Fwww.ee.cuhk.edu.hk\u002F~xgwang\u002Fpapers\u002FliZWaccv12.pdf>`_\n- `SenseReID \u003Chttp:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_cvpr_2017\u002Fpapers\u002FZhao_Spindle_Net_Person_CVPR_2017_paper.pdf>`_\n- `QMUL-iLIDS \u003Chttp:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~sgg\u002Fpapers\u002FZhengGongXiang_BMVC09.pdf>`_\n- `PRID \u003Chttps:\u002F\u002Fpdfs.semanticscholar.org\u002F4c1b\u002Ff0592be3e535faf256c95e27982db9b3d3d3.pdf>`_\n\n地理定位数据集\n^^^^^^^^^^^^^^^^^^^^^^^\n- `University-1652 \u003Chttps:\u002F\u002Fdl.acm.org\u002Fdoi\u002Fabs\u002F10.1145\u002F3394171.3413896>`_\n\n视频 reid 数据集\n^^^^^^^^^^^^^^^^^^^^^^^\n- `MARS \u003Chttp:\u002F\u002Fwww.liangzheng.org\u002F1320.pdf>`_\n- `iLIDS-VID \u003Chttps:\u002F\u002Fwww.eecs.qmul.ac.uk\u002F~sgg\u002Fpapers\u002FWangEtAl_ECCV14.pdf>`_\n- `PRID2011 \u003Chttps:\u002F\u002Fpdfs.semanticscholar.org\u002F4c1b\u002Ff0592be3e535faf256c95e27982db9b3d3d3.pdf>`_\n- `DukeMTMC-VideoReID \u003Chttp:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_cvpr_2018\u002Fpapers\u002FWu_Exploit_the_Unknown_CVPR_2018_paper.pdf>`_\n\n\n模型\n-------\n\nImageNet分类模型\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n- `ResNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1512.03385>`_\n- `ResNeXt \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1611.05431>`_\n- `SENet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1709.01507>`_\n- `DenseNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1608.06993>`_\n- `Inception-ResNet-V2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07261>`_\n- `Inception-V4 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07261>`_\n- `Xception \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1610.02357>`_\n- `IBN-Net \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1807.09441>`_\n\n轻量级模型\n^^^^^^^^^^^^^^^^^^^\n- `NASNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1707.07012>`_\n- `MobileNetV2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1801.04381>`_\n- `ShuffleNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1707.01083>`_\n- `ShuffleNetV2 \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1807.11164>`_\n- `SqueezeNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1602.07360>`_\n\nReID专用模型\n^^^^^^^^^^^^^^^^^^^^^^\n- `MuDeep \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1709.05165>`_\n- `ResNet-mid \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.08106>`_\n- `HACNN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1802.08122>`_\n- `PCB \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1711.09349>`_\n- `MLFN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1803.09132>`_\n- `OSNet \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1905.00953>`_\n- `OSNet-AIN \u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06827>`_\n\n\n实用链接\n-------------\n- `OSNet-IBN1-Lite（仅用于测试的代码及精简版Docker容器） \u003Chttps:\u002F\u002Fgithub.com\u002FRodMech\u002FOSNet-IBN1-Lite>`_\n- `基于深度学习的人体重识别：综述与展望 \u003Chttps:\u002F\u002Fgithub.com\u002Fmangye16\u002FReID-Survey>`_\n\n\n引用\n---------\n如果您在研究中使用了本代码或相关模型，请引用以下论文：\n\n.. code-block:: bash\n\n    @article{torchreid,\n      title={Torchreid: 一个基于PyTorch的深度学习人体重识别库},\n      author={周凯阳和向涛},\n      journal={arXiv预印本 arXiv:1910.10093},\n      year={2019}\n    }\n    \n    @inproceedings{zhou2019osnet,\n      title={面向人体重识别的全尺度特征学习},\n      author={周凯阳、杨永新、卡瓦拉罗和向涛},\n      booktitle={ICCV},\n      year={2019}\n    }\n\n    @article{zhou2021osnet,\n      title={学习可泛化的全尺度人体重识别表示},\n      author={周凯阳、杨永新、卡瓦拉罗和向涛},\n      journal={TPAMI},\n      year={2021}\n    }","# deep-person-reid 快速上手指南\n\n`deep-person-reid` (Torchreid) 是一个基于 PyTorch 的深度学习行人重识别（Person Re-ID）库，支持图像和视频 ReID、多 GPU 训练、跨数据集评估等高级功能，并集成了多种 SOTA 模型（如 OSNet）。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux 或 Windows (Windows 需特定配置以支持 Cython)。\n*   **Python**: 推荐版本 3.7。\n*   **包管理器**: 必须安装 [Conda](https:\u002F\u002Fwww.anaconda.com\u002Fdistribution\u002F)。\n*   **GPU**: 推荐使用 NVIDIA GPU 并安装对应的 CUDA 驱动（用于加速训练）。\n\n## 安装步骤\n\n以下是标准的本地安装流程。国内用户若遇到 `pip` 下载慢的问题，可临时使用清华源或阿里源。\n\n1.  **克隆仓库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid.git\n    cd deep-person-reid\u002F\n    ```\n\n2.  **创建 Conda 环境**\n    ```bash\n    conda create --name torchreid python=3.7\n    conda activate torchreid\n    ```\n\n3.  **安装依赖**\n    ```bash\n    # 建议先配置 pip 国内镜像加速 (可选)\n    # pip config set global.index-url https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    \n    pip install -r requirements.txt\n    ```\n\n4.  **安装 PyTorch 和 torchvision**\n    请根据您的机器 CUDA 版本选择合适的命令。以下为示例（CUDA 9.0）：\n    ```bash\n    # 国内用户推荐使用清华源安装 PyTorch\n    conda install pytorch torchvision cudatoolkit=9.0 -c pytorch\n    ```\n    *注：如需其他 CUDA 版本，请访问 PyTorch 官网获取对应命令。*\n\n5.  **安装 Torchreid**\n    使用 `develop` 模式安装，以便修改源码后无需重新编译即可生效。\n    ```bash\n    python setup.py develop\n    ```\n\n> **Docker 替代方案**：如果您偏好容器化部署，也可在项目根目录运行 `make build-image` 构建镜像，然后运行 `make run`。\n\n## 基本使用\n\n以下是一个最简单的\"30 秒上手”示例，演示如何加载数据、构建模型并启动训练。\n\n### 1. Python 代码示例\n\n创建一个 `.py` 文件（例如 `quick_start.py`），填入以下代码：\n\n```python\nimport torchreid\n\n# 1. 加载数据管理器\ndatamanager = torchreid.data.ImageDataManager(\n    root=\"reid-data\",\n    sources=\"market1501\",\n    targets=\"market1501\",\n    height=256,\n    width=128,\n    batch_size_train=32,\n    batch_size_test=100,\n    transforms=[\"random_flip\", \"random_crop\"]\n)\n\n# 2. 构建模型、优化器和学习率调度器\nmodel = torchreid.models.build_model(\n    name=\"resnet50\",\n    num_classes=datamanager.num_train_pids,\n    loss=\"softmax\",\n    pretrained=True\n)\n\nmodel = model.cuda()\n\noptimizer = torchreid.optim.build_optimizer(\n    model,\n    optim=\"adam\",\n    lr=0.0003\n)\n\nscheduler = torchreid.optim.build_lr_scheduler(\n    optimizer,\n    lr_scheduler=\"single_step\",\n    stepsize=20\n)\n\n# 3. 构建引擎\nengine = torchreid.engine.ImageSoftmaxEngine(\n    datamanager,\n    model,\n    optimizer=optimizer,\n    scheduler=scheduler,\n    label_smooth=True\n)\n\n# 4. 运行训练和测试\nengine.run(\n    save_dir=\"log\u002Fresnet50\",\n    max_epoch=60,\n    eval_freq=10,\n    print_freq=10,\n    test_only=False\n)\n```\n\n### 2. 命令行统一接口（推荐）\n\n对于更复杂的实验配置，建议使用项目提供的统一脚本接口。假设您的数据集位于 `$PATH_TO_DATA` 目录下。\n\n**训练 OSNet 模型 (Market1501 数据集):**\n\n```bash\npython scripts\u002Fmain.py \\\n--config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n--transforms random_flip random_erase \\\n--root $PATH_TO_DATA\n```\n\n**训练 OSNet 模型 (DukeMTMC-reID 数据集):**\n\n```bash\npython scripts\u002Fmain.py \\\n--config-file configs\u002Fim_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \\\n-s dukemtmcreid \\\n-t dukemtmcreid \\\n--transforms random_flip random_erase \\\n--root $PATH_TO_DATA \\\ndata.save_dir log\u002Fosnet_x1_0_dukemtmcreid_softmax_cosinelr\n```\n\n*说明：代码会自动下载并加载 ImageNet 预训练权重。训练完成后，模型将保存在指定的 `save_dir` 中。*","某大型物流园区的安全团队需要构建一套跨摄像头的行人追踪系统，以便在货物丢失时快速锁定嫌疑人在不同监控区域的行动轨迹。\n\n### 没有 deep-person-reid 时\n- **算法复现困难**：开发人员需从零搭建 PyTorch 训练框架，手动复现 OSNet 等前沿模型，耗时数周且极易出错。\n- **数据准备繁琐**：面对多路摄像头产生的异构视频数据，缺乏标准化工具进行清洗和对齐，数据集预处理占据 80% 的开发时间。\n- **跨场景效果差**：自研模型在 A 区摄像头训练后，直接应用到 B 区时因光线和角度变化导致识别率断崖式下跌，无法解决域适应问题。\n- **部署门槛高**：模型训练完成后，缺乏便捷的导出工具，难以转换为 ONNX 或 OpenVINO 格式以适配边缘计算设备。\n\n### 使用 deep-person-reid 后\n- **开箱即用**：直接调用库中预置的 SOTA 模型（如 OSNet）和标准化训练流程，半天内即可完成基线模型搭建与验证。\n- **高效数据流水线**：利用其内置的多数据集支持功能，轻松整合图像与视频数据，自动化完成端到端的训练与评估。\n- **泛化能力显著提升**：借助其先进的跨数据集评估协议和实例归一化技术，模型在未见过的新摄像头场景中仍保持高精度识别。\n- **无缝边缘部署**：通过自带的导出脚本，一键将训练好的模型转换为 TFLite 或 OpenVINO 格式，迅速部署到园区现有的监控盒子上。\n\ndeep-person-reid 将原本需要数月研发的行人的重识别系统构建周期缩短至数天，并显著提升了模型在复杂真实环境中的鲁棒性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKaiyangZhou_deep-person-reid_05e2009b.png","KaiyangZhou","Kaiyang","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FKaiyangZhou_9db37149.png",null,"kaiyangzhou","https:\u002F\u002Fkaiyangzhou.github.io","https:\u002F\u002Fgithub.com\u002FKaiyangZhou",[80,84,88,92,96,100,103],{"name":81,"color":82,"percentage":83},"Python","#3572A5",97.8,{"name":85,"color":86,"percentage":87},"Cython","#fedf5b",1.4,{"name":89,"color":90,"percentage":91},"Cuda","#3A4E3A",0.4,{"name":93,"color":94,"percentage":95},"C++","#f34b7d",0.2,{"name":97,"color":98,"percentage":99},"Dockerfile","#384d54",0.1,{"name":101,"color":102,"percentage":99},"Shell","#89e051",{"name":104,"color":105,"percentage":106},"Makefile","#427819",0,4801,1202,"2026-04-14T02:49:47","MIT","Linux, macOS, Windows","需要 NVIDIA GPU（支持多卡训练），具体显存未说明，需根据模型大小自行调整；CUDA 版本需与安装的 PyTorch 匹配（示例中为 9.0，实际建议使用较新版本如 11.x+）","未说明",{"notes":115,"python":116,"dependencies":117},"推荐使用 conda 管理环境；支持 Docker 容器化部署；Cython 代码已兼容 Windows 系统；首次运行可能需要下载预训练模型或数据集（部分托管于 Google Drive 或 Huggingface）；支持导出为 ONNX、OpenVINO 和 TFLite 格式。","3.7",[118,119,120,121,122,123,124,125,126,127],"torch","torchvision","cython","numpy","Pillow","scipy","h5py","tensorboardX","yacs","gdown",[14,15,129],"其他",[131,132,133,134,135,136,137,138,139,140,141],"deep-learning","pytorch","computer-vision","machine-learning","deep-neural-networks","person-reidentification","person-reid","image-retrieval","re-ranking","metric-learning","cross-domain","2026-03-27T02:49:30.150509","2026-04-15T03:26:20.081353",[145,150,155,160,165,170],{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},33508,"导入 torchreid 时出现 'No module named torchreid.utils' 错误怎么办？","这通常是由于导入路径不正确导致的。请尝试将导入语句修改为 'torchreid.reid.utils'。例如，如果原代码是 'from torchreid.utils import FeatureExtractor'，在某些安装方式（如 pip 安装）下可能需要调整为正确的内部模块路径，或者直接使用 'import torchreid; model = torchreid.models.build_model(...)' 的方式调用。如果是通过 pip 安装后在 Colab 等环境遇到 'No module named torchreid.data'，请尝试直接使用 'torchreid.data.ImageDataset' 而不是从子模块导入。","https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fissues\u002F141",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},33509,"如何解决 Cython 评估不可用或编译错误（如 Buffer dtype mismatch）的问题？","如果在 Windows 上遇到 'Cython evaluation unavailable' 警告或 'ValueError: Buffer dtype mismatch, expected long but got long long' 错误，这是因为 Linux 和 Windows 对整数类型的定义不同。解决方法是手动修改源码：找到 'torchreid\u002Fmetrics\u002Frank_cylib\u002Frank_cy.pyx' 文件，将其中所有的 'long' 类型更改为 'long long'。修改后，删除旧的编译文件（如 rank_cy.cp37-win_amd64.pyd），然后重新运行 'python setup.py develop' 进行编译。注意在 Windows 上可能需要管理员权限才能覆盖文件，建议先手动删除旧文件再编译。","https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fissues\u002F160",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},33510,"如何将 ReID 模型（如 OSNet, ResNet50）正确导出为 ONNX 格式？","导出模型时，首先构建模型并加载预训练权重，然后使用 torch.onnx.export。注意输入张量的维度应与训练时一致（例如 1, 3, 256, 128）。关于 num_classes，如果是用于特征提取（ReID），通常设置为数据集的类别数（如 1000 或具体数据集 ID 数），但在导出用于推理的骨干网络时，需确保输出层逻辑与预期一致。如果遇到 ONNX Runtime 验证失败（AssertionError），可能是算子不支持或动态轴问题。可以参考现有的多后端导出脚本（支持 ONNX, OpenVINO, TFLite），其流程为 PT -> ONNX -> OpenVINO -> TFLite。注意 OSNet 模型在导出到 OpenVINO 时可能会失败，而 MobileNet 和 ResNet50 通常能顺利通过。","https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fissues\u002F302",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},33511,"CUHK03 数据集的 mAP 评估中 --split-id 参数应该如何设置？","对于 CUHK03 数据集的新分割（new split），不需要指定 '--split-id' 参数，因为其默认值即为 0。对于旧分割（old split \u002F classic split），需要进行 20 次实验以获取平均结果。你需要运行 20 次脚本，第一次使用 '--split-id 0'，第二次使用 '--split-id 1'，依此类推，直到最后一次使用 '--split-id 19'，最后将这 20 次的结果取平均值。如果使用 labeled 模式，请使用 '--cuhk03-labeled' 参数；如果是经典分割模式，请结合使用 '--cuhk03-classic-split' 和 '--use-metric-cuhk03'。","https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fissues\u002F114",{"id":166,"question_zh":167,"answer_zh":168,"source_url":169},33512,"模型加载后为何同时占用大量 GPU 和 CPU 内存？","在使用 CUDA 加载模型时，理论上应主要使用 GPU。如果发现模型同时占用了显著的 GPU 内存（如 2.3GB）和 CPU 内存（如 4GB），这可能是由于数据加载器（DataLoader）的预处理操作、PyTorch 的内部缓存机制或非张量数据停留在 CPU 上所致。当显式指定 device='cpu' 时，CPU 占用会降低但处理时间增加。目前该行为的具体根因尚不明确，建议检查数据加载部分的代码，确保输入数据已正确移动到 GPU，并关注 PyTorch 版本及 torchreid 库的更新以获取潜在修复。","https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fissues\u002F200",{"id":171,"question_zh":172,"answer_zh":173,"source_url":169},33513,"在 OSNet 上使用 ArcFace 或 CosFace 损失函数效果不佳怎么办？","有用户报告在 OSNet 上使用 ArcFace 取得了良好结果（如 rank-1 达到 88.2%），但也有用户在 DukeMTMC-ReID 数据集上使用 osnet_ain 配合 ArcFace 未观察到提升。这可能与具体的实现细节、超参数设置（如 margin m, scale s）或数据集特性有关。如果你尝试复现但未获提升，建议仔细检查损失函数的实现是否正确（特别是 cos(theta + m) 的计算逻辑），确认输入特征的归一化处理，并尝试调整超参数。此外，确保使用的网络架构变体（如 osnet vs osnet_ain）与原始成功实验保持一致。",[175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270],{"id":176,"version":177,"summary_zh":178,"released_at":179},255676,"v1.0.6","- 移除了未使用的导入和变量。\n- 修复了若干小 bug。\n\n基本上是一个更稳定的版本。","2019-10-23T16:23:12",{"id":181,"version":182,"summary_zh":183,"released_at":184},255677,"v1.0.5","新增了数据集、模型和工具。","2019-10-23T15:15:49",{"id":186,"version":187,"summary_zh":188,"released_at":189},255678,"v1.0.0","主要更新：\n- 对 `scripts\u002Fmain.py` 进行了重大改动，将 `argparse` 中的大部分参数替换为配置文件。\n- 在 `configs\u002F` 目录下新增配置文件，包含预定义的训练参数。\n- 在数据管理器和引擎中，将 `use_cpu` 改为 `use_gpu`。\n- 在数据管理器中，将 `batch_size` 分别改为 `batch_size_train` 和 `batch_size_test`。\n- 现已支持 TensorBoard。","2019-08-26T12:32:10",{"id":191,"version":192,"summary_zh":193,"released_at":194},255679,"v0.9.1","主要更新：\n\n- 在同一张图中展示所有样本的排序结果（目前支持图像重识别任务）\n- 可视化激活图，以了解卷积神经网络在进行重识别特征提取时关注的区域。","2019-08-04T09:46:55",{"id":196,"version":197,"summary_zh":198,"released_at":199},255680,"v0.8.1","Bug修复：在训练变换函数中将图像调整为目标尺寸。","2019-07-08T14:51:53",{"id":201,"version":202,"summary_zh":203,"released_at":204},255681,"v0.8.0","- 添加 OSNet 代码和模型","2019-07-03T12:54:43",{"id":206,"version":207,"summary_zh":208,"released_at":209},255682,"v0.7.8","- 模型动物园回来了。 - 一些小更新。","2019-05-28T22:09:30",{"id":211,"version":212,"summary_zh":213,"released_at":214},255683,"v0.7.7","主要更新：\n- 新增 `compute_model_complexity()`。\n- 新增 `shufflenetv2`。","2019-05-24T15:33:18",{"id":216,"version":217,"summary_zh":218,"released_at":219},255684,"v0.7.5","主要更新：\n- 新增人员重排序功能，可通过在 `engine.run()` 中设置 `rerank=True` 来启用。该功能仅在评估模式下生效，即当 `test_only=True` 时。\n- 在 `engine.run()` 中新增 `normalize_feature` 参数，允许在计算特征距离之前对特征向量进行 L2 归一化。","2019-05-09T22:53:21",{"id":221,"version":222,"summary_zh":223,"released_at":224},255685,"v0.7.4","重大更新：\n- 增加了 Conda 安装说明。\n- 修复了学习率调度器中的一个 bug：https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002Fdcd8da565a9802bf48e8694e616e633a51b413a3\n- 修复了 `combineall` 中的一个 bug：https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002Fbb6dc46e21e335789b9d891f7191c1da3a5d2e01","2019-04-27T22:35:57",{"id":226,"version":227,"summary_zh":228,"released_at":229},255686,"v0.7.3","Major changes\r\n- https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002F1e9d466f42256cc451f6f73761c298cabbcd0b39\r\n- https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002F4a033659b0330bcbd25dc1cc344cf26ddd69ac73","2019-04-18T11:09:08",{"id":231,"version":232,"summary_zh":233,"released_at":234},255687,"v0.7.2","Removed prid450s.\r\n\r\nThis version should be stable.","2019-03-25T20:10:40",{"id":236,"version":237,"summary_zh":238,"released_at":239},255688,"v0.7.1","Bug fix:\r\n- https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fcommit\u002F235348f67248a9d27d5c9bcafcabcfe5cbf61cb3: return `ImageDataset` or `VideoDataset` rather than `Dataset`.","2019-03-25T18:51:57",{"id":241,"version":242,"summary_zh":243,"released_at":244},255689,"v0.7.0","See the documentation https:\u002F\u002Fkaiyangzhou.github.io\u002Fdeep-person-reid\u002F.","2019-03-25T17:38:34",{"id":246,"version":247,"summary_zh":248,"released_at":249},255690,"v0.5.0","Major updates:\r\n- Model codes such as [resnet.py](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftorchreid\u002Fmodels\u002Fresnet.py) and [densenet.py](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftorchreid\u002Fmodels\u002Fdensenet.py) keep the original style for easier modification.\r\n- Generalize CrossEntropyLableSmooth to [CrossEntropyLoss](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftorchreid\u002Flosses\u002Fcross_entropy_loss.py). `--label-smooth` should be called explicitly in order to add the label smoothing regularizer to the cross entropy loss.\r\n- Add support to **multi-dataset training**. Datasets are specified by the arguments `-s` and `-t`, which refer to source datasets and target datasets, respectively. Both can take multiple strings delimited by space. For example, say you wanna train a model using Market1501+DukeMTMC-reID, just set `-s market1501 dukemtmcreid`. If you wanna test on multiple datasets, you can do `-t market1501 dukemtmcreid cuhk03 msmt17`.\r\n- Arguments are unified in [args.py](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Fargs.py).\r\n- Dataloaders are wrapped into two classes, which are `ImageDataManager` and `VideoDataManager` (see [data_manager.py](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftorchreid\u002Fdata_manager.py)). A datamanger is initialized by `dm = ImageDataManager(use_gpu, **image_dataset_kwargs(args))` where `image_dataset_kwargs()` is implemented in `args.py`. Therefore, when new arguments are added to the data manager, you don't need to exhausively change everywhere in the code. What you need to update are (1) add new arguments in `args.py` and (2) update the input arguments in `data_manager.py`.\r\n- BENCHMARK is replaced with [MODEL_ZOO](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002FMODEL_ZOO.md) where model weights and training scripts can be downloaded.","2018-11-12T12:19:01",{"id":251,"version":252,"summary_zh":253,"released_at":254},255691,"v0.3.0","- Added `--lambda-xent` and `--lambda-htri` in `xxx_xent_htri.py`, which can balance between cross entropy loss and hard mining triplet loss.\r\n- Divided losses into [separate files](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Ftree\u002Fmaster\u002Ftorchreid\u002Flosses) for easier extension.\r\n- Moved major codes to the folder [torchreid\u002F](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Ftree\u002Fmaster\u002Ftorchreid) (such structuring will be maintained).\r\n- Automated the download of `dukemtmcreid` and `dukemtmcvidreid`.","2018-08-15T16:35:42",{"id":256,"version":257,"summary_zh":258,"released_at":259},255692,"v0.2.2","- Added `--load-weights` (weights that don't match in size will be discarded, e.g. old classification layer).\r\n- Updated dukemtmcvidreid naming, old\u002Fnew formats are supported.\r\n- Added `--vis-ranked-res` and `reidtools.py`, allowing ranked images to be visualized.\r\n\r\nNote:\r\n`--use-lmdb` is postponed.","2018-08-01T11:22:08",{"id":261,"version":262,"summary_zh":263,"released_at":264},255693,"v0.2.0","- Code structure is re-organized, which is easier to read and modify\r\n- `data_manager` is split into [different scripts](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Ftree\u002Fmaster\u002Fdata_manager).\r\n- Added [`--fixbase` option](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Ftrain_imgreid_xent.py#L196), allowing randomly initialized classifier layer to be trained while keeping base network frozen.\r\n- Rewrote [sampler for triplet loss](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Fsamplers.py#L40), which allows most of the training images to be covered during a training epoch.\r\n- Added [requirements.txt](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002Frequirements.txt), which eases environment configuration.\r\n- [Instructions on data preparation](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002FDATASETS.md) and [benchmarks](https:\u002F\u002Fgithub.com\u002FKaiyangZhou\u002Fdeep-person-reid\u002Fblob\u002Fmaster\u002FBENCHMARK.md) are separated into different files.\r\n\r\nTo be done:\r\n- `--lmdb` is under development.","2018-07-06T10:20:33",{"id":266,"version":267,"summary_zh":268,"released_at":269},255694,"v0.1.0","added cython-based evaluation.","2018-06-04T09:54:59",{"id":271,"version":272,"summary_zh":273,"released_at":274},255695,"v0.0.9","- multi-GPU training.\r\n- both image-based and video-based reid.\r\n- unified interface for different reid models.\r\n- easy dataset preparation.\r\n- end-to-end training and evaluation.\r\n- standard dataset splits used by most papers.\r\n- download of trained models.","2018-06-04T09:53:46"]