Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tiny YOLOv3
Description
This model is a neural network for real-time object detection that detects 80 different classes. It is very fast and accurate. It is a smaller version of YOLOv3 model.
Model
Inference
Input to model
Resized image
(1x3x416x416)
Original image size
(1x2)
which is[image.size[1], image.size[0]]
Preprocessing steps
The images have to be loaded in to a range of [0, 1]. The transformation should preferrably happen at preprocessing.
The following code shows how to preprocess a NCHW tensor:
Output of model
The model has 3 outputs.
boxes:
(1x'n_candidates'x4)
, the coordinates of all anchor boxes,scores:
(1x80x'n_candidates')
, the scores of all anchor boxes per class,indices:
('nbox'x3)
, selected indices from the boxes tensor. The selected index format is (batch_index, class_index, box_index). The class list is herePostprocessing steps
Post processing and meaning of output
out_boxes, out_scores, out_classes are list of resulting boxes, scores, and classes.
Dataset (Train and validation)
We use pretrained weights from pjreddie.com here.
Validation accuracy
Metric is COCO box mAP (averaged over IoU of 0.5:0.95), computed over 2017 COCO val data.
mAP of 0.331 based on original tiny Yolov3 model here
Metric is COCO box mAP (IoU=0.50:0.95 | area=large | maxDets=100), computed over 2017 COCO val data.
mAP of 0.218
Metric is COCO box mAP (IoU=0.50:0.95 | area=large | maxDets=100), computed over 2017 COCO val data.
mAP of 0.210
Quantization
Tiny YOLOv3 INT8 is obtained by quantizing Tiny YOLOv3 FP32 model. We use Intel® Neural Compressor with onnxruntime backend to perform quantization. View the instructions to understand how to use Intel® Neural Compressor for quantization.
Environment
onnx: 1.11.0
onnxruntime: 1.10.0
Prepare model
Model quantize
## Publication/Attribution Joseph Redmon, Ali Farhadi. YOLOv3: An Incremental Improvement, [paper](https://arxiv.org/pdf/1804.02767.pdf)
References
* [Intel® Neural Compressor](https://github.com/intel/neural-compressor)
Contributors
License
MIT License