File size: 5,274 Bytes
28b323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550d584
 
 
 
 
28b323b
 
 
 
 
 
 
 
 
 
00502c9
28b323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9975c21
 
28b323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9975c21
 
28b323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9975c21
 
28b323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
language:
- vi
license: agpl-3.0
library_name: ultralytics
pipeline_tag: object-detection
tags:
- yolo
- yolov8
- onnx
- torchscript
- tensorrt
- int8
- fp16
- vision
- object-detection
- traffic-sign
- vietnam
---

**Documentation languages**

- 🇺🇸 English: README.md
- 🇻🇳 Tiếng Việt: README.vi.md

# VTSR

VTSR is a YOLOv8n object-detection model for recognizing 56 classes of Vietnamese traffic signs.

This repository focuses on optimized deployment artifacts derived from the original FP32 PyTorch checkpoint, including ONNX INT8, TensorRT INT8, and TorchScript FP16 models.

## Demo

An interactive Gradio demo is available on Hugging Face Spaces:

https://huggingface.co/spaces/liamxdev/vtsr

The demo currently uses the ONNX INT8 artifact for CPU-compatible inference.

## Model details

| Property           | Value                           |
| ------------------ | ------------------------------- |
| Task               | Object detection                |
| Architecture       | YOLOv8n                         |
| Classes            | 56                              |
| Input size         | 640 × 640                       |
| Label descriptions | `label-mapping.json`            |
| Dataset            | Vietnam Traffic Sign Dataset v3 |
| License            | AGPL-3.0                        |

The model returns traffic-sign codes such as `P-102`, `R-303`, and `W-224`. Vietnamese descriptions for these codes are provided separately in `label-mapping.json`.

## Artifacts

| File                    | Precision | Target platform                              |
| ----------------------- | --------- | -------------------------------------------- |
| `vtsr.pt`               | FP32      | PyTorch                                      |
| `vtsr_int8.onnx`        | INT8      | ONNX Runtime, CPU, cross-platform deployment |
| `vtsr.torchscript`      | FP16      | TorchScript runtimes                         |
| `vtsr.engine`           | INT8      | NVIDIA TensorRT and Jetson devices           |
| `label-mapping.json`    | —         | Traffic-sign code descriptions               |

> The original FP32 PyTorch checkpoint is intentionally omitted. This repository provides optimized deployment artifacts only.

## Usage

Install dependencies:

```bash
pip install ultralytics
```

Run inference:

```python
from ultralytics import YOLO

# Supported artifacts:
# vtsr.pt
# vtsr_int8.onnx
# vtsr.torchscript
# vtsr.engine

model = YOLO("vtsr_int8.onnx")

results = model.predict(
    source="traffic.jpg",
    imgsz=640,
    conf=0.25,
)

results[0].save("result.jpg")
```

See `label-mapping.json` for Vietnamese descriptions of traffic-sign codes.

## Download from Hugging Face Hub

```python
from huggingface_hub import hf_hub_download

repo_id = "liamxdev/vtsr"

model_path = hf_hub_download(
    repo_id=repo_id,
    filename="vtsr_int8.onnx",
)

mapping_path = hf_hub_download(
    repo_id=repo_id,
    filename="label-mapping.json",
)
```

Other artifacts can be downloaded in the same way:

* `vtsr.pt`
* `vtsr.torchscript`
* `vtsr.engine`

## Benchmark

See [benchmark.md](benchmark.md) for latency and throughput measurements.

## Supported classes

The model covers 56 Vietnamese traffic-sign codes in four broad groups:

* `P-*`: prohibition signs.
* `R-*`: mandatory and instruction signs.
* `W-*`: warning signs.
* `S-*` and `DP-*`: supplementary or special signs represented in the training dataset.

See `label-mapping.json` for the complete list and Vietnamese meanings.

## Training data

The model was trained using version 3 of the [Vietnam Traffic Sign Dataset](https://universe.roboflow.com/giang-yp9g1/vietnam-traffic-sign-altsi/dataset/3) published on Roboflow Universe. The dataset metadata declares a CC BY 4.0 license.

## Intended use

* Educational and research projects.
* Traffic-scene analysis prototypes.
* Vietnamese traffic-sign detection demos.
* CPU-oriented deployment through ONNX Runtime.
* NVIDIA GPU and Jetson deployment through TensorRT.
* Lightweight deployment through TorchScript.

## Limitations

* The model recognizes only the 56 classes listed in `label-mapping.json`.
* Detection quality can decrease with small, blurred, occluded, damaged, poorly lit, or unusually angled signs.
* Images outside the training distribution may produce missed detections or false positives.
* A detection is not a substitute for official road-sign interpretation or safety-critical driving decisions.
* Quantized and reduced-precision models may exhibit accuracy differences relative to the original PyTorch checkpoint.
* TensorRT engines are hardware-specific and may need to be regenerated for different GPU architectures.

## License

The exported model contains Ultralytics YOLO components and is distributed under the AGPL-3.0 license. Dataset attribution and its CC BY 4.0 terms apply separately.

For commercial licensing of Ultralytics components, see https://www.ultralytics.com/license.

## Citation

```bibtex
@misc{vietnam_traffic_sign_altsi_dataset,
  title        = {Vietnam Traffic Sign Dataset},
  author       = {giang},
  year         = {2024},
  publisher    = {Roboflow Universe},
  howpublished = {\url{https://universe.roboflow.com/giang-yp9g1/vietnam-traffic-sign-altsi}}
}
```