{"id":35076594,"url":"https://github.com/star-rein/onnx-detect","last_synced_at":"2026-05-22T02:03:20.131Z","repository":{"id":321955438,"uuid":"1087756671","full_name":"STAR-REIN/ONNX-Detect","owner":"STAR-REIN","description":"A general object detection application supporting ONNX models, image/video/camera inputs, with one-shot and real-time inference modes, and an intuitive GUI.","archived":false,"fork":false,"pushed_at":"2025-12-27T07:18:53.000Z","size":5237,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-29T02:44:17.631Z","etag":null,"topics":["gui","object-detection","onnx","onnx-runtime","pyqt6","pyqt6-desktop-application","yolo"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/STAR-REIN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-01T15:26:14.000Z","updated_at":"2025-12-06T15:36:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/STAR-REIN/ONNX-Detect","commit_stats":null,"previous_names":["star-rein/onnx-detect"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/STAR-REIN/ONNX-Detect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STAR-REIN%2FONNX-Detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STAR-REIN%2FONNX-Detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STAR-REIN%2FONNX-Detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STAR-REIN%2FONNX-Detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STAR-REIN","download_url":"https://codeload.github.com/STAR-REIN/ONNX-Detect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STAR-REIN%2FONNX-Detect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33324719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","object-detection","onnx","onnx-runtime","pyqt6","pyqt6-desktop-application","yolo"],"created_at":"2025-12-27T12:10:48.834Z","updated_at":"2026-05-22T02:03:20.124Z","avatar_url":"https://github.com/STAR-REIN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONNX Detect\n\n![ONNX-Detect-Screenshot](./assets/screenshot_v1.3.3.png)\n\nThis is a modern desktop application built on **PyQt6**, **PyQt-Fluent-Widgets**, and **ONNXRuntime**, specifically designed for ONNX model object detection. It features a qframelesswindow-based Acrylic interface, supporting multiple input sources, flexible model management (built-in and custom), and robust camera control capabilities.\n\n---\n\n## 🌎 Language\n\n* **[Read the original Chinese (中文) README here](./README_zh.md)**\n\n---\n\n## 🚀 Core Features\n\n* **Modern UI Interface**:\n    * Built with `PyQt6` and the `pyqt6-fluent-widgets` library, providing a smooth Fluent Design (WinUI) style.\n    * Supports the Windows 11 Acrylic translucent background effect and allows users to customize the background color tone.\n* **High-Performance Inference Backend**:\n    * Utilizes `onnxruntime-gpu` as the core inference engine, prioritizing **NVIDIA GPU (CUDA)** for acceleration, with seamless fallback to CPU.\n    * The UI automatically displays the currently used inference device (GPU or CPU).\n* **Flexible Inference Modes**:\n    * **One-Time Inference**: Supports image/video files and single-frame camera capture.\n    * **Real-Time Inference**: Supports video files and live camera input with pause/resume functionality.\n    * **Batch Inference (New)**:\n        * Supports **queuing multiple files** (images/videos) for automated sequential processing.\n        * Visual progress tracking for the entire batch task.\n* **Powerful Model Management**:\n    * **Built-in Models**: Automatically loads all YOLOv10 (n, s, m, l, x) ONNX models.\n    * **Custom Models**: Loads arbitrary ONNX models via YAML config, with full support for custom class names and colors.\n* **Batch Processing \u0026 Data Export**:\n    * **Smart Naming**: Customizable filename templates (e.g., `{original}_{timestamp}_{index}`) for organized output.\n    * **CSV Data Export**: Automatically generates CSV reports containing detailed detection data (classes, confidence, coordinates) for analysis.\n    * **Auto-Indexing**: Smart output directory management with automatic folder creation and index incrementing.\n* **Advanced Camera Control**:\n    * Automatically detects system cameras with \"Enable/Disable\" switching.\n    * **Resolution Settings**: Detects supported resolutions and allows user pre-selection.\n* **Comprehensive File Handling**:\n    * **Full support for Chinese (Unicode) paths**.\n    * Supports multiple image save formats (JPG, PNG, BMP, TIFF).\n* **Result Playback and State Management**:\n    * Built-in side-by-side video player for inference results.\n    * Robust application state machine to prevent user operation errors.\n* **Other Features**:\n    * \"About\" page, \"Clear\" function, and a mysterious Easter Egg.\n\n---\n\n## 📜 Changelog\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to Expand/Collapse\u003c/summary\u003e\n\n\u003ch3\u003eVersion Update Log\u003c/h3\u003e\n\u003cp\u003e\u003cb\u003eV1.3.4 - November 25, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eFixed font color issues in Windows 11 Dark Mode.\u003c/li\u003e\n    \u003cli\u003eOptimized interface font consistency.\u003c/li\u003e\n    \u003cli\u003eSimplified built-in models.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.3.3 - November 22, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e \n    \u003cli\u003eArchitecture Refactoring: Main interface code fully decoupled.\u003c/li\u003e\n    \u003cli\u003eBug Fix: Fixed the bug where USB camera hot-plugging was not recognized.\u003c/li\u003e\n    \u003cli\u003eUisual Optimization: Optimized the display size of bounding boxes and labels under high resolution.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.3.2 - November 20, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eCamera Management Refactoring: Supports displaying real hardware names, parallel detection, and optimized initialization speed.\u003c/li\u003e\n    \u003cli\u003eDevice Refresh: Identify newly inserted cameras via the \"Refresh Device List\" menu without restarting.\u003c/li\u003e\n    \u003cli\u003eCore Optimization: Adopted native Qt APIs for device information to ensure better compatibility.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.3.1 - November 20, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003e\u003cb\u003eCore Refactoring:\u003c/b\u003e Added full support for YOLOv11/v8 model formats and Dynamic Shape inputs.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003ePerformance Boost:\u003c/b\u003e Implemented NumPy vectorized post-processing and Letterbox preprocessing for significantly higher FPS and accuracy.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eStability Fix:\u003c/b\u003e Fixed application crashes caused by OpenCV NMS return type inconsistencies.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eUX Improvements:\u003c/b\u003e Optimized real-time FPS calculation (instantaneous) and implemented asynchronous model loading for smoother startup.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.3.0 - November 19, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003e\u003cb\u003eNew Batch Inference Mode:\u003c/b\u003e Supports multi-file queue processing and real-time progress display.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eNew Export Settings:\u003c/b\u003e Supports custom filename templates (timestamp, index, model name, etc.).\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eNew CSV Data Export:\u003c/b\u003e Supports generating summary reports or individual data files for batch tasks.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eOptimized Batch Management:\u003c/b\u003e Supports smart output directory indexing and automatic folder creation.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.2.4 - November 16, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eIntroduced confidence and IOU threshold sliders, allowing for dynamic adjustment.\u003c/li\u003e\n    \u003cli\u003eChanged the logo and added an initialization page.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.2.3 - November 13, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eSwitching the OpenCV camera API to MSMF on Windows to resolve stuttering issues with high-resolution cameras.\u003c/li\u003e\n    \u003cli\u003eOptimizing User Experience: Initialization and Resource Reloading\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.2.2 - October 31, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eAdded \"Camera Settings\" feature, allowing selection of camera resolution.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.2.1 - October 30, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eAdded a [Mysterious Easter Egg], triggered by a mysterious number.\u003c/li\u003e\n    \u003cli\u003eAdded \"About\" interface, displaying the update log.\u003c/li\u003e\n    \u003cli\u003eAdded \"Clear\" function, allowing the clearing of the output preview.\u003c/li\u003e\n    \u003cli\u003eFull support for Chinese path file operations; provides multiple formats for image files when saving inference results.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.2.0 - October 29, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eCode structure refactoring, referencing the MVVM architecture and integrating high-level abstraction layers.\u003c/li\u003e\n    \u003cli\u003eFixed several potential user UI interaction bugs.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.1.1 - October 28, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eAdded camera system: supports detection, selection, and enabling/disabling of cameras.\u003c/li\u003e\n    \u003cli\u003eOne-time and real-time inference modes support the camera as an input source.\u003c/li\u003e\n    \u003cli\u003eOptimized UI state management to enhance user experience.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.1.0 - October 27, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eAdded custom model loading, management, and configuration features.\u003c/li\u003e\n    \u003cli\u003eAdded custom theme color selection feature.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV1.0.0 - October 26, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eInitial release, resolved onnx-runtime compatibility issue preventing normal packaging of the executable with pyinstaller.\u003c/li\u003e\n    \u003cli\u003eUsed the PyQt6-fluent-widgets third-party library for UI beautification.\u003c/li\u003e\n    \u003cli\u003eSupports the Acrylic interface effect under Win11.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eV0.0.0 - October 26, 2025\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eInitial version, supports single YOLOv10 ONNX model loading and inference.\u003c/li\u003e\n    \u003cli\u003eProvides one-time image/video inference and real-time video inference features.\u003c/li\u003e\n    \u003cli\u003eStandard QT UI.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cb\u003eGitHub: \u003c/b\u003e\u003ca href=\"https://github.com/STAR-REIN/remote-repo\"\u003eClick to Visit\u003c/a\u003e\u003c/p\u003e\n\n\u003c/details\u003e\n\n---\n\n## 🛠️ Installation and Running\n\n### Option 1: (Recommended) Using the Packaged .exe File\n\n1.  Download the latest `.exe` executable file from the [Releases](https://github.com/STAR-REIN/ONNX-Detect/releases) page of this repository and download the environment compressed package from the [cloud drive link](https://pan.baidu.com/s/1tn5E1JG5FpbbVukE9UkVGg?pwd=ntdn) (password: ntdn). If you **don't want to download environment compressed package from cloud disk**, [Releases-v1.3.4](https://github.com/STAR-REIN/ONNX-Detect/releases/tag/v1.3.4) includes three versions of envpackage, you can download directly via GitHub.\n2.  Environment compressed package version descriptions:\n    * No suffix: Complete version, compressed package size is about 1.18G; comes with CUDA and onnx-runtime-gpu environment. You only need a GPU that supports CUDA 12.x.x to use GPU inference. **Recommended for users with a GPU but no pre-installed CUDA environment.**\n    * Lite_GPU: Simplified version, compressed package size is about 514MB; retains GPU support but requires the user to install the CUDA environment themselves. **Recommended for users with an existing CUDA environment.**\n    * Lite_CPU: Simplified version, compressed package size is about 454MB; removes GPU support and only supports CPU inference. **Recommended for users without a GPU.**\n3.  First, download and decompress the required environment package. Then, place the `.exe` file into the root directory of the decompressed folder and double-click to run.\n4.  Ensure that your `models` folder and (optional) `custom_models` folder are in the same directory as the `.exe` file.\n5.  Directly run the `.exe` file.\n\n### Option 2: Running from Source Code\n\n1.  **Clone the Repository**:\n    ```bash\n    git clone [https://github.com/STAR-REIN/ONNX-Detect.git](https://github.com/STAR-REIN/ONNX-Detect.git)\n    cd ONNX-Detect\n    ```\n\n2.  **Create Conda Environment**:\n    This project uses the `environment.yml` file to manage dependencies.\n    ```bash\n    conda env create -f environment.yml\n    ```\n\n3.  **Activate Environment**:\n    ```bash\n    conda activate pyqt6_package\n    ```\n\n4.  **Prepare Models**:\n    * Download the built-in model compressed package from the [cloud drive link](https://pan.baidu.com/s/). (Cloud drive link to be updated)\n    * Place your downloaded YOLOv10 `basic` and `enhance` ONNX model files into the `models` folder in the root directory.\n    * (Optional) Configure the `custom_models` folder according to the instructions in the next section.\n\n5.  **Run the Program**:\n    ```bash\n    python main.py\n    ```\n\n**Dependency Notes**:\n* This project requires **Python 3.12.1**.\n* GPU acceleration relies on `onnxruntime-gpu==1.19.0`. Please ensure your **NVIDIA driver** and **CUDA Toolkit** versions are compatible with ONNXRuntime. If your GPU is not supported, `onnxruntime-gpu` will automatically fall back to CPU mode.\n\n---\n\n## 📖 Usage Guide\n\n1.  **Start the Program**: Run `.exe` or `python main.py`.\n2.  **Select a Model**:\n    * **Built-in Models**: Click \"Built-in Model Selection\" and choose a model from the dropdown menu. The program will load it automatically.\n    * **Custom Models**: Click \"External Model Management\" -\u003e \"Load Custom Models\" to load your YAML configuration. Then click \"External Model Selection\" to choose a model.\n3.  **Select Inference Mode**:\n    * **One-Time Mode**: For processing a single file or a single frame.\n    * **Run-Time Mode (Real-Time)**: For processing video files or a live camera stream.\n4.  **Select Input Source**:\n    * **File**: Click the \"Upload File\" button and select an image or video. A preview will display after upload.\n    * **Camera**:\n        1.  (Optional) Click the \"Camera Settings\" button. While the **camera system is disabled**, pre-select a resolution for the camera you plan to use.\n        2.  Click \"Camera Selection\" -\u003e \"Enable/Disable ✕\" to start the camera system.\n        3.  Click \"Camera Selection\" again and select a detected camera from the list (e.g., \"Camera 0\").\n        4.  The input preview area will now display the live camera feed.\n5.  **Start Inference**:\n    * Click the \"Start Inference\" (or \"Start Real-Time Inference\") button.\n    * The button will change to \"Stop Inference\" during the process.\n    * In real-time inference mode, the \"Play/Pause\" button can be used to pause/resume the inference thread.\n6.  **View Results**:\n    * **One-Time Mode**: Results will appear in the right-side \"Inference Results\" area. If it's a video, the player will load automatically after processing is complete.\n    * **Real-Time Mode**: \"Original Frame\" and \"Inference Results\" will be displayed simultaneously on the left and right sides.\n7.  **Save Results**: After inference is complete, click \"File\" -\u003e \"Save Inference Results.\"\n\n---\n\n## ⚙️ Configuring Custom Models\n\nThe power of this tool lies in its ability to easily load your own ONNX models.\n\n1.  **Create Directory**: In the root directory where the `.exe` file or `main.py` is located, create a folder named `custom_models`.\n2.  **Place Files**:\n    * Place your `.onnx` model file (e.g., `my_model.onnx`) into the `custom_models` folder.\n    * Create a configuration file named `custom_models_config.yaml` in this folder.\n3.  **Edit `custom_models_config.yaml`**:\n    The application will automatically create a template (`.template`) of this file upon launch. You can refer to this template for editing. The format is as follows:\n\n    ```yaml\n    # ==============================================================================\n    # Custom ONNX Model Configuration Instructions (Template Content)\n    # ... (Instruction Text) ...\n    # ------------------------------------------------------------------------------\n    # Example Configuration:\n    # ==============================================================================\n\n    custom_models:\n      - model_file: \"my_custom_model_v1.onnx\"  # Ensure this onnx file is in the custom_models directory\n        menu_display_name: \"My Custom Model - V1 Car Pedestrian\"\n        class_names: [\"car\", \"person\", \"truck\", \"bus\"]\n        colors: [\"#FF0000\", \"#00FF00\", \"#0000FF\", \"#FFFF00\"] # Corresponding colors for car, person, truck, bus\n\n      - model_file: \"another_custom_detector.onnx\" # Another custom model\n        menu_display_name: \"Another Detector - Object Recognition\"\n        class_names: [\"bottle\", \"cup\", \"keyboard\", \"mouse\", \"laptop\", \"monitor\"]\n        colors:\n          - \"#E74C3C\" # Red\n          - \"#2ECC71\" # Green\n          - \"#3498DB\" # Blue\n          - \"#F1C40F\" # Yellow\n          - \"#9B59B6\" # Purple\n          - \"#1ABC9C\" # Teal\n          # ... More colors\n    # ==============================================================================\n    ```\n\n4.  **Load Models**:\n    * Start the application.\n    * Click \"External Model Management\" -\u003e \"Load Custom Models.\"\n    * The program will read `custom_models_config.yaml`, verify the existence of the `.onnx` files, and add all valid models to the \"External Model Selection\" dropdown menu.\n\n---\n\n## 📄 License\n\nThis project is licensed under the [GPLv3 License](LICENSE).\n\n## 🙏 Acknowledgments\n\n* [YOLOv10](https://github.com/THU-MIG/YOLOv10)\n* [PyQt6](https://www.riverbankcomputing.com/software/pyqt/)\n* [PyQt-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)\n* [ONNXRuntime](https://github.com/microsoft/onnxruntime)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstar-rein%2Fonnx-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstar-rein%2Fonnx-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstar-rein%2Fonnx-detect/lists"}