YOLO v2 Tiny is a real-time object detection model from TensorFlow.js* framework. This model was pretrained on COCO* dataset with 80 classes.
0. Install additional dependencies: ``` h5py keras tensorflowjs ``
commit).
Convert the model to Keras\* format using
tensorflowjs_converterscript, e.g.:
`` tensorflowjs_converter –input_format tfjs_layers_model –output_format keras <model_in>.json <model_out>.h5 ```
Apply
keras_to_tensorflow.py.patch<tt>: `` git apply keras_to_tensorflow.py.patch ```Metric | Value |
---|---|
Type | Detection |
GFLOPs | 5.424 |
MParams | 11.229 |
Source framework | TensorFlow.js* |
Accuracy metrics obtained on COCO* validation dataset for converted model.
Metric | Value |
---|---|
mAP | 27.34% |
COCO* mAP | 29.11% |
Image, name -
input_1
, shape - 1,416,416,3
, format is B,H,W,C
where:
B
- batch sizeH
- heightW
- widthC
- channelChannel order is
RGB
. Scale value - 255.
Image, name -
input_1
, shape - 1,3,416,416
, format is B,C,H,W
where:
B
- batch sizeC
- channelH
- heightW
- widthChannel order is
BGR
.
The array of detection summary info, name -
conv2d_9/BiasAdd
, shape - 1,13,13,425
, format is B,Cx,Cy,N*85
where
B
- batch sizeCx
, Cy
- cell indexN
- number of detection boxes for cellDetection box has format [
x
,y
,h
,w
,box_score
,class_no_1
, ..., class_no_80
], where:
x
,y
) - raw coordinates of box center, apply sigmoid function to get coordinates relative to the cellh
,w
- raw height and width of box, apply exponential function and multiply by corresponding anchors to get height and width values relative to the cellbox_score
- confidence of detection box, apply sigmoid function to get confidence in [0,1] rangeclass_no_1
,...,class_no_80
- probability distribution over the classes in logits format, apply softmax function and multiply by obtained confidence value to get confidence of each classThe anchor values are
0.57273,0.677385, 1.87446,2.06253, 3.33843,5.47434, 7.88282,3.52778, 9.77052,9.16828
.
The array of detection summary info, name -
conv2d_9/BiasAdd/YoloRegion
, shape - 1,71825
, which could be reshaped to 1, 425, 13, 13
with format B,N*85,Cx,Cy
where
B
- batch sizeN
- number of detection boxes for cellCx
, Cy
- cell indexDetection box has format [
x
,y
,h
,w
,box_score
,class_no_1
, ..., class_no_80
], where:
x
,y
) - coordinates of box center relative to the cellh
,w
- raw height and width of box, apply exponential function and multiply with corresponding anchors to get height and width values relative to the cellbox_score
- confidence of detection box in [0,1] rangeclass_no_1
,...,class_no_80
- probability distribution over the classes in the [0,1] range, multiply by confidence value to get confidence of each classThe anchor values are
0.57273,0.677385, 1.87446,2.06253, 3.33843,5.47434, 7.88282,3.52778, 9.77052,9.16828
.
The original model is distributed under the following license: