You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
|
5 months ago
|
# Debug Scripts for YOLO ONNX Detection
|
||
|
|
|
||
|
|
This directory contains debugging tools for troubleshooting YOLO object detection issues.
|
||
|
|
|
||
|
|
## Setup
|
||
|
|
|
||
|
|
1. Create a Python virtual environment:
|
||
|
|
```bash
|
||
|
|
python -m venv debug_env
|
||
|
|
source debug_env/bin/activate # On Windows: debug_env\Scripts\activate
|
||
|
|
```
|
||
|
|
|
||
|
|
2. Install dependencies:
|
||
|
|
```bash
|
||
|
|
pip install -r requirements.txt
|
||
|
|
```
|
||
|
|
|
||
|
|
## Scripts
|
||
|
|
|
||
|
|
### `debug_model_comparison.py`
|
||
|
|
Compares .pt model predictions with ONNX model outputs on the same static test image.
|
||
|
|
- Tests both PyTorch and ONNX models side-by-side
|
||
|
|
- Provides detailed debug output including preprocessing steps
|
||
|
|
- Useful for identifying model export issues
|
||
|
|
|
||
|
|
### `test_static_onnx.py`
|
||
|
|
Tests ONNX model against static images to isolate Android capture issues.
|
||
|
|
- Bypasses Android screen capture pipeline
|
||
|
|
- Tests multiple ONNX model variants
|
||
|
|
- Good for validating model functionality
|
||
|
|
|
||
|
|
### `export_model_variants.py`
|
||
|
|
Exports YOLO model variants with different NMS settings.
|
||
|
|
- Creates models with different confidence/IoU thresholds
|
||
|
|
- Useful for debugging detection sensitivity issues
|
||
|
|
|
||
|
|
### `inspect_onnx_model.py`
|
||
|
|
Inspects ONNX model structure and metadata.
|
||
|
|
- Verifies class mappings and model architecture
|
||
|
|
- Helpful for debugging model export problems
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
Place test images in `../../test_images/` and ensure model files are in `../../raw_models/`.
|
||
|
|
|
||
|
|
Example:
|
||
|
|
```bash
|
||
|
|
cd tools/debug_scripts
|
||
|
|
source debug_env/bin/activate
|
||
|
|
python debug_model_comparison.py
|
||
|
|
```
|