[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-thtrieu--darkflow":3,"tool-thtrieu--darkflow":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 真正成长为懂上",160411,2,"2026-04-18T23:33:24",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[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":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":77,"owner_url":78,"languages":79,"stars":84,"forks":85,"last_commit_at":86,"license":87,"difficulty_score":88,"env_os":89,"env_gpu":90,"env_ram":89,"env_deps":91,"category_tags":98,"github_topics":99,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":148},9479,"thtrieu\u002Fdarkflow","darkflow","Translate darknet to tensorflow. Load trained weights, retrain\u002Ffine-tune using tensorflow, export constant graph def to mobile devices","darkflow 是一个将 Darknet 框架训练的 YOLO 模型迁移至 TensorFlow 平台的开源工具。它主要解决了深度学习模型在不同框架间难以复用的痛点，让开发者能够轻松加载在 Darknet 中预训练的权重文件，并在 TensorFlow 环境中继续进行模型微调、重新训练或推理预测。\n\n该工具特别适合熟悉 Python 和 TensorFlow 的 AI 开发者及研究人员使用。对于希望将高性能的目标检测模型部署到移动端或嵌入式设备的团队，darkflow 提供了导出常量图定义（constant graph def）的功能，极大地简化了跨平台部署流程。用户不仅可以利用现有的 YOLO v1\u002Fv2 模型快速搭建实时物体检测系统，还能通过修改配置文件自定义网络结构或调整分类标签，灵活适配特定场景需求。\n\n其核心技术亮点在于无缝桥接了 Darknet 与 TensorFlow 两大生态，支持断点续训和层复用机制。例如，用户可以复用小型模型的部分底层特征提取层来初始化新的大型模型，从而显著提升训练效率。配合简洁的命令行操作，darkflow 让复杂的模型迁移工作变得直观高效，是计","darkflow 是一个将 Darknet 框架训练的 YOLO 模型迁移至 TensorFlow 平台的开源工具。它主要解决了深度学习模型在不同框架间难以复用的痛点，让开发者能够轻松加载在 Darknet 中预训练的权重文件，并在 TensorFlow 环境中继续进行模型微调、重新训练或推理预测。\n\n该工具特别适合熟悉 Python 和 TensorFlow 的 AI 开发者及研究人员使用。对于希望将高性能的目标检测模型部署到移动端或嵌入式设备的团队，darkflow 提供了导出常量图定义（constant graph def）的功能，极大地简化了跨平台部署流程。用户不仅可以利用现有的 YOLO v1\u002Fv2 模型快速搭建实时物体检测系统，还能通过修改配置文件自定义网络结构或调整分类标签，灵活适配特定场景需求。\n\n其核心技术亮点在于无缝桥接了 Darknet 与 TensorFlow 两大生态，支持断点续训和层复用机制。例如，用户可以复用小型模型的部分底层特征提取层来初始化新的大型模型，从而显著提升训练效率。配合简洁的命令行操作，darkflow 让复杂的模型迁移工作变得直观高效，是计算机视觉领域进行模型转换与落地的实用助手。","## Intro\n\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fthtrieu\u002Fdarkflow.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fthtrieu\u002Fdarkflow) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fthtrieu\u002Fdarkflow\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fthtrieu\u002Fdarkflow)\n\nReal-time object detection and classification. Paper: [version 1](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1506.02640.pdf), [version 2](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1612.08242.pdf).\n\nRead more about YOLO (in darknet) and download weight files [here](http:\u002F\u002Fpjreddie.com\u002Fdarknet\u002Fyolo\u002F). In case the weight file cannot be found, I uploaded some of mine [here](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B1tW_VtY7onidEwyQ2FtQVplWEU), which include `yolo-full` and `yolo-tiny` of v1.0, `tiny-yolo-v1.1` of v1.1 and `yolo`, `tiny-yolo-voc` of v2.\n\n\nSee demo below or see on [this imgur](http:\u002F\u002Fi.imgur.com\u002FEyZZKAA.gif)\n\n\u003Cp align=\"center\"> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthtrieu_darkflow_readme_6484f43cbeb0.gif\"\u002F> \u003C\u002Fp>\n\n## Dependencies\n\nPython3, tensorflow 1.0, numpy, opencv 3.\n\n## Citation\n\n```\n@article{trieu2018darkflow,\n  title={Darkflow},\n  author={Trieu, Trinh Hoang},\n  journal={GitHub Repository. Available online: https:\u002F\u002Fgithub. com\u002Fthtrieu\u002Fdarkflow (accessed on 14 February 2019)},\n  year={2018}\n}\n```\n\n### Getting started\n\nYou can choose _one_ of the following three ways to get started with darkflow.\n\n1. Just build the Cython extensions in place. NOTE: If installing this way you will have to use `.\u002Fflow` in the cloned darkflow directory instead of `flow` as darkflow is not installed globally.\n    ```\n    python3 setup.py build_ext --inplace\n    ```\n\n2. Let pip install darkflow globally in dev mode (still globally accessible, but changes to the code immediately take effect)\n    ```\n    pip install -e .\n    ```\n\n3. Install with pip globally\n    ```\n    pip install .\n    ```\n\n## Update\n\n**Android demo on Tensorflow's** [here](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow\u002Fblob\u002Fmaster\u002Ftensorflow\u002Fexamples\u002Fandroid\u002Fsrc\u002Forg\u002Ftensorflow\u002Fdemo\u002FTensorFlowYoloDetector.java)\n\n**I am looking for help:**\n - `help wanted` labels in issue track\n\n## Parsing the annotations\n\nSkip this if you are not training or fine-tuning anything (you simply want to forward flow a trained net)\n\nFor example, if you want to work with only 3 classes `tvmonitor`, `person`, `pottedplant`; edit `labels.txt` as follows\n\n```\ntvmonitor\nperson\npottedplant\n```\n\nAnd that's it. `darkflow` will take care of the rest. You can also set darkflow to load from a custom labels file with the `--labels` flag (i.e. `--labels myOtherLabelsFile.txt`). This can be helpful when working with multiple models with different sets of output labels. When this flag is not set, darkflow will load from `labels.txt` by default (unless you are using one of the recognized `.cfg` files designed for the COCO or VOC dataset - then the labels file will be ignored and the COCO or VOC labels will be loaded).\n\n## Design the net\n\nSkip this if you are working with one of the original configurations since they are already there. Otherwise, see the following example:\n\n```python\n...\n\n[convolutional]\nbatch_normalize = 1\nsize = 3\nstride = 1\npad = 1\nactivation = leaky\n\n[maxpool]\n\n[connected]\noutput = 4096\nactivation = linear\n\n...\n```\n\n## Flowing the graph using `flow`\n\n```bash\n# Have a look at its options\nflow --h\n```\n\nFirst, let's take a closer look at one of a very useful option `--load`\n\n```bash\n# 1. Load tiny-yolo.weights\nflow --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights\n\n# 2. To completely initialize a model, leave the --load option\nflow --model cfg\u002Fyolo-new.cfg\n\n# 3. It is useful to reuse the first identical layers of tiny for `yolo-new`\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Ftiny-yolo.weights\n# this will print out which layers are reused, which are initialized\n```\n\nAll input images from default folder `sample_img\u002F` are flowed through the net and predictions are put in `sample_img\u002Fout\u002F`. We can always specify more parameters for such forward passes, such as detection threshold, batch size, images folder, etc.\n\n```bash\n# Forward all images in sample_img\u002F using tiny yolo and 100% GPU usage\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --gpu 1.0\n```\njson output can be generated with descriptions of the pixel location of each bounding box and the pixel location. Each prediction is stored in the `sample_img\u002Fout` folder by default. An example json array is shown below.\n```bash\n# Forward all images in sample_img\u002F using tiny yolo and JSON output.\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --json\n```\nJSON output:\n```json\n[{\"label\":\"person\", \"confidence\": 0.56, \"topleft\": {\"x\": 184, \"y\": 101}, \"bottomright\": {\"x\": 274, \"y\": 382}},\n{\"label\": \"dog\", \"confidence\": 0.32, \"topleft\": {\"x\": 71, \"y\": 263}, \"bottomright\": {\"x\": 193, \"y\": 353}},\n{\"label\": \"horse\", \"confidence\": 0.76, \"topleft\": {\"x\": 412, \"y\": 109}, \"bottomright\": {\"x\": 592,\"y\": 337}}]\n```\n - label: self explanatory\n - confidence: somewhere between 0 and 1 (how confident yolo is about that detection)\n - topleft: pixel coordinate of top left corner of box.\n - bottomright: pixel coordinate of bottom right corner of box.\n\n## Training new model\n\nTraining is simple as you only have to add option `--train`. Training set and annotation will be parsed if this is the first time a new configuration is trained. To point to training set and annotations, use option `--dataset` and `--annotation`. A few examples:\n\n```bash\n# Initialize yolo-new from yolo-tiny, then train the net on 100% GPU:\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Ftiny-yolo.weights --train --gpu 1.0\n\n# Completely initialize yolo-new and train it with ADAM optimizer\nflow --model cfg\u002Fyolo-new.cfg --train --trainer adam\n```\n\nDuring training, the script will occasionally save intermediate results into Tensorflow checkpoints, stored in `ckpt\u002F`. To resume to any checkpoint before performing training\u002Ftesting, use `--load [checkpoint_num]` option, if `checkpoint_num \u003C 0`, `darkflow` will load the most recent save by parsing `ckpt\u002Fcheckpoint`.\n\n```bash\n# Resume the most recent checkpoint for training\nflow --train --model cfg\u002Fyolo-new.cfg --load -1\n\n# Test with checkpoint at step 1500\nflow --model cfg\u002Fyolo-new.cfg --load 1500\n\n# Fine tuning yolo-tiny from the original one\nflow --train --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights\n```\n\nExample of training on Pascal VOC 2007:\n```bash\n# Download the Pascal VOC dataset:\ncurl -O https:\u002F\u002Fpjreddie.com\u002Fmedia\u002Ffiles\u002FVOCtest_06-Nov-2007.tar\ntar xf VOCtest_06-Nov-2007.tar\n\n# An example of the Pascal VOC annotation format:\nvim VOCdevkit\u002FVOC2007\u002FAnnotations\u002F000001.xml\n\n# Train the net on the Pascal dataset:\nflow --model cfg\u002Fyolo-new.cfg --train --dataset \"~\u002FVOCdevkit\u002FVOC2007\u002FJPEGImages\" --annotation \"~\u002FVOCdevkit\u002FVOC2007\u002FAnnotations\"\n```\n\n### Training on your own dataset\n\n*The steps below assume we want to use tiny YOLO and our dataset has 3 classes*\n\n1. Create a copy of the configuration file `tiny-yolo-voc.cfg` and rename it according to your preference `tiny-yolo-voc-3c.cfg` (It is crucial that you leave the original `tiny-yolo-voc.cfg` file unchanged, see below for explanation).\n\n2. In `tiny-yolo-voc-3c.cfg`, change classes in the [region] layer (the last layer) to the number of classes you are going to train for. In our case, classes are set to 3.\n    \n    ```python\n    ...\n\n    [region]\n    anchors = 1.08,1.19,  3.42,4.41,  6.63,11.38,  9.42,5.11,  16.62,10.52\n    bias_match=1\n    classes=3\n    coords=4\n    num=5\n    softmax=1\n    \n    ...\n    ```\n\n3. In `tiny-yolo-voc-3c.cfg`, change filters in the [convolutional] layer (the second to last layer) to num * (classes + 5). In our case, num is 5 and classes are 3 so 5 * (3 + 5) = 40 therefore filters are set to 40.\n    \n    ```python\n    ...\n\n    [convolutional]\n    size=1\n    stride=1\n    pad=1\n    filters=40\n    activation=linear\n\n    [region]\n    anchors = 1.08,1.19,  3.42,4.41,  6.63,11.38,  9.42,5.11,  16.62,10.52\n    \n    ...\n    ```\n\n4. Change `labels.txt` to include the label(s) you want to train on (number of labels should be the same as the number of classes you set in `tiny-yolo-voc-3c.cfg` file). In our case, `labels.txt` will contain 3 labels.\n\n    ```\n    label1\n    label2\n    label3\n    ```\n5. Reference the `tiny-yolo-voc-3c.cfg` model when you train.\n\n    `flow --model cfg\u002Ftiny-yolo-voc-3c.cfg --load bin\u002Ftiny-yolo-voc.weights --train --annotation train\u002FAnnotations --dataset train\u002FImages`\n\n\n* Why should I leave the original `tiny-yolo-voc.cfg` file unchanged?\n    \n    When darkflow sees you are loading `tiny-yolo-voc.weights` it will look for `tiny-yolo-voc.cfg` in your cfg\u002F folder and compare that configuration file to the new one you have set with `--model cfg\u002Ftiny-yolo-voc-3c.cfg`. In this case, every layer will have the same exact number of weights except for the last two, so it will load the weights into all layers up to the last two because they now contain different number of weights.\n\n\n## Camera\u002Fvideo file demo\n\nFor a demo that entirely runs on the CPU:\n\n```bash\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo videofile.avi\n```\n\nFor a demo that runs 100% on the GPU:\n\n```bash\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo videofile.avi --gpu 1.0\n```\n\nTo use your webcam\u002Fcamera, simply replace `videofile.avi` with keyword `camera`.\n\nTo save a video with predicted bounding box, add `--saveVideo` option.\n\n## Using darkflow from another python application\n\nPlease note that `return_predict(img)` must take an `numpy.ndarray`. Your image must be loaded beforehand and passed to `return_predict(img)`. Passing the file path won't work.\n\nResult from `return_predict(img)` will be a list of dictionaries representing each detected object's values in the same format as the JSON output listed above.\n\n```python\nfrom darkflow.net.build import TFNet\nimport cv2\n\noptions = {\"model\": \"cfg\u002Fyolo.cfg\", \"load\": \"bin\u002Fyolo.weights\", \"threshold\": 0.1}\n\ntfnet = TFNet(options)\n\nimgcv = cv2.imread(\".\u002Fsample_img\u002Fsample_dog.jpg\")\nresult = tfnet.return_predict(imgcv)\nprint(result)\n```\n\n\n## Save the built graph to a protobuf file (`.pb`)\n\n```bash\n## Saving the lastest checkpoint to protobuf file\nflow --model cfg\u002Fyolo-new.cfg --load -1 --savepb\n\n## Saving graph and weights to protobuf file\nflow --model cfg\u002Fyolo.cfg --load bin\u002Fyolo.weights --savepb\n```\nWhen saving the `.pb` file, a `.meta` file will also be generated alongside it. This `.meta` file is a JSON dump of everything in the `meta` dictionary that contains information nessecary for post-processing such as `anchors` and `labels`. This way, everything you need to make predictions from the graph and do post processing is contained in those two files - no need to have the `.cfg` or any labels file tagging along.\n\nThe created `.pb` file can be used to migrate the graph to mobile devices (JAVA \u002F C++ \u002F Objective-C++). The name of input tensor and output tensor are respectively `'input'` and `'output'`. For further usage of this protobuf file, please refer to the official documentation of `Tensorflow` on C++ API [_here_](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fr0.9\u002Fapi_docs\u002Fcc\u002Findex.html). To run it on, say, iOS application, simply add the file to Bundle Resources and update the path to this file inside source code.\n\nAlso, darkflow supports loading from a `.pb` and `.meta` file for generating predictions (instead of loading from a `.cfg` and checkpoint or `.weights`).\n```bash\n## Forward images in sample_img for predictions based on protobuf file\nflow --pbLoad built_graph\u002Fyolo.pb --metaLoad built_graph\u002Fyolo.meta --imgdir sample_img\u002F\n```\nIf you'd like to load a `.pb` and `.meta` file when using `return_predict()` you can set the `\"pbLoad\"` and `\"metaLoad\"` options in place of the `\"model\"` and `\"load\"` options you would normally set.\n\nThat's all.\n","## 简介\n\n[![构建状态](https:\u002F\u002Ftravis-ci.org\u002Fthtrieu\u002Fdarkflow.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fthtrieu\u002Fdarkflow) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fthtrieu\u002Fdarkflow\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fthtrieu\u002Fdarkflow)\n\n实时目标检测与分类。论文：[版本 1](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1506.02640.pdf)，[版本 2](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1612.08242.pdf)。\n\n更多关于 YOLO（在 darknet 中）的信息以及权重文件的下载，请访问 [这里](http:\u002F\u002Fpjreddie.com\u002Fdarknet\u002Fyolo\u002F)。如果无法找到权重文件，我已将部分权重上传至 [这里](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B1tW_VtY7onidEwyQ2FtQVplWEU)，其中包括 v1.0 的 `yolo-full` 和 `yolo-tiny`、v1.1 的 `tiny-yolo-v1.1`，以及 v2 的 `yolo` 和 `tiny-yolo-voc`。\n\n\n请查看下方演示，或访问 [此 imgur 链接](http:\u002F\u002Fi.imgur.com\u002FEyZZKAA.gif)。\n\n\u003Cp align=\"center\"> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthtrieu_darkflow_readme_6484f43cbeb0.gif\"\u002F> \u003C\u002Fp>\n\n## 依赖项\n\nPython3、TensorFlow 1.0、NumPy、OpenCV 3。\n\n## 引用\n\n```\n@article{trieu2018darkflow,\n  title={Darkflow},\n  author={Trieu, Trinh Hoang},\n  journal={GitHub 仓库。在线可用：https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow（访问日期：2019年2月14日）},\n  year={2018}\n}\n```\n\n### 快速入门\n\n您可以选择以下三种方式之一来开始使用 darkflow。\n\n1. 直接就地编译 Cython 扩展。注意：如果以这种方式安装，您需要在克隆的 darkflow 目录中使用 `.\u002Fflow`，而不是直接使用 `flow`，因为 darkflow 并未全局安装。\n    ```\n    python3 setup.py build_ext --inplace\n    ```\n\n2. 使用 pip 以开发模式全局安装 darkflow（仍然可以全局访问，但代码更改会立即生效）\n    ```\n    pip install -e .\n    ```\n\n3. 使用 pip 全局安装\n    ```\n    pip install .\n    ```\n\n## 更新\n\n**Android 演示可在 TensorFlow 的** [此处](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow\u002Fblob\u002Fmaster\u002Ftensorflow\u002Fexamples\u002Fandroid\u002Fsrc\u002Forg\u002Ftensorflow\u002Fdemo\u002FTensorFlowYoloDetector.java)\n\n**我正在寻求帮助：**\n- 在问题跟踪器中标记为 `help wanted`\n\n## 解析标注文件\n\n如果您不进行训练或微调（只是想对已训练好的网络进行推理），则可以跳过此步骤。\n\n例如，如果您只想处理 `tvmonitor`、`person` 和 `pottedplant` 这三个类别，则可以按如下方式编辑 `labels.txt` 文件：\n\n```\ntvmonitor\nperson\npottedplant\n```\n\n仅需如此即可。其余工作将由 `darkflow` 自动完成。您还可以通过 `--labels` 标志指定自定义的标签文件路径（例如 `--labels myOtherLabelsFile.txt`）。这在同时使用多个具有不同输出标签集的模型时非常有用。如果没有设置该标志，则默认会加载 `labels.txt` 文件（除非您使用的是专为 COCO 或 VOC 数据集设计的已知 `.cfg` 文件——在这种情况下，标签文件将被忽略，系统会自动加载 COCO 或 VOC 的标签）。\n\n## 设计网络结构\n\n如果您使用的是原始配置文件，则可以跳过此步骤，因为这些配置已经存在。否则，请参考以下示例：\n\n```python\n...\n\n[convolutional]\nbatch_normalize = 1\nsize = 3\nstride = 1\npad = 1\nactivation = leaky\n\n[maxpool]\n\n[connected]\noutput = 4096\nactivation = linear\n\n...\n```\n\n## 使用 `flow` 运行推理\n\n```bash\n# 查看其选项\nflow --h\n```\n\n首先，让我们仔细看看一个非常有用的选项 `--load`：\n\n```bash\n# 1. 加载 tiny-yolo.weights\nflow --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights\n\n# 2. 如果要完全初始化一个模型，可以不使用 --load 选项\nflow --model cfg\u002Fyolo-new.cfg\n\n# 3. 将 tiny-yolo 的前几层复用到 yolo-new 中也很有用\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Ftiny-yolo.weights\n# 此命令会显示哪些层被复用，哪些层是新初始化的\n```\n\n所有来自默认文件夹 `sample_img\u002F` 的输入图像都会通过网络进行推理，预测结果将保存到 `sample_img\u002Fout\u002F` 文件夹中。我们还可以为这些推理过程指定更多参数，例如检测阈值、批大小、图像文件夹等。\n\n```bash\n# 使用 tiny yolo 对 sample_img\u002F 中的所有图像进行推理，并启用 100% GPU 利用率\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --gpu 1.0\n```\n\n可以通过 JSON 格式生成输出，其中包含每个边界框的像素位置描述。默认情况下，每个预测结果都会存储在 `sample_img\u002Fout` 文件夹中。以下是一个 JSON 数组示例：\n\n```bash\n# 使用 tiny yolo 对 sample_img\u002F 中的所有图像进行推理，并生成 JSON 输出。\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --json\n```\n\nJSON 输出：\n```json\n[{\"label\":\"person\", \"confidence\": 0.56, \"topleft\": {\"x\": 184, \"y\": 101}, \"bottomright\": {\"x\": 274, \"y\": 382}},\n{\"label\": \"dog\", \"confidence\": 0.32, \"topleft\": {\"x\": 71, \"y\": 263}, \"bottomright\": {\"x\": 193, \"y\": 353}},\n{\"label\": \"horse\", \"confidence\": 0.76, \"topleft\": {\"x\": 412, \"y\": 109}, \"bottomright\": {\"x\": 592,\"y\": 337}}]\n```\n- label：标签名称，一目了然。\n- confidence：置信度，范围在 0 到 1 之间，表示 YOLO 对该检测结果的置信程度。\n- topleft：边界框左上角的像素坐标。\n- bottomright：边界框右下角的像素坐标。\n\n## 训练新模型\n\n训练过程非常简单，只需添加 `--train` 选项即可。如果是首次训练新的配置文件，脚本会自动解析训练数据集和标注文件。要指定训练数据集和标注文件，可以使用 `--dataset` 和 `--annotation` 选项。以下是一些示例：\n\n```bash\n# 从 yolo-tiny 初始化 yolo-new，然后在 100% GPU 上训练网络：\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Ftiny-yolo.weights --train --gpu 1.0\n\n# 完全初始化 yolo-new，并使用 ADAM 优化器进行训练\nflow --model cfg\u002Fyolo-new.cfg --train --trainer adam\n```\n\n在训练过程中，脚本会定期将中间结果保存为 TensorFlow 检查点，存储在 `ckpt\u002F` 文件夹中。如果需要从中断的地方继续训练或测试，可以使用 `--load [checkpoint_num]` 选项；如果 `checkpoint_num \u003C 0`，`darkflow` 将通过解析 `ckpt\u002Fcheckpoint` 文件加载最近的保存检查点。\n\n```bash\n# 继续从最近的检查点开始训练\nflow --train --model cfg\u002Fyolo-new.cfg --load -1\n\n# 使用第 1500 步的检查点进行测试\nflow --model cfg\u002Fyolo-new.cfg --load 1500\n\n# 对原始 tiny-yolo 进行微调\nflow --train --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights\n```\n\nPascal VOC 2007 数据集上的训练示例：\n\n```bash\n# 下载 Pascal VOC 数据集：\ncurl -O https:\u002F\u002Fpjreddie.com\u002Fmedia\u002Ffiles\u002FVOCtest_06-Nov-2007.tar\ntar xf VOCtest_06-Nov-2007.tar\n\n# Pascal VOC 注释文件格式示例：\nvim VOCdevkit\u002FVOC2007\u002FAnnotations\u002F000001.xml\n\n# 在 Pascal 数据集上训练网络：\nflow --model cfg\u002Fyolo-new.cfg --train --dataset \"~\u002FVOCdevkit\u002FVOC2007\u002FJPEGImages\" --annotation \"~\u002FVOCdevkit\u002FVOC2007\u002FAnnotations\"\n```\n\n### 在您自己的数据集上进行训练\n\n*以下步骤假设我们想要使用 tiny YOLO，并且我们的数据集有 3 个类别*\n\n1. 复制配置文件 `tiny-yolo-voc.cfg`，并根据您的喜好将其重命名为 `tiny-yolo-voc-3c.cfg`（务必保持原始的 `tiny-yolo-voc.cfg` 文件不变，原因见下文）。\n\n2. 在 `tiny-yolo-voc-3c.cfg` 中，将 [region] 层（最后一层）中的 classes 参数修改为您要训练的类别数量。在本例中，classes 被设置为 3。\n    \n    ```python\n    ...\n\n    [region]\n    anchors = 1.08,1.19,  3.42,4.41,  6.63,11.38,  9.42,5.11,  16.62,10.52\n    bias_match=1\n    classes=3\n    coords=4\n    num=5\n    softmax=1\n    \n    ...\n    ```\n\n3. 在 `tiny-yolo-voc-3c.cfg` 中，将 [convolutional] 层（倒数第二层）中的 filters 参数修改为 num * (classes + 5)。在本例中，num 是 5，classes 是 3，因此 5 * (3 + 5) = 40，所以 filters 被设置为 40。\n    \n    ```python\n    ...\n\n    [convolutional]\n    size=1\n    stride=1\n    pad=1\n    filters=40\n    activation=linear\n\n    [region]\n    anchors = 1.08,1.19,  3.42,4.41,  6.63,11.38,  9.42,5.11,  16.62,10.52\n    \n    ...\n    ```\n\n4. 修改 `labels.txt` 文件，使其包含您想要训练的标签（标签数量应与您在 `tiny-yolo-voc-3c.cfg` 文件中设置的类别数量一致）。在本例中，`labels.txt` 将包含 3 个标签。\n\n    ```\n    label1\n    label2\n    label3\n    ```\n\n5. 在训练时引用 `tiny-yolo-voc-3c.cfg` 模型。\n\n    `flow --model cfg\u002Ftiny-yolo-voc-3c.cfg --load bin\u002Ftiny-yolo-voc.weights --train --annotation train\u002FAnnotations --dataset train\u002FImages`\n\n\n* 为什么我应该保持原始的 `tiny-yolo-voc.cfg` 文件不变？\n    \n    当 darkflow 检测到您正在加载 `tiny-yolo-voc.weights` 时，它会在您的 cfg\u002F 目录中查找 `tiny-yolo-voc.cfg`，并将该配置文件与您通过 `--model cfg\u002Ftiny-yolo-voc-3c.cfg` 指定的新配置文件进行比较。在这种情况下，除了最后两层之外，每一层的权重数量都完全相同，因此它会将权重加载到除最后两层之外的所有层中，因为这两层现在包含不同数量的权重。\n\n\n## 摄像头\u002F视频文件演示\n\n对于完全在 CPU 上运行的演示：\n\n```bash\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo videofile.avi\n```\n\n对于 100% 在 GPU 上运行的演示：\n\n```bash\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo videofile.avi --gpu 1.0\n```\n\n要使用您的网络摄像头或相机，只需将 `videofile.avi` 替换为关键字 `camera`。\n\n要保存带有预测边界框的视频，可以添加 `--saveVideo` 选项。\n\n## 从其他 Python 应用程序中使用 darkflow\n\n请注意，`return_predict(img)` 必须接受一个 `numpy.ndarray`。您的图像必须事先加载好，并传递给 `return_predict(img)`。直接传递文件路径是无效的。\n\n`return_predict(img)` 的结果将是一个字典列表，每个字典代表检测到的一个对象，其值的格式与上述 JSON 输出相同。\n\n```python\nfrom darkflow.net.build import TFNet\nimport cv2\n\noptions = {\"model\": \"cfg\u002Fyolo.cfg\", \"load\": \"bin\u002Fyolo.weights\", \"threshold\": 0.1}\n\ntfnet = TFNet(options)\n\nimgcv = cv2.imread(\".\u002Fsample_img\u002Fsample_dog.jpg\")\nresult = tfnet.return_predict(imgcv)\nprint(result)\n```\n\n\n## 将构建好的图保存为 protobuf 文件（`.pb`）\n\n```bash\n## 将最新的检查点保存为 protobuf 文件\nflow --model cfg\u002Fyolo-new.cfg --load -1 --savepb\n\n## 将图和权重保存为 protobuf 文件\nflow --model cfg\u002Fyolo.cfg --load bin\u002Fyolo.weights --savepb\n```\n在保存 `.pb` 文件时，还会同时生成一个 `.meta` 文件。这个 `.meta` 文件是 `meta` 字典内容的 JSON 转储，其中包含了后处理所需的信息，例如 `anchors` 和 `labels`。这样一来，所有用于从图中进行预测和后处理所需的内容都包含在这两个文件中——无需再携带 `.cfg` 或任何标签文件。\n\n生成的 `.pb` 文件可用于将模型迁移到移动设备（JAVA \u002F C++ \u002F Objective-C++）。输入张量和输出张量的名称分别为 `'input'` 和 `'output'`。有关此 protobuf 文件的进一步使用，请参阅 TensorFlow 官方文档中关于 C++ API 的 [_此处_](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fr0.9\u002Fapi_docs\u002Fcc\u002Findex.html)。例如，在 iOS 应用程序中运行时，只需将该文件添加到 Bundle Resources 中，并在源代码中更新该文件的路径即可。\n\n此外，darkflow 还支持从 `.pb` 和 `.meta` 文件加载以生成预测结果（而不是从 `.cfg` 和检查点或 `.weights` 文件加载）。\n```bash\n## 基于 protobuf 文件对 sample_img 中的图像进行预测\nflow --pbLoad built_graph\u002Fyolo.pb --metaLoad built_graph\u002Fyolo.meta --imgdir sample_img\u002F\n```\n如果您希望在使用 `return_predict()` 时加载 `.pb` 和 `.meta` 文件，可以将 `\"pbLoad\"` 和 `\"metaLoad\"` 选项替代通常需要设置的 `\"model\"` 和 `\"load\"` 选项。\n\n以上就是全部内容。","# Darkflow 快速上手指南\n\nDarkflow 是基于 TensorFlow 实现的 YOLO（You Only Look Once）实时目标检测框架，支持模型训练、推理及移动端部署。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux \u002F macOS (Windows 需额外配置)\n*   **Python**: Python 3.x\n*   **核心依赖**:\n    *   TensorFlow 1.0+ (注意：Darkflow 主要基于 TF 1.x 开发)\n    *   NumPy\n    *   OpenCV 3.x\n    *   Cython (用于编译扩展)\n\n> **国内加速建议**：\n> 安装 Python 依赖时，推荐使用清华或阿里镜像源以提升下载速度：\n> ```bash\n> pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 安装步骤\n\n克隆项目后，进入 `darkflow` 目录，您可以选择以下三种方式之一进行安装：\n\n### 方式一：原地编译扩展（推荐用于开发调试）\n此方式不会全局安装，运行时需使用 `.\u002Fflow` 命令。\n```bash\npython3 setup.py build_ext --inplace\n```\n\n### 方式二：全局开发模式安装\n此方式将 `darkflow` 全局安装，且代码修改立即生效。\n```bash\npip install -e .\n```\n\n### 方式三：全局正式安装\n```bash\npip install .\n```\n\n> **权重文件获取**：\n> 官方权重文件若下载困难，可尝试从作者提供的 Google Drive 备份或其他国内网盘资源获取（包含 yolo-full, yolo-tiny 等版本）。\n\n## 基本使用\n\n安装完成后，即可使用 `flow` 命令进行模型推理。\n\n### 1. 查看帮助\n```bash\nflow --h\n```\n\n### 2. 运行预训练模型进行图片检测\n以下命令使用 `tiny-yolo` 模型对 `sample_img\u002F` 文件夹下的所有图片进行检测，并强制使用 GPU 加速：\n\n```bash\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --gpu 1.0\n```\n\n*   `--model`: 指定网络配置文件 (.cfg)\n*   `--load`: 指定预训练权重文件 (.weights)\n*   `--imgdir`: 指定输入图片文件夹\n*   结果默认保存在 `sample_img\u002Fout\u002F` 目录下。\n\n### 3. 输出 JSON 格式结果\n若需获取包含坐标和置信度的结构化数据，可添加 `--json` 参数：\n\n```bash\nflow --imgdir sample_img\u002F --model cfg\u002Ftiny-yolo.cfg --load bin\u002Ftiny-yolo.weights --json\n```\n\n输出示例：\n```json\n[{\"label\":\"person\", \"confidence\": 0.56, \"topleft\": {\"x\": 184, \"y\": 101}, \"bottomright\": {\"x\": 274, \"y\": 382}}]\n```\n\n### 4. 摄像头\u002F视频实时检测\n替换图片路径为视频文件或 `camera` 关键字即可进行实时流检测：\n\n```bash\n# 使用摄像头进行实时检测 (GPU 加速)\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo camera --gpu 1.0\n\n# 检测视频文件并保存结果\nflow --model cfg\u002Fyolo-new.cfg --load bin\u002Fyolo-new.weights --demo videofile.avi --saveVideo\n```\n\n### 5. Python 代码调用\n您可以在自己的 Python 项目中直接集成 Darkflow：\n\n```python\nfrom darkflow.net.build import TFNet\nimport cv2\n\noptions = {\"model\": \"cfg\u002Fyolo.cfg\", \"load\": \"bin\u002Fyolo.weights\", \"threshold\": 0.1}\n\ntfnet = TFNet(options)\n\n# 读取图片 (必须是 numpy.ndarray 格式)\nimgcv = cv2.imread(\".\u002Fsample_img\u002Fsample_dog.jpg\")\nresult = tfnet.return_predict(imgcv)\nprint(result)\n```","某安防初创团队需要将基于 Darknet 训练的高精度 YOLO 目标检测模型，快速部署到算力有限的 Android 巡检终端上。\n\n### 没有 darkflow 时\n- **框架隔离严重**：模型在 Darknet 环境下训练，但移动端推理依赖 TensorFlow Lite，两者格式不互通，需人工重写网络结构代码。\n- **权重迁移困难**：无法直接加载已训练的 `.weights` 文件，团队不得不寻找复杂的转换脚本或重新标注数据进行耗时训练。\n- **微调成本高昂**：若想针对特定场景（如只检测“安全帽”和“反光衣”）进行微调，必须搭建完整的 Darknet 训练环境，难以利用 TensorFlow 生态的优化算子。\n- **端侧部署受阻**：缺乏将模型导出为移动端友好的常量图（Constant Graph Def）的标准流程，导致模型体积过大且推理延迟高。\n\n### 使用 darkflow 后\n- **无缝框架桥接**：darkflow 直接将 Darknet 配置文件和权重翻译为 TensorFlow 图，无需手动重构网络，实现了从训练到推理的平滑过渡。\n- **权重即插即用**：通过 `--load` 参数一键加载现有的 `.weights` 文件，立即在 TensorFlow 中复现预训练效果，节省了数天的数据准备时间。\n- **灵活微调与裁剪**：支持修改 `labels.txt` 仅保留特定类别，并复用原有模型的底层特征提取层，利用 TensorFlow 轻松完成针对安防场景的微调。\n- **高效端侧落地**：直接将微调后的模型导出为常量图定义，完美适配 Android 设备，显著减小模型体积并提升实时检测帧率。\n\ndarkflow 核心价值在于打破了 Darknet 与 TensorFlow 之间的壁垒，让高性能目标检测模型能以最低成本快速落地移动端。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthtrieu_darkflow_cb938946.png","thtrieu","trieu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fthtrieu_c11d8ece.jpg","in between stages in life.",null,"https:\u002F\u002Fgithub.com\u002Fthtrieu",[80],{"name":81,"color":82,"percentage":83},"Python","#3572A5",100,6147,2034,"2026-04-14T00:10:43","GPL-3.0",4,"未说明","非必需。支持通过 --gpu 参数指定 GPU 使用比例（0.0-1.0），未明确具体显卡型号、显存大小或 CUDA 版本要求。",{"notes":92,"python":93,"dependencies":94},"该工具基于较旧的 TensorFlow 1.0 版本。运行前需手动下载 YOLO 权重文件（.weights）和配置文件（.cfg）。支持完全在 CPU 上运行，也可通过设置 --gpu 参数利用 GPU 加速。若需训练自定义模型，需准备对应的标签文件和标注数据。","Python 3",[95,96,97],"tensorflow==1.0","numpy","opencv-python==3",[14,16,15],[100,101,102,103,104,105,106,107,108,109,110,111],"tensorflow","graph","darknet","deep-learning","deep-neural-networks","convolutional-neural-networks","convolutional-networks","image-processing","object-detection","machine-learning","real-time","mobile-development","2026-03-27T02:49:30.150509","2026-04-19T15:46:30.538520",[115,120,125,130,135,140,144],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},42507,"如何解决 'No module named cy_yolo_findboxes' 错误？","该错误通常是因为安装不完整或 Python 环境配置问题。解决方法如下：\n1. 卸载并重新以编辑模式安装：运行 `pip uninstall darkflow` 然后 `pip install -e .`。\n2. 检查执行脚本：如果是直接运行 `flow` 文件，请编辑该文件第一行，将 `python` 改为 `python3`（如果你的默认 python 是 python2）。\n3. 确保在命令行而非 Jupyter Notebook 中运行，因为 Notebook 可能未使用正确的 Anaconda 库路径。","https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow\u002Fissues\u002F168",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},42508,"加载权重文件时出现 'AssertionError: Over-read yolo.weights' 或字节数不匹配错误怎么办？","这通常是因为配置文件（.cfg）与权重文件（.weights）不匹配。解决方案包括：\n1. 确保使用对应的 cfg 文件：例如，如果使用 yolov2 的权重，请下载并使用 pjreddie 官方仓库中的 `yolov2.cfg` 或 `yolov2-tiny-voc.cfg`。\n2. 修改源码偏移量：如果是特定的字节数断言错误（如 expect 64701556 bytes, found 180357512），可以尝试修改 `darkflow\u002Futils\u002Floader.py` 文件，将 `self.offset = 16` 改为 `self.offset = 20`。\n3. 检查权重来源：确保权重文件是从官方 Darknet 站点下载的完整文件，且未损坏。","https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow\u002Fissues\u002F107",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},42509,"如何在没有 GPU 的设备（如 Raspberry Pi）上运行 Darkflow？","可以在 CPU 上运行，虽然速度会比 GPU 慢。如果你使用 Docker，不需要使用 `nvidia-docker`，只需使用标准的 `docker` 命令即可。确保在安装层（Dockerfile 中的 RUN 命令）中不包含 GPU 特定的依赖，或者在运行命令时不指定 `--gpu` 参数。代码逻辑会自动适配 CPU 运行。","https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow\u002Fissues\u002F156",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},42510,"如何训练自定义数据集或使用非 COCO\u002FVOC 的类别？","要训练自定义数据集，你需要：\n1. 准备数据：通常需要转换标注格式（如从 CSV 或 Udacity 格式转换为 Darkflow 支持的格式）。\n2. 修改配置：创建自己的 `.cfg` 文件，并在其中修改 `classes` 数量以匹配你的数据集。\n3. 标签文件：虽然用户询问是否需要在根目录创建 `labels.txt`，但核心在于正确配置 `.cfg` 文件中的类别数，并确保训练脚本能读取到正确的标注目录。如果遇到 'Annotation directory not found' 错误，请检查路径配置是否正确。","https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow\u002Fissues\u002F31",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},42511,"如何评估模型的准确率或计算 mAP（平均精度均值）？","Darkflow 原生可能没有直接计算 mAP 的功能。建议如下：\n1. 外部脚本：寻找社区编写的脚本来计算 mAP，通常需要模型输出的预测结果和真实的标注文件（txt 格式）。\n2. 仓库选择注意：由于该仓库更新频率较低（最后更新可能在 2020 年），如果遇到困难可能无法获得及时帮助。建议考虑切换到更活跃的目标检测仓库（如更新的 YOLO 实现）来获取更好的评估工具和支持。","https:\u002F\u002Fgithub.com\u002Fthtrieu\u002Fdarkflow\u002Fissues\u002F613",{"id":141,"question_zh":142,"answer_zh":143,"source_url":129},42512,"运行 demo 时出现 'AssertionError: Cannot capture source' 错误是什么原因？","这个错误通常发生在尝试读取视频文件或摄像头源失败时。虽然在 Docker 环境中 GPU 配置正确（nvidia-smi 显示正常），但该错误更多与输入源路径有关。请检查：\n1. 视频文件路径是否正确，文件是否存在。\n2. 如果是读取摄像头，确认设备索引号是否正确。\n3. 在 Docker 容器中，确保挂载了包含视频文件的宿主机目录，或者摄像头设备已正确映射到容器内。",{"id":145,"question_zh":146,"answer_zh":147,"source_url":134},42513,"检测结果的置信度太低或看不到检测框怎么办？","如果运行测试脚本后没有看到检测框，可能是因为置信度阈值设置过高。你可以修改测试代码（例如 `net\u002Fyolov2\u002Ftest.py`），打印出 `boxes.probs` 来查看实际的置信度分数。确认你的物体置信度是否超过了代码中设定的阈值，必要时可以降低阈值以显示更多检测结果。",[]]