File size: 1,633 Bytes
c155dec
 
 
 
 
 
 
 
 
 
 
 
 
9ef867f
45f16b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c155dec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
license: openrail++
datasets:
- sshao0516/CrowdHuman
language:
- en
base_model:
- pyronear/yolov11s
pipeline_tag: object-detection
tags:
- person
- head
---
# PHD Person + Head Detection — YOLOv11 ONNX

Dual-class detection model (Person Head Detection) based on YOLOv11, exported to ONNX and configured for DeepStream/ONNX Runtime inference. Detects both **persons** (class 0) and **heads** (class 1) simultaneously.

## Files

| File | Description |
|---|---|
| `yolov11_phd_s.onnx` | YOLOv11-small ONNX model weights |
| `inference.py` | Standalone ONNX Runtime inference script |

## Model Details

| Property | Value |
|---|---|
| Architecture | YOLOv11-small |
| Task | Dual-class detection (person + head) |
| Classes | `0` — person, `1` — head |
| Dataset | CrowdHuman |
| Input format | BGR, NCHW |
| Scale factor | 0.0039215697906911373 (≈ 1/255) |

## Running Standalone Inference

### Requirements

```bash
pip install onnxruntime-gpu opencv-python numpy
```

For CPU-only:
```bash
pip install onnxruntime opencv-python numpy
```

### Usage

Place a test image in the same directory, then:

```bash
python inference.py
```

By default the script reads `test_image.jpg`, runs inference, and writes `output.jpg` with bounding boxes drawn.

To change the input image or thresholds, edit the config block at the top of `inference.py`:

```python
CONF_THRESHOLD = 0.2   # pre-cluster-threshold
IOU_THRESHOLD  = 0.6   # nms-iou-threshold
TOPK           = 300
```

### Output

- Console: detection count, bounding boxes, and confidence scores
- `output.jpg`: input image with green bounding boxes and labels overlaid