├── INT8 ├── coco128 │ ├── annotations │ │ └── output.json │ ├── classes.txt │ ├── images │ │ ├── 000000000009.jpg │ │ ├── 000000000025.jpg │ │ ├── 000000000030.jpg │ │ ├── 000000000034.jpg │ │ ├── 000000000036.jpg │ │ ├── 000000000042.jpg │ │ ├── 000000000049.jpg │ │ ├── 000000000061.jpg │ │ ├── 000000000064.jpg │ │ ├── 000000000071.jpg │ │ ├── 000000000072.jpg │ │ ├── 000000000073.jpg │ │ ├── 000000000074.jpg │ │ ├── 000000000077.jpg │ │ ├── 000000000078.jpg │ │ ├── 000000000081.jpg │ │ ├── 000000000086.jpg │ │ ├── 000000000089.jpg │ │ ├── 000000000092.jpg │ │ ├── 000000000094.jpg │ │ ├── 000000000109.jpg │ │ ├── 000000000110.jpg │ │ ├── 000000000113.jpg │ │ ├── 000000000127.jpg │ │ ├── 000000000133.jpg │ │ ├── 000000000136.jpg │ │ ├── 000000000138.jpg │ │ ├── 000000000142.jpg │ │ ├── 000000000143.jpg │ │ ├── 000000000144.jpg │ │ ├── 000000000149.jpg │ │ ├── 000000000151.jpg │ │ ├── 000000000154.jpg │ │ ├── 000000000164.jpg │ │ ├── 000000000165.jpg │ │ ├── 000000000192.jpg │ │ ├── 000000000194.jpg │ │ ├── 000000000196.jpg │ │ ├── 000000000201.jpg │ │ ├── 000000000208.jpg │ │ ├── 000000000241.jpg │ │ ├── 000000000247.jpg │ │ ├── 000000000250.jpg │ │ ├── 000000000257.jpg │ │ ├── 000000000260.jpg │ │ ├── 000000000263.jpg │ │ ├── 000000000283.jpg │ │ ├── 000000000294.jpg │ │ ├── 000000000307.jpg │ │ ├── 000000000308.jpg │ │ ├── 000000000309.jpg │ │ ├── 000000000312.jpg │ │ ├── 000000000315.jpg │ │ ├── 000000000321.jpg │ │ ├── 000000000322.jpg │ │ ├── 000000000326.jpg │ │ ├── 000000000328.jpg │ │ ├── 000000000332.jpg │ │ ├── 000000000338.jpg │ │ ├── 000000000349.jpg │ │ ├── 000000000357.jpg │ │ ├── 000000000359.jpg │ │ ├── 000000000360.jpg │ │ ├── 000000000368.jpg │ │ ├── 000000000370.jpg │ │ ├── 000000000382.jpg │ │ ├── 000000000384.jpg │ │ ├── 000000000387.jpg │ │ ├── 000000000389.jpg │ │ ├── 000000000394.jpg │ │ ├── 000000000395.jpg │ │ ├── 000000000397.jpg │ │ ├── 000000000400.jpg │ │ ├── 000000000404.jpg │ │ ├── 000000000415.jpg │ │ ├── 000000000419.jpg │ │ ├── 000000000428.jpg │ │ ├── 000000000431.jpg │ │ ├── 000000000436.jpg │ │ ├── 000000000438.jpg │ │ ├── 000000000443.jpg │ │ ├── 000000000446.jpg │ │ ├── 000000000450.jpg │ │ ├── 000000000459.jpg │ │ ├── 000000000471.jpg │ │ ├── 000000000472.jpg │ │ ├── 000000000474.jpg │ │ ├── 000000000486.jpg │ │ ├── 000000000488.jpg │ │ ├── 000000000490.jpg │ │ ├── 000000000491.jpg │ │ ├── 000000000502.jpg │ │ ├── 000000000508.jpg │ │ ├── 000000000510.jpg │ │ ├── 000000000514.jpg │ │ ├── 000000000520.jpg │ │ ├── 000000000529.jpg │ │ ├── 000000000531.jpg │ │ ├── 000000000532.jpg │ │ ├── 000000000536.jpg │ │ ├── 000000000540.jpg │ │ ├── 000000000542.jpg │ │ ├── 000000000544.jpg │ │ ├── 000000000560.jpg │ │ ├── 000000000562.jpg │ │ ├── 000000000564.jpg │ │ ├── 000000000569.jpg │ │ ├── 000000000572.jpg │ │ ├── 000000000575.jpg │ │ ├── 000000000581.jpg │ │ ├── 000000000584.jpg │ │ ├── 000000000589.jpg │ │ ├── 000000000590.jpg │ │ ├── 000000000595.jpg │ │ ├── 000000000597.jpg │ │ ├── 000000000599.jpg │ │ ├── 000000000605.jpg │ │ ├── 000000000612.jpg │ │ ├── 000000000620.jpg │ │ ├── 000000000623.jpg │ │ ├── 000000000625.jpg │ │ ├── 000000000626.jpg │ │ ├── 000000000629.jpg │ │ ├── 000000000634.jpg │ │ ├── 000000000636.jpg │ │ ├── 000000000641.jpg │ │ ├── 000000000643.jpg │ │ └── 000000000650.jpg │ └── labels │ │ ├── 000000000009.txt │ │ ├── 000000000025.txt │ │ ├── 000000000030.txt │ │ ├── 000000000034.txt │ │ ├── 000000000036.txt │ │ ├── 000000000042.txt │ │ ├── 000000000049.txt │ │ ├── 000000000061.txt │ │ ├── 000000000064.txt │ │ ├── 000000000071.txt │ │ ├── 000000000072.txt │ │ ├── 000000000073.txt │ │ ├── 000000000074.txt │ │ ├── 000000000077.txt │ │ ├── 000000000078.txt │ │ ├── 000000000081.txt │ │ ├── 000000000086.txt │ │ ├── 000000000089.txt │ │ ├── 000000000092.txt │ │ ├── 000000000094.txt │ │ ├── 000000000109.txt │ │ ├── 000000000110.txt │ │ ├── 000000000113.txt │ │ ├── 000000000127.txt │ │ ├── 000000000133.txt │ │ ├── 000000000136.txt │ │ ├── 000000000138.txt │ │ ├── 000000000142.txt │ │ ├── 000000000143.txt │ │ ├── 000000000144.txt │ │ ├── 000000000149.txt │ │ ├── 000000000151.txt │ │ ├── 000000000154.txt │ │ ├── 000000000164.txt │ │ ├── 000000000165.txt │ │ ├── 000000000192.txt │ │ ├── 000000000194.txt │ │ ├── 000000000196.txt │ │ ├── 000000000201.txt │ │ ├── 000000000208.txt │ │ ├── 000000000241.txt │ │ ├── 000000000247.txt │ │ ├── 000000000250.txt │ │ ├── 000000000257.txt │ │ ├── 000000000260.txt │ │ ├── 000000000263.txt │ │ ├── 000000000283.txt │ │ ├── 000000000294.txt │ │ ├── 000000000307.txt │ │ ├── 000000000308.txt │ │ ├── 000000000309.txt │ │ ├── 000000000312.txt │ │ ├── 000000000315.txt │ │ ├── 000000000321.txt │ │ ├── 000000000322.txt │ │ ├── 000000000326.txt │ │ ├── 000000000328.txt │ │ ├── 000000000332.txt │ │ ├── 000000000338.txt │ │ ├── 000000000349.txt │ │ ├── 000000000357.txt │ │ ├── 000000000359.txt │ │ ├── 000000000360.txt │ │ ├── 000000000368.txt │ │ ├── 000000000370.txt │ │ ├── 000000000382.txt │ │ ├── 000000000384.txt │ │ ├── 000000000387.txt │ │ ├── 000000000389.txt │ │ ├── 000000000394.txt │ │ ├── 000000000395.txt │ │ ├── 000000000397.txt │ │ ├── 000000000400.txt │ │ ├── 000000000404.txt │ │ ├── 000000000415.txt │ │ ├── 000000000419.txt │ │ ├── 000000000428.txt │ │ ├── 000000000431.txt │ │ ├── 000000000436.txt │ │ ├── 000000000438.txt │ │ ├── 000000000443.txt │ │ ├── 000000000446.txt │ │ ├── 000000000450.txt │ │ ├── 000000000459.txt │ │ ├── 000000000471.txt │ │ ├── 000000000472.txt │ │ ├── 000000000474.txt │ │ ├── 000000000486.txt │ │ ├── 000000000488.txt │ │ ├── 000000000490.txt │ │ ├── 000000000491.txt │ │ ├── 000000000502.txt │ │ ├── 000000000508.txt │ │ ├── 000000000510.txt │ │ ├── 000000000514.txt │ │ ├── 000000000520.txt │ │ ├── 000000000529.txt │ │ ├── 000000000531.txt │ │ ├── 000000000532.txt │ │ ├── 000000000536.txt │ │ ├── 000000000540.txt │ │ ├── 000000000542.txt │ │ ├── 000000000544.txt │ │ ├── 000000000560.txt │ │ ├── 000000000562.txt │ │ ├── 000000000564.txt │ │ ├── 000000000569.txt │ │ ├── 000000000572.txt │ │ ├── 000000000575.txt │ │ ├── 000000000581.txt │ │ ├── 000000000584.txt │ │ ├── 000000000589.txt │ │ ├── 000000000590.txt │ │ ├── 000000000595.txt │ │ ├── 000000000597.txt │ │ ├── 000000000599.txt │ │ ├── 000000000605.txt │ │ ├── 000000000612.txt │ │ ├── 000000000620.txt │ │ ├── 000000000623.txt │ │ ├── 000000000625.txt │ │ ├── 000000000626.txt │ │ ├── 000000000629.txt │ │ ├── 000000000634.txt │ │ ├── 000000000636.txt │ │ ├── 000000000641.txt │ │ ├── 000000000643.txt │ │ └── 000000000650.txt ├── convert.py ├── yolov4_416x416_coco.yml └── yolov4_416x416_qtz.json ├── LICENSE ├── README.md ├── assets ├── darknet-v4-416.jpg ├── darknet-v4tiny-416.jpg ├── yolov4-416.png ├── yolov4.png └── yolov4tiny416.png ├── cfg ├── coco.names ├── yolov4-relu.cfg ├── yolov4-tiny.cfg └── yolov4.cfg ├── convert_weights_pb.py ├── pythondemo ├── 2020.4 │ ├── monitors.py │ ├── monitors_extension │ │ ├── CMakeLists.txt │ │ └── monitors_extension.cpp │ ├── object_detection_demo_yolov3_async.py │ └── object_detection_demo_yolov4_async.py ├── 2021.1 │ ├── helpers.py │ ├── monitors.py │ ├── monitors_extension │ │ ├── CMakeLists.txt │ │ └── monitors_extension.cpp │ ├── object_detection_demo_yolov3_async.py │ └── performance_metrics.py ├── 2021.2 │ └── object_detection_demo_yolov3_async.py └── 2021.3 │ └── object_detection_demo_yolov3_async.py ├── utils.py ├── yolo_v4.py ├── yolo_v4_tiny.json ├── yolo_v4_tiny.py ├── yolov4-relu ├── cfg │ ├── coco.names │ ├── yolov4-relu.cfg │ ├── yolov4-tiny.cfg │ └── yolov4.cfg ├── convert_weights_pb.py ├── utils.py ├── yolo_v4.py ├── yolo_v4_tiny.py └── yolov4.json └── yolov4.json /INT8/coco128/classes.txt: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorbike 5 | aeroplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | sofa 59 | pottedplant 60 | bed 61 | diningtable 62 | toilet 63 | tvmonitor 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /INT8/coco128/images/000000000009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000009.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000025.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000030.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000034.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000036.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000042.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000049.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000061.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000064.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000064.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000071.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000071.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000072.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000072.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000073.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000074.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000077.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000077.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000078.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000081.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000081.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000086.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000086.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000089.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000089.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000092.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000094.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000109.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000109.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000110.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000110.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000113.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000113.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000127.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000127.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000133.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000133.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000136.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000136.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000138.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000138.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000142.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000142.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000143.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000143.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000144.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000144.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000149.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000149.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000151.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000151.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000154.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000154.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000164.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000164.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000165.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000165.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000192.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000192.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000194.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000194.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000196.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000196.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000201.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000201.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000208.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000208.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000241.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000241.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000247.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000247.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000250.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000250.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000257.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000257.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000260.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000260.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000263.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000263.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000283.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000283.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000294.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000294.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000307.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000307.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000308.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000308.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000309.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000309.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000312.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000312.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000315.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000315.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000321.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000321.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000322.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000322.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000326.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000326.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000328.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000328.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000332.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000338.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000338.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000349.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000349.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000357.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000357.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000359.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000359.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000360.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000360.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000368.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000368.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000370.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000370.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000382.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000382.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000384.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000384.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000387.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000387.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000389.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000389.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000394.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000394.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000395.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000395.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000397.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000397.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000400.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000404.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000415.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000415.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000419.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000419.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000428.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000428.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000431.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000431.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000436.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000436.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000438.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000438.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000443.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000443.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000446.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000446.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000450.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000450.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000459.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000459.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000471.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000471.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000472.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000472.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000474.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000474.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000486.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000486.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000488.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000488.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000490.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000490.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000491.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000491.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000502.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000502.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000508.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000508.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000510.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000510.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000514.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000514.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000520.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000520.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000529.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000529.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000531.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000531.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000532.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000532.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000536.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000536.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000540.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000540.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000542.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000542.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000544.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000544.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000560.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000560.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000562.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000562.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000564.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000564.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000569.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000569.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000572.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000572.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000575.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000575.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000581.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000581.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000584.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000584.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000589.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000589.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000590.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000590.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000595.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000595.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000597.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000597.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000599.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000599.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000605.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000605.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000612.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000612.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000620.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000620.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000623.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000623.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000625.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000625.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000626.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000626.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000629.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000629.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000634.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000634.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000636.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000636.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000641.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000641.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000643.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000643.jpg -------------------------------------------------------------------------------- /INT8/coco128/images/000000000650.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/images/000000000650.jpg -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000009.txt: -------------------------------------------------------------------------------- 1 | 45 0.479492 0.688771 0.955609 0.5955 2 | 45 0.736516 0.247188 0.498875 0.476417 3 | 50 0.637063 0.732938 0.494125 0.510583 4 | 45 0.339438 0.418896 0.678875 0.7815 5 | 49 0.646836 0.132552 0.118047 0.096937 6 | 49 0.773148 0.129802 0.090734 0.097229 7 | 49 0.668297 0.226906 0.131281 0.146896 8 | 49 0.642859 0.079219 0.148063 0.148062 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000025.txt: -------------------------------------------------------------------------------- 1 | 23 0.770336 0.489695 0.335891 0.697559 2 | 23 0.185977 0.901608 0.206297 0.129554 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000030.txt: -------------------------------------------------------------------------------- 1 | 58 0.519219 0.451121 0.39825 0.75729 2 | 75 0.501188 0.592138 0.26 0.456192 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000034.txt: -------------------------------------------------------------------------------- 1 | 22 0.346211 0.493259 0.689422 0.892118 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000036.txt: -------------------------------------------------------------------------------- 1 | 25 0.475759 0.414523 0.951518 0.672422 2 | 0 0.671279 0.617945 0.645759 0.726859 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000042.txt: -------------------------------------------------------------------------------- 1 | 16 0.606687 0.341381 0.544156 0.51 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000049.txt: -------------------------------------------------------------------------------- 1 | 17 0.597835 0.63755 0.342283 0.36886 2 | 17 0.324291 0.64808 0.219711 0.3164 3 | 0 0.620039 0.5939 0.172415 0.14608 4 | 0 0.385525 0.58557 0.14937 0.12586 5 | 0 0.328898 0.70199 0.031339 0.06714 6 | 58 0.622546 0.89961 0.185932 0.09446 7 | 0 0.760577 0.69423 0.028556 0.05486 8 | 0 0.510709 0.69215 0.018793 0.04682 9 | 0 0.929554 0.67602 0.038845 0.01844 10 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000061.txt: -------------------------------------------------------------------------------- 1 | 0 0.445688 0.480615 0.075125 0.117295 2 | 0 0.640086 0.471742 0.050828 0.081434 3 | 20 0.643211 0.558852 0.129828 0.097623 4 | 20 0.459703 0.592121 0.22175 0.159242 5 | 0 0.435383 0.45832 0.053453 0.111025 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000064.txt: -------------------------------------------------------------------------------- 1 | 2 0.292792 0.729031 0.367417 0.246281 2 | 7 0.239438 0.599242 0.259542 0.092922 3 | 11 0.279896 0.412773 0.077125 0.117453 4 | 74 0.394146 0.184914 0.321458 0.237984 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000071.txt: -------------------------------------------------------------------------------- 1 | 2 0.752648 0.525833 0.043359 0.033216 2 | 2 0.835727 0.538498 0.038047 0.028169 3 | 2 0.700875 0.521455 0.036437 0.020235 4 | 2 0.937398 0.559777 0.042422 0.033592 5 | 6 0.452477 0.576408 0.755359 0.280892 6 | 2 0.794984 0.538779 0.036812 0.02615 7 | 2 0.953469 0.514906 0.026125 0.012723 8 | 7 0.539727 0.464061 0.037328 0.023897 9 | 7 0.58518 0.471397 0.037984 0.016596 10 | 2 0.982555 0.572371 0.034891 0.030047 11 | 2 0.767367 0.531279 0.037391 0.029695 12 | 2 0.617961 0.476373 0.025016 0.01007 13 | 2 0.588344 0.471491 0.030781 0.018333 14 | 2 0.560102 0.471303 0.030234 0.011995 15 | 2 0.796047 0.521796 0.029969 0.014577 16 | 2 0.734094 0.523427 0.029375 0.02723 17 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000072.txt: -------------------------------------------------------------------------------- 1 | 23 0.658478 0.592133 0.677002 0.779766 2 | 23 0.391581 0.556305 0.546862 0.887391 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000073.txt: -------------------------------------------------------------------------------- 1 | 3 0.497327 0.511852 0.948637 0.952609 2 | 3 0.240637 0.217617 0.475398 0.424859 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000074.txt: -------------------------------------------------------------------------------- 1 | 16 0.32825 0.769577 0.463156 0.242207 2 | 1 0.128828 0.375258 0.249063 0.733333 3 | 0 0.476187 0.289613 0.028781 0.138099 4 | 0 0.52143 0.258251 0.021172 0.060869 5 | 0 0.569492 0.285235 0.024547 0.122254 6 | 0 0.746734 0.295869 0.049469 0.098357 7 | 0 0.444961 0.298779 0.023953 0.110047 8 | 0 0.450773 0.271209 0.018266 0.056925 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000077.txt: -------------------------------------------------------------------------------- 1 | 0 0.53553 0.308733 0.2069 0.317147 2 | 0 0.73609 0.272987 0.18926 0.259413 3 | 36 0.13364 0.88656 0.10108 0.06464 4 | 36 0.50059 0.413213 0.05466 0.07608 5 | 0 0.14666 0.667293 0.194 0.441093 6 | 0 0.59734 0.325733 0.0494 0.111253 7 | 36 0.73492 0.39656 0.04812 0.040107 8 | 0 0.55563 0.265173 0.04586 0.220053 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000078.txt: -------------------------------------------------------------------------------- 1 | 74 0.762851 0.196119 0.349886 0.385474 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000081.txt: -------------------------------------------------------------------------------- 1 | 4 0.516492 0.469388 0.912516 0.748282 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000086.txt: -------------------------------------------------------------------------------- 1 | 0 0.423213 0.57982 0.252246 0.587453 2 | 3 0.541543 0.766937 0.574727 0.451 3 | 26 0.649219 0.546375 0.262891 0.172156 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000089.txt: -------------------------------------------------------------------------------- 1 | 43 0.805492 0.357625 0.040359 0.275792 2 | 43 0.760125 0.376135 0.030812 0.221062 3 | 43 0.84693 0.35051 0.041359 0.287271 4 | 43 0.884539 0.354979 0.032609 0.289542 5 | 43 0.917523 0.34999 0.042141 0.297479 6 | 69 0.478883 0.703823 0.525328 0.563062 7 | 68 0.092344 0.241927 0.184688 0.301896 8 | 73 0.815477 0.727354 0.141328 0.06325 9 | 73 0.865914 0.795917 0.178203 0.070208 10 | 73 0.900883 0.891187 0.198234 0.104417 11 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000092.txt: -------------------------------------------------------------------------------- 1 | 42 0.782797 0.638876 0.257312 0.722248 2 | 55 0.490266 0.344941 0.587719 0.685386 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000094.txt: -------------------------------------------------------------------------------- 1 | 2 0.590102 0.689578 0.066984 0.09007 2 | 7 0.911406 0.725422 0.129062 0.218993 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000109.txt: -------------------------------------------------------------------------------- 1 | 16 0.861211 0.73232 0.035797 0.044207 2 | 0 0.817984 0.691791 0.033187 0.078678 3 | 0 0.929648 0.6725 0.028422 0.054856 4 | 0 0.859836 0.609724 0.007109 0.019495 5 | 13 0.615359 0.657127 0.053844 0.057091 6 | 13 0.732055 0.705204 0.062953 0.055745 7 | 0 0.121414 0.493966 0.009828 0.036731 8 | 0 0.951336 0.666106 0.014359 0.027163 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000110.txt: -------------------------------------------------------------------------------- 1 | 56 0.293922 0.361479 0.155406 0.166667 2 | 56 0.44668 0.410333 0.130984 0.247292 3 | 42 0.609039 0.883219 0.296391 0.233563 4 | 43 0.44157 0.875375 0.026328 0.24925 5 | 53 0.477352 0.902354 0.527641 0.17175 6 | 60 0.29882 0.235885 0.225172 0.158021 7 | 0 0.662641 0.494385 0.674719 0.988771 8 | 0 0.198031 0.560677 0.392687 0.586521 9 | 0 0.487922 0.144948 0.200563 0.285396 10 | 0 0.360898 0.09825 0.106328 0.1965 11 | 0 0.28382 0.093937 0.126391 0.178792 12 | 0 0.101781 0.181698 0.203563 0.363396 13 | 0 0.229195 0.057813 0.048547 0.115625 14 | 0 0.662703 0.090156 0.05425 0.175229 15 | 41 0.302555 0.184302 0.030016 0.037979 16 | 56 0.035484 0.455885 0.070094 0.352854 17 | 56 0.664039 0.177365 0.035766 0.026646 18 | 60 0.956766 0.246594 0.086469 0.074271 19 | 0 0.422117 0.031396 0.022172 0.059708 20 | 0 0.586672 0.097323 0.124219 0.194646 21 | 60 0.502242 0.893083 0.994641 0.213833 22 | 41 0.269547 0.186688 0.029219 0.048708 23 | 41 0.343391 0.184292 0.031219 0.032792 24 | 41 0.369352 0.1825 0.025828 0.048708 25 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000113.txt: -------------------------------------------------------------------------------- 1 | 56 0.409675 0.645094 0.376851 0.098875 2 | 56 0.112825 0.950797 0.17262 0.096781 3 | 0 0.19274 0.404625 0.364663 0.711062 4 | 41 0.230937 0.763773 0.124038 0.095516 5 | 41 0.860721 0.264437 0.052115 0.029313 6 | 43 0.666815 0.635563 0.113486 0.136 7 | 55 0.655144 0.779773 0.625769 0.233703 8 | 0 0.910325 0.413461 0.179351 0.512891 9 | 60 0.523293 0.806984 0.953413 0.386031 10 | 0 0.591178 0.371906 0.470192 0.6045 11 | 41 0.709892 0.169898 0.061322 0.041828 12 | 41 0.861106 0.123367 0.056346 0.034453 13 | 41 0.854519 0.172797 0.057933 0.039062 14 | 41 0.934447 0.169328 0.042404 0.036406 15 | 41 0.494615 0.236281 0.048221 0.033813 16 | 41 0.451791 0.233664 0.056659 0.038766 17 | 41 0.443882 0.187086 0.047139 0.040047 18 | 41 0.360457 0.233461 0.045096 0.034797 19 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000127.txt: -------------------------------------------------------------------------------- 1 | 58 0.384211 0.176424 0.101078 0.146778 2 | 60 0.58357 0.652942 0.831141 0.694116 3 | 41 0.741516 0.589574 0.289375 0.259356 4 | 43 0.551609 0.760468 0.162844 0.330374 5 | 44 0.608008 0.659958 0.132672 0.171143 6 | 55 0.37832 0.694688 0.196797 0.293451 7 | 73 0.502742 0.49973 0.201672 0.192349 8 | 13 0.050273 0.394875 0.100547 0.170374 9 | 13 0.281094 0.19657 0.068719 0.034179 10 | 25 0.541289 0.108805 0.163828 0.217609 11 | 25 0.230813 0.064563 0.051125 0.115863 12 | 26 0.542062 0.426798 0.734312 0.339501 13 | 0 0.711789 0.055187 0.035547 0.074324 14 | 13 0.216469 0.257308 0.101562 0.102807 15 | 13 0.348836 0.344044 0.082422 0.075405 16 | 60 0.582313 0.222152 0.334781 0.048669 17 | 25 0.185305 0.049397 0.044516 0.092599 18 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000133.txt: -------------------------------------------------------------------------------- 1 | 59 0.51093 0.442073 0.978141 0.872188 2 | 77 0.858305 0.073521 0.074922 0.059833 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000136.txt: -------------------------------------------------------------------------------- 1 | 0 0.05522 0.65123 0.10708 0.689037 2 | 0 0.06892 0.582019 0.13784 0.835963 3 | 23 0.34974 0.648984 0.37148 0.675615 4 | 23 0.76148 0.572072 0.25608 0.439171 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000138.txt: -------------------------------------------------------------------------------- 1 | 72 0.122172 0.393944 0.192281 0.429529 2 | 74 0.546672 0.093979 0.107031 0.119546 3 | 45 0.281648 0.338351 0.071234 0.034084 4 | 69 0.499961 0.617976 0.187109 0.624712 5 | 71 0.877086 0.401291 0.201766 0.093403 6 | 58 0.910391 0.130305 0.06875 0.1026 7 | 75 0.3675 0.13712 0.052562 0.082304 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000142.txt: -------------------------------------------------------------------------------- 1 | 39 0.701552 0.337305 0.333479 0.396672 2 | 60 0.5 0.530422 1 0.353469 3 | 46 0.505229 0.73543 0.568 0.300453 4 | 48 0.534083 0.794016 0.757417 0.411969 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000143.txt: -------------------------------------------------------------------------------- 1 | 14 0.820783 0.56129 0.218633 0.3527 2 | 14 0.293458 0.37634 0.159617 0.33484 3 | 14 0.525983 0.41653 0.166667 0.32554 4 | 14 0.486708 0.66271 0.16165 0.24138 5 | 14 0.267033 0.79969 0.1538 0.3225 6 | 14 0.139517 0.17415 0.159167 0.26742 7 | 14 0.2955 0.60918 0.1904 0.26864 8 | 14 0.859717 0.79617 0.157067 0.30918 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000144.txt: -------------------------------------------------------------------------------- 1 | 23 0.650563 0.626781 0.573031 0.746438 2 | 23 0.536969 0.637385 0.469781 0.725229 3 | 23 0.38343 0.583146 0.615172 0.833708 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000149.txt: -------------------------------------------------------------------------------- 1 | 0 0.613805 0.7741 0.015016 0.031145 2 | 0 0.535719 0.755491 0.01075 0.030561 3 | 0 0.525578 0.753984 0.009844 0.032593 4 | 0 0.639203 0.776121 0.022969 0.03028 5 | 33 0.692844 0.46715 0.028687 0.035047 6 | 33 0.446031 0.596834 0.015156 0.014883 7 | 33 0.689094 0.207897 0.016219 0.029206 8 | 33 0.475727 0.499147 0.035078 0.025023 9 | 0 0.879875 0.763516 0.011094 0.043248 10 | 0 0.845305 0.755491 0.007953 0.034393 11 | 2 0.442828 0.734521 0.015156 0.012453 12 | 2 0.494555 0.745853 0.016391 0.011051 13 | 2 0.467687 0.744346 0.013437 0.009673 14 | 2 0.415742 0.759311 0.030391 0.016846 15 | 33 0.130477 0.81125 0.065109 0.031285 16 | 33 0.630531 0.660187 0.058844 0.037196 17 | 0 0.434891 0.778084 0.012531 0.029953 18 | 0 0.85457 0.76118 0.006953 0.038061 19 | 0 0.919844 0.762196 0.007062 0.023084 20 | 0 0.394578 0.765829 0.008313 0.053808 21 | 0 0.37107 0.765047 0.012234 0.056729 22 | 0 0.349812 0.764147 0.011938 0.063575 23 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000151.txt: -------------------------------------------------------------------------------- 1 | 0 0.937271 0.137734 0.063667 0.08325 2 | 6 0.719542 0.503594 0.560917 0.992812 3 | 11 0.482646 0.541977 0.079417 0.055297 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000154.txt: -------------------------------------------------------------------------------- 1 | 22 0.436815 0.746555 0.817518 0.506891 2 | 22 0.415152 0.410258 0.640796 0.217453 3 | 22 0.676944 0.196086 0.232295 0.099578 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000164.txt: -------------------------------------------------------------------------------- 1 | 39 0.615391 0.411156 0.012531 0.055979 2 | 39 0.590367 0.416885 0.010734 0.043604 3 | 39 0.58018 0.413521 0.011016 0.057375 4 | 39 0.60432 0.416 0.011266 0.0505 5 | 39 0.692109 0.61676 0.028625 0.065354 6 | 72 0.745406 0.500187 0.151125 0.287583 7 | 39 0.731344 0.62699 0.0155 0.076146 8 | 39 0.632141 0.354646 0.014688 0.035625 9 | 39 0.591961 0.298708 0.016391 0.031583 10 | 39 0.639766 0.292698 0.015281 0.032813 11 | 39 0.65693 0.290938 0.016641 0.035125 12 | 56 0.36675 0.926208 0.2365 0.147583 13 | 40 0.250586 0.425167 0.020047 0.058875 14 | 40 0.232906 0.435479 0.025156 0.076125 15 | 40 0.180586 0.443792 0.022359 0.069583 16 | 40 0.106906 0.447781 0.030719 0.078396 17 | 40 0.139813 0.448458 0.024125 0.0825 18 | 40 0.15907 0.447073 0.018484 0.076938 19 | 41 0.25 0.508854 0.041844 0.043333 20 | 41 0.197148 0.513687 0.036297 0.040667 21 | 41 0.291938 0.50151 0.031469 0.033604 22 | 41 0.322883 0.49299 0.031234 0.032313 23 | 45 0.834883 0.472427 0.087734 0.021937 24 | 68 0.631812 0.505479 0.08325 0.06325 25 | 69 0.465656 0.584354 0.073156 0.071292 26 | 40 0.127484 0.447563 0.016938 0.082667 27 | 40 0.198609 0.437896 0.024781 0.079 28 | 40 0.21668 0.438781 0.016797 0.073687 29 | 41 0.266141 0.504708 0.033937 0.04425 30 | 41 0.813328 0.301812 0.024063 0.044542 31 | 41 0.844102 0.305635 0.023734 0.028563 32 | 41 0.795687 0.314125 0.009781 0.017083 33 | 41 0.279133 0.44301 0.027734 0.039271 34 | 41 0.220984 0.507156 0.023938 0.042104 35 | 45 0.813344 0.445646 0.045594 0.00975 36 | 45 0.833727 0.461135 0.088891 0.008771 37 | 45 0.836367 0.454271 0.081297 0.010917 38 | 45 0.835375 0.449427 0.086906 0.012646 39 | 45 0.577438 0.366531 0.020875 0.018854 40 | 60 0.689609 0.972083 0.214281 0.031167 41 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000165.txt: -------------------------------------------------------------------------------- 1 | 27 0.321953 0.526194 0.141688 0.405187 2 | 0 0.687836 0.600877 0.598703 0.798246 3 | 0 0.286062 0.515728 0.553312 0.941567 4 | 76 0.341414 0.502248 0.467797 0.533787 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000192.txt: -------------------------------------------------------------------------------- 1 | 0 0.648875 0.757302 0.205625 0.458437 2 | 0 0.744398 0.713219 0.122516 0.516729 3 | 0 0.029992 0.785385 0.057078 0.428146 4 | 0 0.505914 0.619375 0.173984 0.491 5 | 34 0.04875 0.891417 0.05625 0.193708 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000194.txt: -------------------------------------------------------------------------------- 1 | 43 0.868227 0.932448 0.158453 0.135104 2 | 53 0.500844 0.535958 0.998312 0.901125 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000196.txt: -------------------------------------------------------------------------------- 1 | 44 0.554898 0.468469 0.329391 0.101354 2 | 51 0.718219 0.802031 0.035906 0.088563 3 | 51 0.630547 0.836625 0.038469 0.112125 4 | 51 0.696375 0.809823 0.010656 0.054229 5 | 51 0.688344 0.874729 0.087469 0.064042 6 | 44 0.891422 0.648594 0.115187 0.254896 7 | 44 0.885594 0.490448 0.153031 0.089771 8 | 44 0.416 0.134375 0.111625 0.0905 9 | 44 0.909359 0.608073 0.112 0.167937 10 | 44 0.820719 0.90601 0.189906 0.183646 11 | 45 0.531563 0.186646 0.200906 0.13075 12 | 45 0.775672 0.610417 0.226375 0.236917 13 | 45 0.901391 0.805719 0.197219 0.297354 14 | 45 0.499047 0.502073 0.264688 0.179646 15 | 45 0.693187 0.847594 0.251938 0.289937 16 | 45 0.62275 0.399625 0.207313 0.143833 17 | 45 0.652055 0.308385 0.236328 0.134521 18 | 45 0.365664 0.186219 0.138109 0.068896 19 | 45 0.637227 0.16401 0.145297 0.130979 20 | 50 0.325914 0.562802 0.028516 0.065812 21 | 50 0.467734 0.85 0.058875 0.060208 22 | 50 0.283016 0.592469 0.033656 0.060604 23 | 51 0.743414 0.869427 0.041203 0.066021 24 | 51 0.659156 0.903385 0.021313 0.066146 25 | 60 0.5 0.543688 1 0.912625 26 | 42 0.395453 0.918188 0.132469 0.137667 27 | 44 0.749438 0.282969 0.068875 0.060438 28 | 45 0.255195 0.225646 0.150203 0.081958 29 | 45 0.144422 0.291271 0.183094 0.125417 30 | 45 0.055742 0.380312 0.111484 0.153167 31 | 50 0.211406 0.736573 0.0625 0.053021 32 | 51 0.621133 0.892375 0.056922 0.0625 33 | 51 0.911609 0.801094 0.019031 0.031313 34 | 51 0.607164 0.838719 0.049016 0.056771 35 | 51 0.296297 0.792573 0.06525 0.087021 36 | 51 0.675023 0.80176 0.034984 0.046646 37 | 51 0.694406 0.941417 0.03225 0.022083 38 | 44 0.838328 0.280281 0.030687 0.019354 39 | 50 0.410172 0.699927 0.038156 0.042771 40 | 50 0.465234 0.639437 0.027375 0.069375 41 | 50 0.248742 0.561771 0.025672 0.029 42 | 45 0.134875 0.489365 0.26975 0.191688 43 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000201.txt: -------------------------------------------------------------------------------- 1 | 31 0.642445 0.497757 0.241953 0.847196 2 | 31 0.558789 0.463306 0.228891 0.845631 3 | 31 0.490047 0.457991 0.148594 0.687944 4 | 31 0.446477 0.466554 0.134797 0.684556 5 | 31 0.39518 0.444825 0.129297 0.670257 6 | 0 0.971078 0.47597 0.0195 0.038715 7 | 0 0.924641 0.475257 0.018344 0.041869 8 | 31 0.493016 0.492839 0.147281 0.689743 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000208.txt: -------------------------------------------------------------------------------- 1 | 71 0.500844 0.60899 0.998312 0.764062 2 | 71 0.23793 0.427583 0.475859 0.228667 3 | 79 0.396391 0.447198 0.299625 0.185188 4 | 79 0.213313 0.34026 0.247406 0.171438 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000241.txt: -------------------------------------------------------------------------------- 1 | 39 0.106344 0.932656 0.062271 0.134688 2 | 57 0.825125 0.623328 0.348333 0.462531 3 | 57 0.149771 0.638133 0.298167 0.406922 4 | 0 0.48524 0.499461 0.417563 0.978391 5 | 0 0.217229 0.683711 0.428458 0.543828 6 | 0 0.727677 0.61193 0.223229 0.401797 7 | 41 0.268917 0.96507 0.105667 0.069859 8 | 41 0.045312 0.966008 0.090292 0.067984 9 | 65 0.289917 0.519969 0.091917 0.034625 10 | 26 0.784573 0.791211 0.136063 0.114797 11 | 0 0.047031 0.741297 0.094062 0.317781 12 | 0 0.91199 0.707867 0.176021 0.359547 13 | 58 0.303687 0.268297 0.228833 0.314375 14 | 58 0.331958 0.603742 0.103708 0.112922 15 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000247.txt: -------------------------------------------------------------------------------- 1 | 2 0.153867 0.480637 0.133922 0.083868 2 | 2 0.830969 0.44546 0.054688 0.042948 3 | 2 0.771828 0.441403 0.048313 0.053561 4 | 4 0.502234 0.494375 0.995531 0.986486 5 | 2 0.856453 0.413667 0.012687 0.014552 6 | 2 0.839664 0.412288 0.011641 0.015566 7 | 4 0.828281 0.267818 0.343438 0.132288 8 | 2 0.799281 0.409741 0.024344 0.01816 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000250.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/labels/000000000250.txt -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000257.txt: -------------------------------------------------------------------------------- 1 | 9 0.157914 0.445062 0.036766 0.068292 2 | 9 0.098148 0.439604 0.039203 0.0495 3 | 24 0.314625 0.812406 0.07875 0.115604 4 | 7 0.549438 0.707177 0.320219 0.256188 5 | 7 0.896609 0.700875 0.204312 0.133083 6 | 0 0.273953 0.859979 0.11175 0.280042 7 | 0 0.392078 0.763167 0.044344 0.166083 8 | 0 0.348062 0.755698 0.034813 0.126021 9 | 0 0.42543 0.764771 0.025578 0.151833 10 | 0 0.475633 0.782583 0.051797 0.160417 11 | 0 0.90368 0.726896 0.023047 0.088 12 | 0 0.203523 0.716594 0.015828 0.077146 13 | 0 0.510633 0.774021 0.031516 0.155833 14 | 0 0.137188 0.730198 0.031719 0.100354 15 | 0 0.227945 0.718365 0.024297 0.080104 16 | 0 0.363711 0.754375 0.023766 0.144875 17 | 9 0.364094 0.629573 0.017656 0.023729 18 | 9 0.047539 0.638865 0.008891 0.014813 19 | 9 0.04975 0.5885 0.009094 0.0245 20 | 24 0.334562 0.730542 0.017656 0.040792 21 | 26 0.489055 0.764677 0.019547 0.028687 22 | 0 0.314289 0.730177 0.032234 0.082854 23 | 7 0.906219 0.837302 0.187563 0.325396 24 | 7 0.196648 0.689646 0.220672 0.124667 25 | 7 0.759375 0.682094 0.038719 0.029062 26 | 9 0.152258 0.386031 0.023484 0.030521 27 | 26 0.150109 0.730167 0.009187 0.026 28 | 0 0.850312 0.726604 0.022 0.082958 29 | 9 0.477383 0.558146 0.011078 0.029542 30 | 9 0.466867 0.557292 0.009984 0.025417 31 | 9 0.090375 0.62775 0.007625 0.008958 32 | 26 0.33518 0.741677 0.017516 0.060521 33 | 26 0.743234 0.714958 0.009594 0.009583 34 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000260.txt: -------------------------------------------------------------------------------- 1 | 5 0.07066 0.518619 0.13228 0.474054 2 | 0 0.57375 0.674565 0.1035 0.509009 3 | 0 0.05825 0.468724 0.04734 0.083634 4 | 2 0.51001 0.549895 0.0663 0.047237 5 | 28 0.70801 0.78985 0.0869 0.185345 6 | 28 0.77623 0.774324 0.0567 0.209369 7 | 28 0.73022 0.677327 0.12156 0.12 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000263.txt: -------------------------------------------------------------------------------- 1 | 20 0.632327 0.626688 0.735347 0.724219 2 | 20 0.330499 0.483117 0.655381 0.924672 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000283.txt: -------------------------------------------------------------------------------- 1 | 39 0.243879 0.310086 0.192523 0.487109 2 | 56 0.070117 0.290289 0.139159 0.134922 3 | 56 0.673657 0.330523 0.652687 0.451609 4 | 60 0.496098 0.657641 0.992196 0.656469 5 | 40 0.488061 0.411484 0.206215 0.334719 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000294.txt: -------------------------------------------------------------------------------- 1 | 0 0.328367 0.581768 0.570172 0.836464 2 | 44 0.661289 0.846897 0.023922 0.055152 3 | 68 0.895828 0.860667 0.205406 0.256183 4 | 42 0.956789 0.637482 0.011984 0.095433 5 | 43 0.709992 0.811206 0.027078 0.081194 6 | 43 0.722367 0.803923 0.024828 0.105785 7 | 44 0.645375 0.786768 0.036094 0.059297 8 | 44 0.627625 0.847494 0.055594 0.09377 9 | 44 0.639727 0.395785 0.022609 0.268525 10 | 44 0.668227 0.388841 0.020984 0.24185 11 | 44 0.528242 0.679028 0.028391 0.156745 12 | 43 0.733969 0.824731 0.025438 0.077939 13 | 43 0.739711 0.799742 0.021547 0.076112 14 | 43 0.745219 0.824297 0.023938 0.077728 15 | 74 0.042203 0.063185 0.083937 0.12637 16 | 44 0.656383 0.885656 0.050297 0.049438 17 | 44 0.626297 0.738958 0.025844 0.075761 18 | 44 0.618633 0.933571 0.023016 0.053794 19 | 44 0.644 0.861382 0.03375 0.058876 20 | 44 0.977539 0.144672 0.007484 0.052857 21 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000307.txt: -------------------------------------------------------------------------------- 1 | 16 0.768938 0.586875 0.268187 0.3495 2 | 2 0.637672 0.120135 0.075344 0.034521 3 | 29 0.604211 0.875281 0.109547 0.222479 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000308.txt: -------------------------------------------------------------------------------- 1 | 0 0.314906 0.531385 0.208937 0.928263 2 | 0 0.144594 0.555528 0.289188 0.888944 3 | 0 0.198789 0.348087 0.254641 0.624155 4 | 0 0.20068 0.287934 0.053922 0.206103 5 | 0 0.732797 0.519847 0.274688 0.929507 6 | 40 0.588633 0.595822 0.038203 0.140329 7 | 40 0.267453 0.482876 0.077594 0.233122 8 | 40 0.387227 0.419648 0.038828 0.137512 9 | 0 0.093484 0.771901 0.186969 0.433709 10 | 40 0.05282 0.549413 0.105547 0.298545 11 | 0 0.579289 0.378498 0.077953 0.413803 12 | 74 0.691852 0.573744 0.020453 0.030728 13 | 25 0.50007 0.235728 0.136891 0.175023 14 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000309.txt: -------------------------------------------------------------------------------- 1 | 77 0.367442 0.532933 0.224283 0.355033 2 | 77 0.553933 0.475283 0.1955 0.235967 3 | 16 0.777608 0.222125 0.154717 0.206083 4 | 77 0.223017 0.607233 0.202367 0.430033 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000312.txt: -------------------------------------------------------------------------------- 1 | 20 0.181414 0.676405 0.353828 0.48541 2 | 20 0.516023 0.666159 0.326328 0.423747 3 | 20 0.56668 0.784906 0.126422 0.190094 4 | 20 0.883914 0.646311 0.232172 0.467002 5 | 20 0.768664 0.706171 0.068766 0.33192 6 | 20 0.770625 0.727787 0.230813 0.287237 7 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000315.txt: -------------------------------------------------------------------------------- 1 | 25 0.186758 0.378372 0.331422 0.310749 2 | 25 0.341836 0.377963 0.239891 0.208993 3 | 25 0.417359 0.344977 0.200625 0.166534 4 | 25 0.491461 0.356194 0.105953 0.0974 5 | 25 0.508773 0.292518 0.139297 0.048173 6 | 25 0.625211 0.343747 0.077734 0.057892 7 | 25 0.692219 0.205328 0.059719 0.210468 8 | 25 0.124633 0.531745 0.249266 0.610749 9 | 25 0.061469 0.450562 0.122938 0.258407 10 | 25 0.300609 0.395515 0.193406 0.242693 11 | 25 0.424828 0.384192 0.139469 0.158642 12 | 0 0.577516 0.551721 0.096625 0.451124 13 | 0 0.809414 0.564438 0.076703 0.432576 14 | 0 0.261148 0.716956 0.133266 0.405386 15 | 0 0.867797 0.503489 0.072375 0.131335 16 | 0 0.866078 0.424204 0.037844 0.099789 17 | 0 0.938289 0.512904 0.078422 0.111241 18 | 0 0.865492 0.367553 0.021703 0.07993 19 | 25 0.574656 0.352775 0.13125 0.093372 20 | 26 0.192102 0.948665 0.093391 0.077845 21 | 56 0.545742 0.797752 0.455797 0.305621 22 | 0 0.377937 0.544368 0.080031 0.054637 23 | 0 0.490539 0.465328 0.041297 0.077963 24 | 0 0.922148 0.379965 0.009047 0.030328 25 | 0 0.380133 0.932213 0.185922 0.135574 26 | 0 0.520289 0.446979 0.023672 0.085386 27 | 56 0.39143 0.63767 0.132609 0.108689 28 | 56 0.13493 0.711862 0.217891 0.256042 29 | 56 0.084047 0.96363 0.157688 0.046745 30 | 56 0.403836 0.656464 0.113922 0.069883 31 | 56 0.049484 0.855738 0.098969 0.197658 32 | 56 0.39432 0.596745 0.094234 0.045761 33 | 56 0.424039 0.703337 0.119797 0.044895 34 | 56 0.379156 0.553513 0.098781 0.058782 35 | 0 0.979359 0.411124 0.01175 0.06089 36 | 25 0.777305 0.286768 0.104047 0.075831 37 | 26 0.192758 0.853525 0.064672 0.027564 38 | 26 0.231523 0.838747 0.099578 0.145597 39 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000321.txt: -------------------------------------------------------------------------------- 1 | 52 0.762352 0.666667 0.388234 0.501167 2 | 52 0.762352 0.382354 0.367047 0.505875 3 | 48 0.291234 0.485719 0.337 0.789604 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000322.txt: -------------------------------------------------------------------------------- 1 | 0 0.273141 0.516372 0.322344 0.573368 2 | 29 0.474578 0.441486 0.067562 0.026507 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000326.txt: -------------------------------------------------------------------------------- 1 | 0 0.523289 0.605539 0.569797 0.786347 2 | 40 0.554906 0.390925 0.385781 0.618525 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000328.txt: -------------------------------------------------------------------------------- 1 | 67 0.706648 0.595662 0.054703 0.037963 2 | 0 0.244859 0.502128 0.349688 0.726904 3 | 0 0.469492 0.580835 0.320516 0.792953 4 | 0 0.721602 0.552953 0.390484 0.867699 5 | 13 0.460055 0.594969 0.918234 0.763218 6 | 73 0.451359 0.488106 0.135063 0.076212 7 | 2 0.626516 0.224267 0.157844 0.133625 8 | 27 0.736273 0.406202 0.028609 0.089226 9 | 27 0.510344 0.408758 0.035156 0.118086 10 | 24 0.112117 0.430092 0.186641 0.162179 11 | 24 0.143891 0.376314 0.13325 0.097434 12 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000332.txt: -------------------------------------------------------------------------------- 1 | 41 0.273875 0.074938 0.271344 0.149875 2 | 41 0.958891 0.155625 0.082219 0.31125 3 | 45 0.502531 0.533708 0.994938 0.910125 4 | 51 0.505586 0.42824 0.485297 0.522354 5 | 41 0.709187 0.05499 0.188344 0.109813 6 | 42 0.019484 0.829865 0.038969 0.303896 7 | 51 0.177828 0.667969 0.168813 0.240312 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000338.txt: -------------------------------------------------------------------------------- 1 | 72 0.414813 0.72896 0.149656 0.54208 2 | 74 0.734047 0.308853 0.036312 0.07526 3 | 0 0.581609 0.715352 0.141344 0.561774 4 | 0 0.730945 0.765627 0.088922 0.468746 5 | 69 0.146391 0.866284 0.217 0.240459 6 | 26 0.746844 0.768563 0.040094 0.120306 7 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000349.txt: -------------------------------------------------------------------------------- 1 | 6 0.421352 0.540448 0.842703 0.537062 2 | 58 0.6685 0.665531 0.09825 0.163271 3 | 58 0.750336 0.629198 0.079047 0.130479 4 | 58 0.80107 0.635146 0.044859 0.083167 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000357.txt: -------------------------------------------------------------------------------- 1 | 34 0.845453 0.619358 0.00625 0.124954 2 | 35 0.892836 0.870573 0.013922 0.030688 3 | 35 0.125352 0.466812 0.010891 0.042248 4 | 35 0.440953 0.125642 0.008531 0.021651 5 | 0 0.595023 0.178188 0.026953 0.126743 6 | 0 0.444703 0.169633 0.042219 0.170459 7 | 0 0.344438 0.174839 0.034687 0.142248 8 | 0 0.13107 0.473211 0.028953 0.22055 9 | 0 0.852109 0.750023 0.045375 0.250413 10 | 0 0.907797 0.821261 0.041813 0.17445 11 | 0 0.946813 0.81656 0.042469 0.213761 12 | 0 0.879648 0.132087 0.021703 0.044358 13 | 0 0.859398 0.156514 0.015078 0.12 14 | 0 0.939578 0.06094 0.014 0.04656 15 | 0 0.428398 0.092202 0.027641 0.125413 16 | 0 0.897008 0.188716 0.018547 0.108899 17 | 0 0.913047 0.202523 0.0105 0.109725 18 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000359.txt: -------------------------------------------------------------------------------- 1 | 9 0.37311 0.354111 0.13074 0.103163 2 | 9 0.53852 0.334759 0.102 0.06747 3 | 9 0.56142 0.890166 0.00892 0.01238 4 | 2 0.12372 0.930422 0.24744 0.113193 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000360.txt: -------------------------------------------------------------------------------- 1 | 0 0.57414 0.419293 0.1042 0.098533 2 | 0 0.22258 0.757587 0.0532 0.057093 3 | 31 0.53309 0.46868 0.10438 0.11064 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000368.txt: -------------------------------------------------------------------------------- 1 | 32 0.481063 0.411055 0.098833 0.077672 2 | 0 0.583583 0.380906 0.478375 0.4255 3 | 0 0.384729 0.212602 0.111958 0.171141 4 | 0 0.193021 0.337789 0.118792 0.055672 5 | 0 0.323625 0.296398 0.082375 0.128828 6 | 0 0.602583 0.176211 0.077208 0.128203 7 | 0 0.930615 0.293727 0.091896 0.154234 8 | 0 0.673833 0.376867 0.159542 0.372234 9 | 0 0.794187 0.291156 0.077458 0.15325 10 | 0 0.19875 0.265281 0.0605 0.103531 11 | 0 0.155104 0.265516 0.03925 0.099625 12 | 0 0.466875 0.211078 0.0415 0.046344 13 | 0 0.019542 0.287961 0.039083 0.145234 14 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000370.txt: -------------------------------------------------------------------------------- 1 | 0 0.594594 0.519141 0.810813 0.961719 2 | 50 0.752552 0.592227 0.494896 0.381172 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000382.txt: -------------------------------------------------------------------------------- 1 | 0 0.83507 0.841042 0.083547 0.169333 2 | 30 0.830586 0.927583 0.121453 0.052208 3 | 24 0.822352 0.785698 0.026859 0.048021 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000384.txt: -------------------------------------------------------------------------------- 1 | 57 0.204596 0.826305 0.409193 0.341047 2 | 74 0.493274 0.452961 0.063363 0.043859 3 | 73 0.394025 0.861227 0.094507 0.027453 4 | 73 0.288105 0.857508 0.091996 0.037672 5 | 64 0.23991 0.733586 0.026996 0.015047 6 | 65 0.842276 0.782094 0.047646 0.011125 7 | 73 0.31065 0.832328 0.100942 0.032969 8 | 65 0.383374 0.834039 0.069978 0.010359 9 | 65 0.343767 0.854695 0.023274 0.008766 10 | 73 0.395762 0.809555 0.072287 0.026016 11 | 63 0.32046 0.747688 0.087601 0.030187 12 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000387.txt: -------------------------------------------------------------------------------- 1 | 63 0.682586 0.394385 0.586516 0.577521 2 | 63 0.605953 0.430167 0.735719 0.650792 3 | 67 0.683594 0.33074 0.328125 0.195312 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000389.txt: -------------------------------------------------------------------------------- 1 | 27 0.530258 0.81326 0.102234 0.373479 2 | 0 0.110391 0.766292 0.220781 0.462917 3 | 0 0.806555 0.804365 0.152672 0.391271 4 | 0 0.214297 0.697792 0.143281 0.355458 5 | 0 0.942922 0.693979 0.114156 0.260167 6 | 0 0.075586 0.405979 0.021984 0.092333 7 | 0 0.30443 0.643573 0.074984 0.098646 8 | 0 0.705258 0.586 0.067703 0.100375 9 | 0 0.641781 0.532667 0.050875 0.055583 10 | 0 0.93925 0.887135 0.120687 0.225062 11 | 24 0.663227 0.777552 0.120516 0.444896 12 | 0 0.507852 0.580937 0.575109 0.811667 13 | 0 0.815102 0.572406 0.013141 0.020063 14 | 0 0.865328 0.7145 0.115312 0.304125 15 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000394.txt: -------------------------------------------------------------------------------- 1 | 16 0.488914 0.494869 0.977828 0.936809 2 | 29 0.645445 0.542463 0.555422 0.477889 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000395.txt: -------------------------------------------------------------------------------- 1 | 67 0.470422 0.518578 0.031 0.039603 2 | 0 0.523391 0.613483 0.676125 0.750552 3 | 0 0.063133 0.597897 0.126266 0.480897 4 | 0 0.184836 0.643534 0.128984 0.352862 5 | 0 0.902508 0.672655 0.194984 0.65469 6 | 67 0.979633 0.537129 0.024734 0.019983 7 | 0 0.200016 0.441362 0.060719 0.080862 8 | 0 0.284094 0.507862 0.128312 0.188759 9 | 0 0.670172 0.427164 0.051469 0.182707 10 | 0 0.7045 0.453991 0.068594 0.195086 11 | 0 0.296867 0.630474 0.094359 0.115466 12 | 0 0.123273 0.479983 0.075609 0.218862 13 | 0 0.755555 0.513638 0.110609 0.154586 14 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000397.txt: -------------------------------------------------------------------------------- 1 | 56 0.858875 0.102146 0.224187 0.204292 2 | 53 0.499719 0.521344 0.985969 0.858438 3 | 41 0.028711 0.688562 0.057422 0.14975 4 | 41 0.867859 0.822083 0.235719 0.329875 5 | 42 0.965031 0.897042 0.069937 0.108542 6 | 60 0.395461 0.863635 0.787016 0.272729 7 | 0 0.182141 0.213885 0.352594 0.427771 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000400.txt: -------------------------------------------------------------------------------- 1 | 16 0.730893 0.294305 0.153009 0.123078 2 | 8 0.501129 0.474156 0.997743 0.746063 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000404.txt: -------------------------------------------------------------------------------- 1 | 8 0.496162 0.629578 0.737535 0.135094 2 | 8 0.684789 0.598344 0.467512 0.071813 3 | 8 0.776596 0.576383 0.368732 0.046266 4 | 8 0.718721 0.571922 0.201338 0.025438 5 | 8 0.669155 0.564172 0.057981 0.017219 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000415.txt: -------------------------------------------------------------------------------- 1 | 38 0.225947 0.658273 0.116908 0.069391 2 | 0 0.171253 0.637891 0.342507 0.471281 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000419.txt: -------------------------------------------------------------------------------- 1 | 0 0.230375 0.430385 0.070625 0.318396 2 | 38 0.249766 0.264875 0.059531 0.034208 3 | 32 0.199219 0.197885 0.010219 0.014979 4 | 0 0.818789 0.660177 0.204703 0.366896 5 | 2 0.689875 0.436823 0.022812 0.029937 6 | 2 0.839852 0.43499 0.025578 0.022896 7 | 2 0.541586 0.434542 0.052109 0.024417 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000428.txt: -------------------------------------------------------------------------------- 1 | 27 0.659195 0.771528 0.147891 0.429222 2 | 0 0.632656 0.539681 0.556125 0.897972 3 | 55 0.770273 0.820944 0.273641 0.337833 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000431.txt: -------------------------------------------------------------------------------- 1 | 32 0.570594 0.514087 0.019031 0.029923 2 | 0 0.363117 0.497057 0.245766 0.649023 3 | 38 0.527227 0.488419 0.126984 0.159614 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000436.txt: -------------------------------------------------------------------------------- 1 | 0 0.508443 0.493242 0.983115 0.977484 2 | 54 0.635679 0.427477 0.242225 0.113328 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000438.txt: -------------------------------------------------------------------------------- 1 | 54 0.411156 0.675896 0.230375 0.2175 2 | 54 0.153063 0.552448 0.188531 0.161396 3 | 54 0.378656 0.554531 0.229594 0.225271 4 | 54 0.388883 0.40674 0.218859 0.220563 5 | 54 0.186703 0.432417 0.189188 0.196625 6 | 54 0.177125 0.300896 0.19625 0.177 7 | 54 0.844383 0.531458 0.188766 0.240458 8 | 54 0.832984 0.318583 0.19075 0.21225 9 | 54 0.17807 0.796469 0.241828 0.249396 10 | 54 0.851273 0.797854 0.208109 0.300917 11 | 54 0.634969 0.821396 0.266531 0.258292 12 | 54 0.392531 0.850656 0.259094 0.189604 13 | 54 0.550859 0.513729 0.132656 0.394375 14 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000443.txt: -------------------------------------------------------------------------------- 1 | 15 0.601289 0.507552 0.581891 0.793104 2 | 0 0.589883 0.494385 0.812359 0.984271 3 | 0 0.881742 0.320229 0.236516 0.631458 4 | 65 0.891086 0.564917 0.217828 0.317875 5 | 57 0.446102 0.493792 0.888828 0.979667 6 | 0 0.115742 0.642802 0.224078 0.649396 7 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000446.txt: -------------------------------------------------------------------------------- 1 | 0 0.451896 0.597008 0.588333 0.805984 2 | 65 0.743948 0.588086 0.092688 0.029047 3 | 73 0.551552 0.683148 0.021104 0.109703 4 | 73 0.154083 0.278789 0.015042 0.024547 5 | 73 0.076021 0.27925 0.019292 0.045125 6 | 73 0.064958 0.279477 0.0175 0.045797 7 | 73 0.107365 0.280766 0.059187 0.047188 8 | 73 0.125104 0.190445 0.196375 0.071797 9 | 73 0.18649 0.121867 0.028771 0.045047 10 | 57 0.09499 0.879836 0.183063 0.209859 11 | 58 0.925958 0.498328 0.121708 0.132469 12 | 58 0.845135 0.422563 0.130229 0.154219 13 | 58 0.944417 0.358805 0.111167 0.162297 14 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000450.txt: -------------------------------------------------------------------------------- 1 | 40 0.797922 0.079594 0.153031 0.145729 2 | 41 0.939078 0.20101 0.121844 0.402021 3 | 53 0.442508 0.505812 0.885016 0.954375 4 | 60 0.5 0.501125 1 0.99775 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000459.txt: -------------------------------------------------------------------------------- 1 | 27 0.374777 0.623273 0.119438 0.374703 2 | 0 0.498915 0.560672 0.997829 0.856188 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000471.txt: -------------------------------------------------------------------------------- 1 | 5 0.547992 0.511241 0.718172 0.496628 2 | 0 0.342398 0.415995 0.025328 0.10534 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000472.txt: -------------------------------------------------------------------------------- 1 | 4 0.685102 0.320398 0.136266 0.139204 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000474.txt: -------------------------------------------------------------------------------- 1 | 0 0.504429 0.51461 0.988619 0.85842 2 | 35 0.162357 0.54031 0.265495 0.14262 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000486.txt: -------------------------------------------------------------------------------- 1 | 72 0.661219 0.540585 0.0985 0.257283 2 | 69 0.806289 0.82192 0.387422 0.356159 3 | 39 0.987359 0.590995 0.025031 0.089391 4 | 43 0.354859 0.511148 0.010812 0.121686 5 | 39 0.797414 0.681768 0.036016 0.059274 6 | 39 0.133781 0.54733 0.008 0.068103 7 | 43 0.370891 0.489778 0.006094 0.038712 8 | 45 0.49707 0.805504 0.205297 0.206604 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000488.txt: -------------------------------------------------------------------------------- 1 | 32 0.680102 0.631552 0.012953 0.01867 2 | 0 0.36418 0.679347 0.163484 0.322734 3 | 0 0.274594 0.74064 0.198437 0.272808 4 | 34 0.385367 0.612722 0.099141 0.113128 5 | 35 0.361008 0.702106 0.037734 0.050468 6 | 35 0.887125 0.633781 0.016406 0.01968 7 | 0 0.346883 0.574544 0.039703 0.174261 8 | 0 0.888102 0.593793 0.068953 0.12133 9 | 0 0.125453 0.7 0.142562 0.375271 10 | 0 0.354016 0.457796 0.006906 0.019729 11 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000490.txt: -------------------------------------------------------------------------------- 1 | 16 0.182 0.534343 0.18 0.288889 2 | 36 0.70079 0.530333 0.18242 0.507859 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000491.txt: -------------------------------------------------------------------------------- 1 | 77 0.53007 0.511406 0.52238 0.950799 2 | 77 0.77515 0.250783 0.39914 0.496645 3 | 77 0.09187 0.305192 0.18374 0.579201 4 | 77 0.3722 0.194617 0.42652 0.383419 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000502.txt: -------------------------------------------------------------------------------- 1 | 21 0.568008 0.507892 0.426766 0.603607 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000508.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/INT8/coco128/labels/000000000508.txt -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000510.txt: -------------------------------------------------------------------------------- 1 | 0 0.515203 0.582208 0.2365 0.621625 2 | 13 0.508992 0.682021 0.886516 0.420208 3 | 9 0.05225 0.079781 0.057313 0.119104 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000514.txt: -------------------------------------------------------------------------------- 1 | 59 0.551931 0.664195 0.896139 0.622484 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000520.txt: -------------------------------------------------------------------------------- 1 | 14 0.49382 0.314292 0.050016 0.042208 2 | 14 0.386117 0.287854 0.053391 0.029083 3 | 0 0.390039 0.677031 0.023766 0.071396 4 | 14 0.716469 0.471865 0.029 0.037062 5 | 14 0.018312 0.406875 0.036281 0.03225 6 | 14 0.711508 0.379385 0.034328 0.033521 7 | 14 0.951742 0.383375 0.030703 0.021708 8 | 14 0.180062 0.429021 0.055969 0.047583 9 | 14 0.262891 0.396615 0.039844 0.024729 10 | 0 0.721891 0.679969 0.027906 0.039313 11 | 0 0.800156 0.688458 0.012656 0.028542 12 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000529.txt: -------------------------------------------------------------------------------- 1 | 3 0.46548 0.645531 0.848244 0.544594 2 | 0 0.522658 0.440125 0.537119 0.641625 3 | 0 0.378642 0.30618 0.637705 0.306422 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000531.txt: -------------------------------------------------------------------------------- 1 | 1 0.096148 0.577531 0.039609 0.035062 2 | 0 0.441242 0.610219 0.061578 0.185812 3 | 1 0.048727 0.581052 0.039359 0.032438 4 | 0 0.158914 0.60201 0.058859 0.136771 5 | 0 0.402781 0.554979 0.019156 0.054792 6 | 32 0.4245 0.616625 0.002906 0.00575 7 | 0 0.34607 0.556073 0.016609 0.049604 8 | 0 0.708234 0.550083 0.020063 0.073792 9 | 0 0.797523 0.542563 0.019859 0.066458 10 | 38 0.471602 0.638062 0.023047 0.066208 11 | 0 0.618039 0.555833 0.018891 0.043458 12 | 0 0.027633 0.575719 0.035078 0.074604 13 | 38 0.097961 0.567479 0.106297 0.074333 14 | 38 0.398789 0.564906 0.006766 0.008813 15 | 1 0.990477 0.564375 0.016391 0.019917 16 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000532.txt: -------------------------------------------------------------------------------- 1 | 5 0.495508 0.537823 0.721359 0.546063 2 | 0 0.455234 0.651458 0.069562 0.325542 3 | 0 0.229922 0.646854 0.071344 0.237542 4 | 0 0.359898 0.462552 0.028109 0.038312 5 | 0 0.250852 0.471458 0.019172 0.040958 6 | 5 0.076148 0.538552 0.151234 0.395854 7 | 26 0.25575 0.596667 0.032969 0.074042 8 | 26 0.199906 0.686667 0.023594 0.052833 9 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000536.txt: -------------------------------------------------------------------------------- 1 | 56 0.818248 0.704598 0.348951 0.581935 2 | 0 0.826853 0.693705 0.346295 0.590089 3 | 0 0.499152 0.617054 0.242009 0.760774 4 | 0 0.306741 0.59625 0.219107 0.784286 5 | 26 0.098493 0.883988 0.098326 0.232024 6 | 26 0.528594 0.647589 0.155089 0.188155 7 | 26 0.818225 0.718661 0.101719 0.036607 8 | 67 0.476049 0.348571 0.030536 0.062917 9 | 67 0.252422 0.319509 0.064576 0.117113 10 | 56 0.093571 0.711176 0.184107 0.577649 11 | 67 0.815558 0.687158 0.017946 0.037113 12 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000540.txt: -------------------------------------------------------------------------------- 1 | 2 0.276992 0.873094 0.015484 0.022471 2 | 2 0.962328 0.741424 0.015 0.025671 3 | 2 0.265844 0.939612 0.024188 0.023788 4 | 2 0.348719 0.787271 0.016125 0.022729 5 | 4 0.478937 0.538941 0.469187 0.194118 6 | 7 0.153891 0.876224 0.034125 0.058471 7 | 9 0.397773 0.347282 0.002828 0.004541 8 | 2 0.122594 0.962353 0.021 0.022353 9 | 2 0.15725 0.933953 0.01975 0.0256 10 | 2 0.212547 0.886906 0.012812 0.021624 11 | 2 0.197828 0.869247 0.015656 0.022353 12 | 2 0.310688 0.877788 0.013312 0.0232 13 | 2 0.490477 0.476671 0.007359 0.014471 14 | 2 0.087594 0.4588 0.011562 0.014259 15 | 2 0.349578 0.836129 0.017688 0.030094 16 | 5 0.669656 0.491847 0.036594 0.024306 17 | 7 0.523484 0.468882 0.017344 0.032071 18 | 2 0.459805 0.434224 0.008859 0.010424 19 | 5 0.718031 0.9306 0.020969 0.046706 20 | 7 0.155422 0.935353 0.018844 0.024824 21 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000542.txt: -------------------------------------------------------------------------------- 1 | 4 0.502547 0.340444 0.994906 0.662913 2 | 0 0.401805 0.584236 0.107797 0.384463 3 | 0 0.27082 0.604473 0.075578 0.341219 4 | 0 0.738406 0.569669 0.062875 0.330331 5 | 0 0.593484 0.575 0.073969 0.276488 6 | 0 0.527797 0.573667 0.062813 0.27407 7 | 0 0.488664 0.57376 0.052266 0.294752 8 | 0 0.324 0.578771 0.068906 0.280558 9 | 0 0.74418 0.366963 0.067297 0.195165 10 | 0 0.470961 0.322727 0.105297 0.15781 11 | 0 0.459164 0.583027 0.048047 0.280723 12 | 26 0.295695 0.602986 0.027766 0.058326 13 | 26 0.311008 0.575919 0.028516 0.054318 14 | 27 0.730539 0.47436 0.001922 0.02095 15 | 26 0.770984 0.573388 0.031563 0.061901 16 | 0 0.704641 0.290393 0.030781 0.054256 17 | 0 0.451312 0.530269 0.022906 0.154711 18 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000544.txt: -------------------------------------------------------------------------------- 1 | 32 0.94293 0.696721 0.021578 0.017424 2 | 0 0.484273 0.759555 0.176922 0.377518 3 | 0 0.269125 0.83596 0.202406 0.260679 4 | 0 0.11932 0.797857 0.158859 0.334403 5 | 0 0.141641 0.501288 0.045062 0.104871 6 | 0 0.40918 0.492845 0.045578 0.117119 7 | 0 0.32525 0.523993 0.046938 0.064473 8 | 0 0.257008 0.502787 0.048672 0.098314 9 | 0 0.026266 0.60918 0.052312 0.182436 10 | 0 0.86825 0.520492 0.033969 0.04918 11 | 34 0.389859 0.713326 0.082406 0.017799 12 | 35 0.35707 0.796745 0.031672 0.071616 13 | 0 0.065344 0.624848 0.06675 0.139204 14 | 0 0.287078 0.530316 0.029531 0.058337 15 | 0 0.049359 0.509801 0.040063 0.106862 16 | 0 0.813289 0.510515 0.025609 0.069602 17 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000560.txt: -------------------------------------------------------------------------------- 1 | 58 0.178391 0.504327 0.120261 0.199808 2 | 71 0.297717 0.729647 0.24813 0.210321 3 | 67 0.361152 0.612308 0.022826 0.018718 4 | 71 0.509391 0.495673 0.064696 0.014038 5 | 61 0.704239 0.520064 0.086783 0.117179 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000562.txt: -------------------------------------------------------------------------------- 1 | 79 0.423227 0.342477 0.185839 0.185453 2 | 79 0.538463 0.263258 0.185343 0.346859 3 | 79 0.248203 0.270102 0.19721 0.285391 4 | 41 0.514492 0.532648 0.731111 0.823266 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000564.txt: -------------------------------------------------------------------------------- 1 | 0 0.585096 0.742031 0.283615 0.43625 2 | 0 0.914212 0.391609 0.171577 0.146719 3 | 38 0.672365 0.708156 0.202846 0.063781 4 | 56 0.16275 0.383633 0.083577 0.034797 5 | 56 0.252885 0.382375 0.087654 0.03975 6 | 56 0.435712 0.380219 0.091346 0.040656 7 | 56 0.525846 0.503047 0.108769 0.044188 8 | 56 0.309221 0.427586 0.096404 0.047266 9 | 56 0.219269 0.420742 0.097038 0.040328 10 | 56 0.120962 0.425578 0.090231 0.037 11 | 56 0.071904 0.385688 0.091808 0.035063 12 | 56 0.851952 0.511687 0.118288 0.072719 13 | 56 0.676125 0.453242 0.099096 0.033766 14 | 56 0.632846 0.501867 0.098808 0.042609 15 | 56 0.512096 0.417664 0.127808 0.120953 16 | 56 0.340683 0.395742 0.093673 0.064891 17 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000569.txt: -------------------------------------------------------------------------------- 1 | 0 0.200297 0.712146 0.125281 0.302875 2 | 33 0.318227 0.461302 0.046984 0.064896 3 | 33 0.278828 0.485896 0.026031 0.067875 4 | 33 0.245305 0.502354 0.035922 0.049375 5 | 33 0.230844 0.523781 0.040094 0.048521 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000572.txt: -------------------------------------------------------------------------------- 1 | 0 0.497506 0.514227 0.340304 0.846516 2 | 0 0.316557 0.668648 0.30178 0.541047 3 | 28 0.838735 0.765313 0.322529 0.346531 4 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000575.txt: -------------------------------------------------------------------------------- 1 | 15 0.283203 0.423216 0.552687 0.691657 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000581.txt: -------------------------------------------------------------------------------- 1 | 16 0.386237 0.56175 0.33167 0.51822 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000584.txt: -------------------------------------------------------------------------------- 1 | 44 0.272852 0.08446 0.527703 0.16216 2 | 50 0.536797 0.70669 0.098156 0.12108 3 | 50 0.463555 0.580915 0.303047 0.253474 4 | 51 0.625687 0.844707 0.142531 0.192934 5 | 51 0.762328 0.686068 0.127344 0.181901 6 | 51 0.784656 0.536467 0.115906 0.183545 7 | 51 0.852633 0.665904 0.104766 0.179319 8 | 51 0.392148 0.376291 0.058922 0.08446 9 | 51 0.421758 0.199108 0.115141 0.154742 10 | 45 0.5 0.507864 1 0.94831 11 | 51 0.374008 0.492535 0.134422 0.182817 12 | 51 0.263648 0.537782 0.104266 0.162746 13 | 51 0.638195 0.15473 0.091734 0.104296 14 | 51 0.602 0.503779 0.086625 0.128638 15 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000589.txt: -------------------------------------------------------------------------------- 1 | 29 0.73943 0.4845 0.029297 0.013125 2 | 0 0.657227 0.57649 0.227234 0.383937 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000590.txt: -------------------------------------------------------------------------------- 1 | 71 0.289658 0.60159 0.208313 0.02314 2 | 45 0.292017 0.61358 0.227066 0.0552 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000595.txt: -------------------------------------------------------------------------------- 1 | 62 0.685258 0.735312 0.220297 0.233167 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000597.txt: -------------------------------------------------------------------------------- 1 | 20 0.559867 0.724113 0.063703 0.094597 2 | 20 0.653281 0.685323 0.108 0.173468 3 | 20 0.788078 0.691815 0.113875 0.174758 4 | 20 0.365687 0.671008 0.117656 0.191048 5 | 20 0.2565 0.693044 0.093031 0.139476 6 | 20 0.167117 0.706694 0.054453 0.105403 7 | 20 0.045711 0.692137 0.086203 0.134839 8 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000599.txt: -------------------------------------------------------------------------------- 1 | 58 0.912555 0.304939 0.173953 0.582948 2 | 15 0.323703 0.540553 0.644531 0.898649 3 | 57 0.484102 0.497002 0.968203 0.985012 4 | 65 0.826 0.594816 0.280094 0.215725 5 | 65 0.763406 0.485356 0.309375 0.148649 6 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000605.txt: -------------------------------------------------------------------------------- 1 | 60 0.5 0.502448 1 0.995104 2 | 41 0.63007 0.440312 0.351359 0.364875 3 | 44 0.453117 0.52624 0.092078 0.204229 4 | 41 0.751687 0.211229 0.222469 0.296625 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000612.txt: -------------------------------------------------------------------------------- 1 | 59 0.516891 0.739875 0.665531 0.5 2 | 77 0.556156 0.65676 0.111062 0.182729 3 | 77 0.455187 0.671396 0.096875 0.168958 4 | 77 0.516672 0.633417 0.193719 0.225917 5 | 77 0.612797 0.539677 0.114813 0.166896 6 | 77 0.688164 0.55575 0.053766 0.079375 7 | 77 0.363398 0.496229 0.161516 0.20125 8 | 77 0.546492 0.523333 0.067453 0.03675 9 | 77 0.655359 0.598187 0.090625 0.138 10 | 77 0.737375 0.703396 0.216438 0.216042 11 | 77 0.566086 0.431719 0.077953 0.119979 12 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000620.txt: -------------------------------------------------------------------------------- 1 | 72 0.753187 0.459555 0.493625 0.910109 2 | 53 0.432146 0.508687 0.461667 0.226938 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000623.txt: -------------------------------------------------------------------------------- 1 | 13 0.86172 0.38362 0.27656 0.47676 2 | 77 0.4764 0.52584 0.946827 0.92584 3 | 56 0.86248 0.36568 0.265653 0.47968 4 | 0 0.71516 0.49351 0.564507 0.98182 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000625.txt: -------------------------------------------------------------------------------- 1 | 0 0.725 0.697578 0.1875 0.479821 2 | 0 0.503906 0.646749 0.157812 0.607623 3 | 0 0.361859 0.732578 0.144281 0.417982 4 | 29 0.452195 0.275191 0.052734 0.048498 5 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000626.txt: -------------------------------------------------------------------------------- 1 | 74 0.520594 0.303323 0.064562 0.088479 2 | 74 0.635297 0.319094 0.032625 0.097729 3 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000629.txt: -------------------------------------------------------------------------------- 1 | 3 0.694297 0.786124 0.385562 0.367939 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000634.txt: -------------------------------------------------------------------------------- 1 | 0 0.474906 0.577531 0.680351 0.328094 2 | 36 0.551557 0.739773 0.3774 0.084484 3 | 0 0.37534 0.049539 0.050773 0.048078 4 | 0 0.896546 0.089906 0.206909 0.179375 5 | 0 0.438841 0.045594 0.049204 0.03775 6 | 0 0.212927 0.082453 0.059859 0.044656 7 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000636.txt: -------------------------------------------------------------------------------- 1 | 61 0.444448 0.558563 0.552563 0.837844 2 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000641.txt: -------------------------------------------------------------------------------- 1 | 1 0.200758 0.625491 0.040734 0.140093 2 | 1 0.896867 0.644696 0.027328 0.050981 3 | 5 0.548531 0.501121 0.652219 0.534813 4 | 0 0.91232 0.560888 0.017484 0.030561 5 | 0 0.896828 0.603061 0.027281 0.080327 6 | 0 0.940219 0.559556 0.015219 0.030888 7 | 0 0.873758 0.567886 0.010984 0.053388 8 | 0 0.728437 0.557897 0.007875 0.061495 9 | 0 0.953398 0.55868 0.011141 0.033762 10 | 0 0.065008 0.511799 0.045922 0.053738 11 | 0 0.021906 0.517243 0.031875 0.053645 12 | 0 0.004938 0.538411 0.009875 0.044252 13 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000643.txt: -------------------------------------------------------------------------------- 1 | 62 0.42217 0.716493 0.42062 0.529893 2 | 39 0.18036 0.82772 0.09312 0.308133 3 | 73 0.72236 0.389267 0.0116 0.126267 4 | 73 0.85443 0.394213 0.09602 0.168427 5 | 73 0.67057 0.39276 0.01246 0.128667 6 | 73 0.68045 0.39272 0.01022 0.130347 7 | 73 0.69228 0.395107 0.01284 0.126 8 | 73 0.69397 0.759547 0.0587 0.152 9 | 73 0.70329 0.39012 0.01758 0.130427 10 | 73 0.73517 0.39176 0.1441 0.13056 11 | 73 0.70365 0.946067 0.24438 0.085413 12 | 77 0.43418 0.07944 0.09648 0.141707 13 | 45 0.3492 0.22412 0.08104 0.063547 14 | 64 0.23286 0.97588 0.07216 0.04728 15 | 73 0.22994 0.248627 0.10952 0.014053 16 | 73 0.22808 0.260147 0.11112 0.014053 17 | 73 0.23099 0.273973 0.10746 0.01264 18 | 77 0.81076 0.16444 0.07972 0.14712 19 | 73 0.23152 0.286933 0.10744 0.013867 20 | 39 0.43892 0.215467 0.05436 0.176373 21 | -------------------------------------------------------------------------------- /INT8/coco128/labels/000000000650.txt: -------------------------------------------------------------------------------- 1 | 15 0.519398 0.544087 0.476359 0.572061 2 | 2 0.501859 0.820726 0.996281 0.332178 3 | -------------------------------------------------------------------------------- /INT8/convert.py: -------------------------------------------------------------------------------- 1 | import os 2 | import cv2 3 | import json 4 | from tqdm import tqdm 5 | from sklearn.model_selection import train_test_split 6 | import argparse 7 | 8 | parser = argparse.ArgumentParser() 9 | parser.add_argument('--root_dir', default='coco128',type=str, help="root path of images and labels, include images and labels and classes.txt") 10 | parser.add_argument('--save_path', type=str,default='output.json', help="if not split the dataset, give a path to a json file") 11 | arg = parser.parse_args() 12 | 13 | def train_test_val_split(img_paths, ratio_train = 0.8, ratio_test = 0.1, ratio_val = 0.1): 14 | # here can modify the ratio of dataset division 15 | assert int(ratio_train + ratio_test + ratio_val) == 1 16 | train_img, middle_img = train_test_split(img_paths, test_size = 1 - ratio_train, random_state = 233) 17 | ratio = ratio_val / (1 - ratio_train) 18 | val_img, test_img = train_test_split(middle_img, test_size = ratio, random_state = 233) 19 | print("nums of train:val:test = {}:{}:{}".format(len(train_img), len(val_img), len(test_img))) 20 | return train_img, val_img, test_img 21 | 22 | 23 | def yolo2coco(root_path): 24 | originLabelsDir = os.path.join(root_path, 'labels') 25 | originImagesDir = os.path.join(root_path, 'images') 26 | with open(os.path.join(root_path, 'classes.txt')) as f: 27 | classes = f.read().strip().split() 28 | # images dir name 29 | indexes = os.listdir(originImagesDir) 30 | 31 | 32 | dataset = {'categories': [], 'annotations': [], 'images': []} 33 | for i, cls in enumerate(classes, 0): 34 | dataset['categories'].append({'id': i, 'name': cls, 'supercategory': 'mark'}) 35 | 36 | # labeled id 37 | ann_id_cnt = 0 38 | for k, index in enumerate(tqdm(indexes)): 39 | # support .png & .jpg format images 40 | txtFile = index.replace('images', 'txt').replace('.jpg', '.txt').replace('.png', '.txt') 41 | # read the width and height of the image 42 | im = cv2.imread(os.path.join(root_path, 'images/') + index) 43 | height, width, _ = im.shape 44 | 45 | # add image information 46 | dataset['images'].append({'file_name': index, 47 | 'id': k, 48 | 'width': width, 49 | 'height': height}) 50 | if not os.path.exists(os.path.join(originLabelsDir, txtFile)): 51 | # if there is no label, skip it and only keep the image information 52 | continue 53 | with open(os.path.join(originLabelsDir, txtFile), 'r') as fr: 54 | labelList = fr.readlines() 55 | for label in labelList: 56 | label = label.strip().split() 57 | x = float(label[1]) 58 | y = float(label[2]) 59 | w = float(label[3]) 60 | h = float(label[4]) 61 | 62 | # convert x, y, w, h to x1, y1, x2, y2 63 | H, W, _ = im.shape 64 | x1 = (x - w / 2) * W 65 | y1 = (y - h / 2) * H 66 | x2 = (x + w / 2) * W 67 | y2 = (y + h / 2) * H 68 | # the label number starts from 0 69 | cls_id = int(label[0]) 70 | width = max(0, x2 - x1) 71 | height = max(0, y2 - y1) 72 | dataset['annotations'].append({ 73 | 'area': width * height, 74 | 'bbox': [x1, y1, width, height], 75 | 'category_id': cls_id, 76 | 'id': ann_id_cnt, 77 | 'image_id': k, 78 | 'iscrowd': 0, 79 | # mask, the rectangle is the four vertices clockwise from the upper left corner 80 | 'segmentation': [[x1, y1, x2, y1, x2, y2, x1, y2]] 81 | }) 82 | ann_id_cnt += 1 83 | 84 | # save result 85 | folder = os.path.join(root_path, 'annotations') 86 | if not os.path.exists(folder): 87 | os.makedirs(folder) 88 | 89 | json_name = os.path.join(root_path, 'annotations/{}'.format(arg.save_path)) 90 | with open(json_name, 'w') as f: 91 | json.dump(dataset, f) 92 | print('Save annotation to {}'.format(json_name)) 93 | 94 | if __name__ == "__main__": 95 | root_path = arg.root_dir 96 | assert os.path.exists(root_path) 97 | print("Loading data from ", root_path) 98 | yolo2coco(root_path) 99 | -------------------------------------------------------------------------------- /INT8/yolov4_416x416_coco.yml: -------------------------------------------------------------------------------- 1 | models: 2 | - name: yolov4 3 | launchers: 4 | - framework: dlsdk 5 | model: models/yolov4/FP16/frozen_darknet_yolov4_model.xml 6 | weights: models/yolov4/FP16/frozen_darknet_yolov4_model.bin 7 | adapter: 8 | type: yolo_v3 9 | anchors: 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401 10 | num: 9 11 | coords: 4 12 | classes: 80 13 | threshold: 0.001 14 | anchor_masks: [[0, 1, 2], [3, 4, 5], [6, 7, 8]] 15 | raw_output: True 16 | outputs: 17 | - detector/yolo-v4/Conv_1/BiasAdd/YoloRegion 18 | - detector/yolo-v4/Conv_9/BiasAdd/YoloRegion 19 | - detector/yolo-v4/Conv_17/BiasAdd/YoloRegion 20 | datasets: 21 | - name: coco128 22 | preprocessing: 23 | - type: bgr_to_rgb 24 | - type: resize 25 | size: 416 26 | postprocessing: 27 | - type: resize_prediction_boxes 28 | - type: filter 29 | apply_to: prediction 30 | min_confidence: 0.001 31 | remove_filtered: true 32 | - type: diou_nms 33 | overlap: 0.5 34 | - type: clip_boxes 35 | apply_to: prediction 36 | annotation_conversion: 37 | converter: mscoco_detection 38 | annotation_file: ./coco128/annotations/output.json 39 | data_source: ./coco128/images 40 | metrics: 41 | - type: map 42 | integral: max 43 | ignore_difficult: true 44 | overlap_threshold: 0 45 | presenter: print_scalar 46 | - name: AP@0.5 47 | type: coco_precision 48 | max_detections: 10 49 | threshold: 0.5 50 | - name: AP@0.5:0.05:95 51 | type: coco_precision 52 | max_detections: 10 53 | threshold: '0.5:0.05:0.95' 54 | -------------------------------------------------------------------------------- /INT8/yolov4_416x416_qtz.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "model_name": "yolov4", 4 | "model": "models/yolov4/FP16/frozen_darknet_yolov4_model.xml", 5 | "weights": "models/yolov4/FP16/frozen_darknet_yolov4_model.bin" 6 | }, 7 | "engine": { 8 | "launchers": [ 9 | { 10 | "framework": "dlsdk", 11 | "adapter": { 12 | "type": "yolo_v3", 13 | "anchors": "12.0, 16.0, 19.0, 36.0, 40.0, 28.0, 36.0, 75.0, 76.0, 55.0, 72.0, 146.0, 142.0, 110.0, 192.0, 243.0, 459.0, 401.0", 14 | "classes": 80, 15 | "coords": 4, 16 | "num": 9, 17 | "threshold": 0.001, 18 | "anchor_masks": [[0, 1, 2], [3, 4, 5], [6, 7, 8]], 19 | "outputs": ["detector/yolo-v4/Conv_1/BiasAdd/YoloRegion", "detector/yolo-v4/Conv_9/BiasAdd/YoloRegion", "detector/yolo-v4/Conv_17/BiasAdd/YoloRegion"] 20 | } 21 | } 22 | ], 23 | "datasets": [ 24 | { 25 | "name": "coco", 26 | "preprocessing": [ 27 | { 28 | "type": "resize", 29 | "dst_width": 416, 30 | "dst_height": 416 31 | }, 32 | { 33 | "type": "bgr_to_rgb" 34 | } 35 | ], 36 | "annotation_conversion": { 37 | "converter": "mscoco_detection", 38 | "annotation_file": "./coco128/annotations/output.json" 39 | }, 40 | "data_source": "./coco128/images", 41 | "postprocessing": [ 42 | { 43 | "type": "resize_prediction_boxes" 44 | }, 45 | { 46 | "type": "filter", 47 | "apply_to": "prediction", 48 | "min_confidence": 0.001, 49 | "remove_filtered": true 50 | }, 51 | { 52 | "type": "diou_nms", 53 | "overlap": 0.5 54 | }, 55 | { 56 | "type": "clip_boxes", 57 | "apply_to": "prediction" 58 | } 59 | ], 60 | "metrics": [ 61 | { 62 | "type": "map", 63 | "integral": "max", 64 | "ignore_difficult": true, 65 | "overlap_threshold": 0, 66 | "presenter": "print_scalar" 67 | }, 68 | { 69 | "name": "AP@0.5", 70 | "type": "coco_precision", 71 | "max_detections": 10, 72 | "threshold": 0.5 73 | }, 74 | { 75 | "name": "AP@0.5:0.05:95", 76 | "type": "coco_precision", 77 | "max_detections": 10, 78 | "threshold": "0.5:0.05:0.95" 79 | } 80 | ] 81 | } 82 | ] 83 | }, 84 | "compression": { 85 | "target_device": "ANY", // Target device, the specificity of which will be taken into account during optimization. 86 | // The default value "ANY" stands for compatible quantization supported by any HW. 87 | "algorithms": [ 88 | { 89 | "name": "DefaultQuantization", // Optimization algorithm name 90 | "params": { 91 | "preset": "mixed", // Preset [performance, mixed] which control the quantization 92 | // mode (symmetric, mixed (weights symmetric and activations asymmetric) 93 | // and fully asymmetric respectively) 94 | "stat_subset_size": 300 // Size of subset to calculate activations statistics that can be used 95 | // for quantization parameters calculation 96 | }, 97 | "use_fast_bias": false 98 | } 99 | ] 100 | } 101 | // "compression": { 102 | // "target_device": "ANY", // Target device, the specificity of which will be taken into account during optimization. 103 | // // The default value "ANY" stands for compatible quantization supported by any HW. 104 | // "algorithms": [ 105 | // { 106 | // "name": "AccuracyAwareQuantization", // Optimization algorithm name 107 | // "params": { 108 | // "preset": "mixed", // Preset [performance, mixed, accuracy] which control the quantization 109 | // // mode (symmetric, mixed (weights symmetric and activations asymmetric) 110 | // // and fully asymmetric respectively) 111 | 112 | // "stat_subset_size": 300, // Size of subset to calculate activations statistics that can be used 113 | // // for quantization parameters calculation 114 | 115 | // "maximal_drop": 0.005 // Maximum accuracy drop which has to be achieved after the quantization 116 | // } 117 | // } 118 | // ] 119 | // } 120 | // "optimizer": { 121 | // "name": "Tpe", 122 | // "params": { 123 | // "max_trials": 200, 124 | // "trials_load_method": "cold_start", 125 | // "accuracy_loss": 0.1, 126 | // "latency_reduce": 1.5, 127 | // "accuracy_weight": 1.0, 128 | // "latency_weight": 0.0, 129 | // "benchmark": { 130 | // "performance_count": false, 131 | // "batch_size": 1, 132 | // "nthreads": 8, 133 | // "nstreams": 1, 134 | // "nireq": 1, 135 | // "api_type": "async", 136 | // "niter": 1, 137 | // "duration_seconds": 30, 138 | // "benchmark_app_dir": "" // Path to benchmark_app If not specified, Python base benchmark will be used. Use benchmark_app to reduce jitter in results. 139 | // } 140 | // } 141 | // }, 142 | // "compression": { 143 | // "target_device": "ANY", 144 | // "algorithms": [ 145 | // { 146 | // "name": "ActivationChannelAlignment", 147 | // "params": { 148 | // "stat_subset_size": 300 149 | // } 150 | // }, 151 | // { 152 | // "name": "TunableQuantization", 153 | // "params": { 154 | // "stat_subset_size": 300, 155 | // "preset": "performance", 156 | // "tuning_scope": ["range_estimator"], 157 | // "estimator_tuning_scope": ["preset", "outlier_prob"], 158 | // "outlier_prob_choices": [1e-3, 1e-4, 1e-5] 159 | // } 160 | // }, 161 | // { 162 | // "name": "FastBiasCorrection", 163 | // "params": { 164 | // "stat_subset_size": 300 165 | // } 166 | // } 167 | // ] 168 | // } 169 | // "optimizer": { 170 | // "name": "Tpe", 171 | // "params": { 172 | // "max_trials": 200, 173 | // "trials_load_method": "cold_start", 174 | // "accuracy_loss": 0.1, 175 | // "latency_reduce": 1.5, 176 | // "accuracy_weight": 1.0, 177 | // "latency_weight": 1.0, 178 | // "benchmark": { 179 | // "performance_count": false, 180 | // "batch_size": 1, 181 | // "nthreads": 8, 182 | // "nstreams": 1, 183 | // "nireq": 1, 184 | // "api_type": "async", 185 | // "niter": 1, 186 | // "duration_seconds": 30, 187 | // "benchmark_app_dir": "" // Path to benchmark_app If not specified, Python base benchmark will be used. Use benchmark_app to reduce jitter in results. 188 | // } 189 | // } 190 | // }, 191 | // "compression": { 192 | // "target_device": "ANY", 193 | // "algorithms": [ 194 | // { 195 | // "name": "ActivationChannelAlignment", 196 | // "params": { 197 | // "stat_subset_size": 300 198 | // } 199 | // }, 200 | // { 201 | // "name": "TunableQuantization", 202 | // "params": { 203 | // "stat_subset_size": 300, 204 | // "preset": "performance", 205 | // "tuning_scope": ["layer"] 206 | // } 207 | // }, 208 | // { 209 | // "name": "FastBiasCorrection", 210 | // "params": { 211 | // "stat_subset_size": 300 212 | // } 213 | // } 214 | // ] 215 | // } 216 | } 217 | 218 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 TianWen Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenVINO-YOLOV4 2 | 3 | ## Introduction 4 | 5 | This is full implementation of [YOLOV4 series](https://github.com/AlexeyAB/darknet) in OpenVINO2021.3. 6 | 7 | Based on https://github.com/mystic123/tensorflow-yolo-v3 8 | 9 | **Supported model** 10 | 11 | - YOLOv4 12 | - YOLOv4-relu 13 | - YOLOv4-tiny 14 | - [YOLOv4-tiny-3l](https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/v4-tiny-3l) 15 | - [YOLOv4-csp](https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4) 16 | - [YOLOv4x-mish](https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4) 17 | 18 | **Supported device** 19 | 20 | - Intel CPU 21 | - Intel GPU 22 | - HDDL VPU 23 | - NCS2 24 | - ... ... 25 | 26 | **Supported model precision** 27 | 28 | - FP32 29 | - FP16 30 | - [INT8 Quantization](https://github.com/TNTWEN/OpenVINO-YOLOV4#int8-quantization) 31 | 32 | **Supported inference demo** 33 | 34 | - Python demo:all models 35 | - C++ demo:YOLOv4,YOLOv4-relu,YOLOv4-tiny,YOLOv4-tiny-3l 36 | 37 | ## Development log 38 | - Pruned-OpenVINO-YOLO:https://github.com/TNTWEN/Pruned-OpenVINO-YOLO 39 | 40 | A tutorial on pruning the YOLOv3/v4/v4-tiny/v4-tiny-3l model(**find the most compact model structure for the current detection task,greatly compress your model and improve detection FPS**)and deploying it in OpenVINO which can even meet the simultaneous inference of multiple video streams. Both Chinese and English versions are available. Welcome to have a try! 41 | 42 | - YOLOv4-tiny-3l:https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/v4-tiny-3l 43 | 44 | - OpenVINO 2021.3 AND OpenVINO2020.4 fully support the project! 45 | 46 | - YOLOv4-csp and YOLOv4x-mish :https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4 47 | 48 | - Add INT8 Quantization support. Pruned-YOLOv4 series model+ INT8 Quantization will be very friendly to embedded devices 49 | 50 | ## FAQ 51 | [FAQ](https://github.com/TNTWEN/OpenVINO-YOLOV4/issues/10) 52 | 53 | ## Environment 54 | 55 | - OpenVINO2021.3 :https://docs.openvinotoolkit.org/latest/index.html or OpenVINO2020.4 56 | - If you want to use yolov4+GPU+FP16,please don't use OpenVINO 2021.1 and OpenVINO2021.2 57 | - Win or Ubuntu 58 | - Python 3.6.5 59 | - Tensorflow 1.15.5 (1.12.0 for OpenVINO2020.4 ) 60 | - YOLOV4:https://github.com/AlexeyAB/darknet train your own model 61 | - *Convert YOLOV3/2/1 model :https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html 62 | 63 | 64 | ## How to use 65 | ★ This repository provides python inference demo for different OpenVINO version.[pythondemo](https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/master/pythondemo) 66 | 67 | ★ Choose the right demo before you run object_detection_demo_yolov3_async.py 68 | 69 | ★ You could also use C++ inference demo provided by OpenVINO. 70 | 71 | (OpenVINO2021.3 default C++ demo path:`C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\open_model_zoo\demos\multi_channel_object_detection_demo_yolov3\cpp`) 72 | 73 | ### YOLOV4 74 | 75 | download yolov4.weights . 76 | 77 | ``` 78 | #windows default OpenVINO path 79 | 80 | python convert_weights_pb.py --class_names cfg/coco.names --weights_file yolov4.weights --data_format NHWC 81 | 82 | "C:\Program Files (x86)\Intel\openvino_2021\bin\setupvars.bat" 83 | 84 | python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --transformations_config yolov4.json --batch 1 --reverse_input_channels 85 | 86 | python object_detection_demo_yolov3_async.py -i cam -m frozen_darknet_yolov4_model.xml -d CPU 87 | 88 | 89 | ``` 90 | 91 | 92 | ![OpenVINOyolov4](assets/yolov4-416.png) 93 | 94 | Compared with darknet: 95 | ![darknetyolov4](assets/darknet-v4-416.jpg) 96 | 97 | ### YOLOV4-relu 98 | 99 | prepare yolov4.weights . 100 | 101 | ``` 102 | #windows default OpenVINO path 103 | cd yolov4-relu 104 | 105 | python convert_weights_pb.py --class_names cfg/coco.names --weights_file yolov4.weights --data_format NHWC 106 | 107 | "C:\Program Files (x86)\Intel\openvino_2021\bin\setupvars.bat" 108 | 109 | python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --transformations_config yolov4.json --batch 1 --reverse_input_channels 110 | 111 | python object_detection_demo_yolov3_async.py -i cam -m frozen_darknet_yolov4_model.xml -d CPU 112 | ``` 113 | 114 | 115 | 116 | ### YOLOV4-tiny 117 | 118 | download yolov4-tiny.weights . 119 | 120 | ``` 121 | #windows default OpenVINO path 122 | 123 | python convert_weights_pb.py --class_names cfg/coco.names --weights_file yolov4-tiny.weights --data_format NHWC --tiny 124 | 125 | "C:\Program Files (x86)\Intel\openvino_2021\bin\setupvars.bat" 126 | 127 | python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --transformations_config yolo_v4_tiny.json --batch 1 --reverse_input_channels 128 | 129 | python object_detection_demo_yolov3_async.py -i cam -m frozen_darknet_yolov4_model.xml -d CPU 130 | ``` 131 | 132 | ![OpenVINOyolov4tiny](assets/yolov4tiny416.png) 133 | 134 | Compared with darknet: 135 | ![darknetyolov4tiny](assets/darknet-v4tiny-416.jpg) 136 | 137 | 138 | 139 | ## INT8 Quantization 140 | 141 | Thanks for [Jacky](https://github.com/jayer95)'s excellent work! 142 | 143 | Ref:https://docs.openvinotoolkit.org/latest/pot_README.html 144 | 145 | Environment: 146 | 147 | - OpenVINO2021.3 148 | - Ubuntu 18.04/20.04 ★ 149 | - Intel CPU/GPU 150 | 151 | **Step 1:Dataset Conversion** 152 | 153 | we should convert YOLO dataset to OpenVINO supported formats first. 154 | 155 | 156 | 157 | |--annotations 158 | 159 | ​ |-- output.json #output of convert.py , COCO-JSON format 160 | 161 | |--images 162 | 163 | ​ |-- *.jpg #put all the images here 164 | 165 | |--labels 166 | 167 | ​ |--*.txt #put all the YOLO format .txt labels here 168 | 169 | |--classes.txt 170 | 171 | we use coco128 for example: 172 | 173 | ``` 174 | cd INT8 175 | python3 convert.py --root_dir coco128 --save_path output.json 176 | ``` 177 | 178 | **Step 2: Install Accuracy-checker and POT** 179 | 180 | ``` 181 | sudo apt-get install python3 python3-dev python3-setuptools python3-pip 182 | 183 | cd /opt/intel/openvino_2021.3.394/deployment_tools/open_model_zoo/tools/accuracy_checker 184 | sudo python3 setup.py install 185 | 186 | 187 | cd /opt/intel/openvino_2021.3.394/deployment_tools/tools/post_training_optimization_toolkit 188 | sudo python3 setup.py install 189 | ``` 190 | 191 | **Step 3: INT8 Quantization using POT** 192 | 193 | ​ Prepare your yolo IR model(FP32/FP16) first. 194 | 195 | ``` 196 | source '/opt/intel/openvino_2021.3.394/bin/setupvars.sh' 197 | 198 | pot -c yolov4_416x416_qtz.json --output-dir backup -e 199 | ``` 200 | 201 | ​ Parameters you need to set in yolov4_416x416_qtz.json: 202 | 203 | - Line 4,5 :Set FP32/FP16 YOLO IR model 's path 204 | 205 | ``` 206 | "model":"models/yolov4/FP16/frozen_darknet_yolov4_model.xml", 207 | "weights":"models/yolov4/FP16/frozen_darknet_yolov4_model.bin" 208 | ``` 209 | 210 | - Line 29,30 :Set image width and height 211 | 212 | ``` 213 | "dst_width": 416, 214 | "dst_height": 416 215 | ``` 216 | 217 | - Line 38: Annotation_file(COCO JSON file) 218 | 219 | ``` 220 | "annotation_file": "./coco128/annotations/output.json" 221 | ``` 222 | 223 | - Line 40: Path of images 224 | 225 | ``` 226 | "data_source": "./coco128/images", 227 | ``` 228 | 229 | - There are many other quantization strategies to choose from, and the relevant parameters are annotated in yolov4_416x416_qtz.json.Select the strategy you want to replace the default strategy and try by yourself! 230 | 231 | **Step 4: Test IR model's map using Accuracy-checker** 232 | 233 | ``` 234 | #source '/opt/intel/openvino_2021.3.394/bin/setupvars.sh' 235 | accuracy_check -c yolov4_416x416_coco.yml -td CPU #-td GPU will be faster 236 | ``` 237 | 238 | ​ Parameters you need to set in yolov4_416x416_qtz.json: 239 | 240 | - Line 5,6 : Set IR model 's path 241 | 242 | ``` 243 | model: models/yolov4/FP16/frozen_darknet_yolov4_model.xml 244 | weights: models/yolov4/FP16/frozen_darknet_yolov4_model.bin 245 | ``` 246 | 247 | - Line 12: number of classes 248 | 249 | ``` 250 | classes: 80 251 | ``` 252 | 253 | - Line 25: Image size 254 | 255 | ``` 256 | size: 416 257 | ``` 258 | 259 | - Line 38:Annotation_file(COCO JSON file) 260 | 261 | ``` 262 | annotation_file: ./coco128/annotations/output.json 263 | ``` 264 | 265 | - Line 39: Path of images 266 | 267 | ``` 268 | data_source: ./coco128/images 269 | ``` 270 | -------------------------------------------------------------------------------- /assets/darknet-v4-416.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/assets/darknet-v4-416.jpg -------------------------------------------------------------------------------- /assets/darknet-v4tiny-416.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/assets/darknet-v4tiny-416.jpg -------------------------------------------------------------------------------- /assets/yolov4-416.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/assets/yolov4-416.png -------------------------------------------------------------------------------- /assets/yolov4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/assets/yolov4.png -------------------------------------------------------------------------------- /assets/yolov4tiny416.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNTWEN/OpenVINO-YOLOV4/4974156fd8962a5610ec6d34327788b2f2ec2b42/assets/yolov4tiny416.png -------------------------------------------------------------------------------- /cfg/coco.names: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorcycle 5 | airplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | couch 59 | potted plant 60 | bed 61 | dining table 62 | toilet 63 | tv 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /cfg/yolov4-tiny.cfg: -------------------------------------------------------------------------------- 1 | [net] 2 | # Testing 3 | #batch=1 4 | #subdivisions=1 5 | # Training 6 | batch=64 7 | subdivisions=1 8 | width=416 9 | height=416 10 | channels=3 11 | momentum=0.9 12 | decay=0.0005 13 | angle=0 14 | saturation = 1.5 15 | exposure = 1.5 16 | hue=.1 17 | 18 | learning_rate=0.00261 19 | burn_in=1000 20 | max_batches = 500200 21 | policy=steps 22 | steps=400000,450000 23 | scales=.1,.1 24 | 25 | [convolutional] 26 | batch_normalize=1 27 | filters=32 28 | size=3 29 | stride=2 30 | pad=1 31 | activation=leaky 32 | 33 | [convolutional] 34 | batch_normalize=1 35 | filters=64 36 | size=3 37 | stride=2 38 | pad=1 39 | activation=leaky 40 | 41 | [convolutional] 42 | batch_normalize=1 43 | filters=64 44 | size=3 45 | stride=1 46 | pad=1 47 | activation=leaky 48 | 49 | [route] 50 | layers=-1 51 | groups=2 52 | group_id=1 53 | 54 | [convolutional] 55 | batch_normalize=1 56 | filters=32 57 | size=3 58 | stride=1 59 | pad=1 60 | activation=leaky 61 | 62 | [convolutional] 63 | batch_normalize=1 64 | filters=32 65 | size=3 66 | stride=1 67 | pad=1 68 | activation=leaky 69 | 70 | [route] 71 | layers = -1,-2 72 | 73 | [convolutional] 74 | batch_normalize=1 75 | filters=64 76 | size=1 77 | stride=1 78 | pad=1 79 | activation=leaky 80 | 81 | [route] 82 | layers = -6,-1 83 | 84 | [maxpool] 85 | size=2 86 | stride=2 87 | 88 | [convolutional] 89 | batch_normalize=1 90 | filters=128 91 | size=3 92 | stride=1 93 | pad=1 94 | activation=leaky 95 | 96 | [route] 97 | layers=-1 98 | groups=2 99 | group_id=1 100 | 101 | [convolutional] 102 | batch_normalize=1 103 | filters=64 104 | size=3 105 | stride=1 106 | pad=1 107 | activation=leaky 108 | 109 | [convolutional] 110 | batch_normalize=1 111 | filters=64 112 | size=3 113 | stride=1 114 | pad=1 115 | activation=leaky 116 | 117 | [route] 118 | layers = -1,-2 119 | 120 | [convolutional] 121 | batch_normalize=1 122 | filters=128 123 | size=1 124 | stride=1 125 | pad=1 126 | activation=leaky 127 | 128 | [route] 129 | layers = -6,-1 130 | 131 | [maxpool] 132 | size=2 133 | stride=2 134 | 135 | [convolutional] 136 | batch_normalize=1 137 | filters=256 138 | size=3 139 | stride=1 140 | pad=1 141 | activation=leaky 142 | 143 | [route] 144 | layers=-1 145 | groups=2 146 | group_id=1 147 | 148 | [convolutional] 149 | batch_normalize=1 150 | filters=128 151 | size=3 152 | stride=1 153 | pad=1 154 | activation=leaky 155 | 156 | [convolutional] 157 | batch_normalize=1 158 | filters=128 159 | size=3 160 | stride=1 161 | pad=1 162 | activation=leaky 163 | 164 | [route] 165 | layers = -1,-2 166 | 167 | [convolutional] 168 | batch_normalize=1 169 | filters=256 170 | size=1 171 | stride=1 172 | pad=1 173 | activation=leaky 174 | 175 | [route] 176 | layers = -6,-1 177 | 178 | [maxpool] 179 | size=2 180 | stride=2 181 | 182 | [convolutional] 183 | batch_normalize=1 184 | filters=512 185 | size=3 186 | stride=1 187 | pad=1 188 | activation=leaky 189 | 190 | ################################## 191 | 192 | [convolutional] 193 | batch_normalize=1 194 | filters=256 195 | size=1 196 | stride=1 197 | pad=1 198 | activation=leaky 199 | 200 | [convolutional] 201 | batch_normalize=1 202 | filters=512 203 | size=3 204 | stride=1 205 | pad=1 206 | activation=leaky 207 | 208 | [convolutional] 209 | size=1 210 | stride=1 211 | pad=1 212 | filters=255 213 | activation=linear 214 | 215 | 216 | 217 | [yolo] 218 | mask = 3,4,5 219 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 220 | classes=80 221 | num=6 222 | jitter=.3 223 | scale_x_y = 1.05 224 | cls_normalizer=1.0 225 | iou_normalizer=0.07 226 | iou_loss=ciou 227 | ignore_thresh = .7 228 | truth_thresh = 1 229 | random=0 230 | resize=1.5 231 | nms_kind=greedynms 232 | beta_nms=0.6 233 | 234 | [route] 235 | layers = -4 236 | 237 | [convolutional] 238 | batch_normalize=1 239 | filters=128 240 | size=1 241 | stride=1 242 | pad=1 243 | activation=leaky 244 | 245 | [upsample] 246 | stride=2 247 | 248 | [route] 249 | layers = -1, 23 250 | 251 | [convolutional] 252 | batch_normalize=1 253 | filters=256 254 | size=3 255 | stride=1 256 | pad=1 257 | activation=leaky 258 | 259 | [convolutional] 260 | size=1 261 | stride=1 262 | pad=1 263 | filters=255 264 | activation=linear 265 | 266 | [yolo] 267 | mask = 1,2,3 268 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 269 | classes=80 270 | num=6 271 | jitter=.3 272 | scale_x_y = 1.05 273 | cls_normalizer=1.0 274 | iou_normalizer=0.07 275 | iou_loss=ciou 276 | ignore_thresh = .7 277 | truth_thresh = 1 278 | random=0 279 | resize=1.5 280 | nms_kind=greedynms 281 | beta_nms=0.6 -------------------------------------------------------------------------------- /convert_weights_pb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | import yolo_v4 6 | import yolo_v4_tiny 7 | from PIL import Image, ImageDraw 8 | 9 | from utils import load_weights, load_coco_names, detections_boxes, freeze_graph 10 | 11 | FLAGS = tf.app.flags.FLAGS 12 | 13 | tf.app.flags.DEFINE_string( 14 | 'class_names', 'coco.names', 'File with class names') 15 | tf.app.flags.DEFINE_string( 16 | 'weights_file', 'yolov4.weights', 'Binary file with detector weights') 17 | tf.app.flags.DEFINE_string( 18 | 'data_format', 'NCHW', 'Data format: NCHW (gpu only) / NHWC') 19 | tf.app.flags.DEFINE_string( 20 | 'output_graph', 'frozen_darknet_yolov4_model.pb', 'Frozen tensorflow protobuf model output path') 21 | 22 | tf.app.flags.DEFINE_bool( 23 | 'tiny', False, 'Use tiny version of YOLOv4') 24 | tf.app.flags.DEFINE_integer( 25 | 'size', 416, 'Image size') 26 | 27 | 28 | 29 | def main(argv=None): 30 | if FLAGS.tiny: 31 | model = yolo_v4_tiny.yolo_v4_tiny 32 | else: 33 | model = yolo_v4.yolo_v4 34 | 35 | classes = load_coco_names(FLAGS.class_names) 36 | 37 | # placeholder for detector inputs 38 | inputs = tf.placeholder(tf.float32, [None, FLAGS.size, FLAGS.size, 3], "inputs") 39 | 40 | with tf.variable_scope('detector'): 41 | detections = model(inputs, len(classes), data_format=FLAGS.data_format) 42 | load_ops = load_weights(tf.global_variables(scope='detector'), FLAGS.weights_file) 43 | 44 | # Sets the output nodes in the current session 45 | boxes = detections_boxes(detections) 46 | 47 | with tf.Session() as sess: 48 | sess.run(load_ops) 49 | freeze_graph(sess, FLAGS.output_graph) 50 | 51 | if __name__ == '__main__': 52 | tf.app.run() 53 | -------------------------------------------------------------------------------- /pythondemo/2020.4/monitors.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (C) 2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | try: 18 | from monitors_extension import Presenter 19 | except ImportError: 20 | import logging 21 | 22 | 23 | class Presenter: 24 | def __init__(self, keys, yPos=20, graphSize=(150, 60), historySize=20): 25 | self.yPos = yPos 26 | self.graphSize = graphSize 27 | self.graphPadding = 0 28 | if keys: 29 | logging.warning("monitors_extension wasn't found") 30 | 31 | def handleKey(self, key): pass 32 | 33 | def drawGraphs(self, frame): pass 34 | 35 | def reportMeans(self): return '' 36 | -------------------------------------------------------------------------------- /pythondemo/2020.4/monitors_extension/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2019 Intel Corporation 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | find_package(OpenCV 4 REQUIRED COMPONENTS core) 6 | 7 | add_library(monitors_extension MODULE monitors_extension.cpp) 8 | target_include_directories(monitors_extension PRIVATE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} 9 | "${PROJECT_SOURCE_DIR}/common") 10 | target_link_libraries(monitors_extension PRIVATE ${PYTHON_LIBRARIES} opencv_core monitors) 11 | set_target_properties(monitors_extension PROPERTIES PREFIX "") 12 | if(WIN32) 13 | set_target_properties(monitors_extension PROPERTIES SUFFIX ".pyd") 14 | endif() 15 | -------------------------------------------------------------------------------- /pythondemo/2020.4/monitors_extension/monitors_extension.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018-2019 Intel Corporation 2 | // SPDX-License-Identifier: Apache-2.0 3 | // 4 | 5 | #define PY_SSIZE_T_CLEAN 6 | #include 7 | 8 | #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 9 | #include "numpy/arrayobject.h" 10 | 11 | #include 12 | #include 13 | 14 | struct PresenterObject { 15 | PyObject_HEAD 16 | Presenter *_presenter; 17 | }; 18 | 19 | namespace { 20 | void presenter_dealloc(PresenterObject *self) { 21 | delete self->_presenter; 22 | PyTypeObject *tp = Py_TYPE(self); 23 | tp->tp_free(self); 24 | Py_DECREF(tp); 25 | } 26 | 27 | char yPosName[] = "yPos", graphSizeName[] = "graphSize"; 28 | 29 | int presenter_init(PresenterObject *self, PyObject *args, PyObject *kwds) { 30 | static char keysName[] = "keys", historySizeName[] = "graphSize"; 31 | static char *kwlist[] = {keysName, yPosName, graphSizeName, historySizeName, nullptr}; 32 | const char *keys; 33 | int yPos = 20, graphSizeWidth = 150, graphSizeHeight = 60; 34 | unsigned long long historySize = 20; 35 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i(ii)K", kwlist, &keys, &yPos, &graphSizeWidth, &graphSizeHeight, 36 | &historySize)) return -1; 37 | try { 38 | self->_presenter = new Presenter(keys, yPos, {graphSizeWidth, graphSizeHeight}, historySize); 39 | return 0; 40 | } catch (std::exception &exception) { 41 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 42 | return -1; 43 | } 44 | } 45 | 46 | PyObject *presenter_handleKey(PresenterObject *self, PyObject *args, PyObject *kwds) { 47 | if (!self->_presenter) { 48 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 49 | return nullptr; 50 | } 51 | static char keyName[] = "key"; 52 | static char *kwlist[] = {keyName, nullptr}; 53 | int key; 54 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &key)) return nullptr; 55 | try { 56 | self->_presenter->handleKey(key); 57 | Py_RETURN_NONE; 58 | } catch (std::exception &exception) { 59 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 60 | return nullptr; 61 | } 62 | } 63 | 64 | PyObject *presenter_drawGraphs(PresenterObject *self, PyObject *args, PyObject *kwds) { 65 | if (!self->_presenter) { 66 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 67 | return nullptr; 68 | } 69 | static char frameName[] = "frame"; 70 | static char *kwlist[] = {frameName, nullptr}; 71 | PyArrayObject *npFrame; 72 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, &npFrame)) return nullptr; 73 | if (PyArray_Check(npFrame) 74 | && PyArray_TYPE(npFrame) != NPY_UINT8 75 | && PyArray_NDIM(npFrame) != 3 76 | && PyArray_SHAPE(npFrame)[2] != 3) { 77 | PyErr_SetString(PyExc_TypeError, "frame must be an array of type uint8 with 3 dimensions with 3 elements in the" 78 | " last dimension"); 79 | return nullptr; 80 | } 81 | int height = static_cast(PyArray_SHAPE(npFrame)[0]); 82 | int width = static_cast(PyArray_SHAPE(npFrame)[1]); 83 | try { 84 | cv::Mat frame(height, width, CV_8UC3, PyArray_DATA(npFrame), PyArray_STRIDE(npFrame, 0)); 85 | self->_presenter->drawGraphs(frame); 86 | Py_RETURN_NONE; 87 | } catch (std::exception &exception) { 88 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 89 | return nullptr; 90 | } 91 | } 92 | 93 | PyObject *presenter_reportMeans(PresenterObject *self, PyObject *Py_UNUSED(ignored)) { 94 | if (!self->_presenter) { 95 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 96 | return nullptr; 97 | } 98 | try { 99 | return PyUnicode_FromFormat(self->_presenter->reportMeans().c_str()); 100 | } catch (std::exception &exception) { 101 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 102 | return nullptr; 103 | } 104 | } 105 | 106 | PyMethodDef presenter_methods[] = { 107 | {"handleKey", reinterpret_cast(presenter_handleKey), METH_VARARGS | METH_KEYWORDS}, 108 | {"drawGraphs", reinterpret_cast(presenter_drawGraphs), METH_VARARGS | METH_KEYWORDS}, 109 | {"reportMeans", reinterpret_cast(presenter_reportMeans), METH_NOARGS}, 110 | {}}; // Sentinel 111 | 112 | PyObject *presenter_getYPos(PresenterObject *self, void *closure) { 113 | if (!self->_presenter) { 114 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 115 | return nullptr; 116 | } 117 | return PyLong_FromLong(self->_presenter->yPos); 118 | } 119 | 120 | PyObject *presenter_getGraphSize(PresenterObject *self, void *closure) { 121 | if (!self->_presenter) { 122 | PyErr_SetString(PyExc_AssertionError , "Underlying C++ presenter is nullptr"); 123 | return nullptr; 124 | } 125 | return Py_BuildValue("ii", self->_presenter->graphSize.width, self->_presenter->graphSize.height); 126 | } 127 | 128 | PyObject *presenter_getGraphPadding(PresenterObject *self, void *closure) { 129 | if (!self->_presenter) { 130 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 131 | return nullptr; 132 | } 133 | return PyLong_FromLong(self->_presenter->graphPadding); 134 | } 135 | 136 | char graphPaddingName[] = "graphPadding"; 137 | PyGetSetDef presenter_getsetters[] = { 138 | {yPosName, reinterpret_cast(presenter_getYPos)}, 139 | {graphSizeName, reinterpret_cast(presenter_getGraphSize)}, 140 | {graphPaddingName, reinterpret_cast(presenter_getGraphPadding)}, 141 | {}}; // Sentinel 142 | 143 | char monitors_extension_doc[] = "The module is a wrapper over C++ monitors. It guarantees that C++ and Python " 144 | "monitors are consistent."; 145 | 146 | PyType_Slot presenterSlots[] = { 147 | {Py_tp_dealloc, reinterpret_cast(presenter_dealloc)}, 148 | {Py_tp_doc, monitors_extension_doc}, 149 | {Py_tp_methods, presenter_methods}, 150 | {Py_tp_getset, presenter_getsetters}, 151 | {Py_tp_init, reinterpret_cast(presenter_init)}, 152 | {Py_tp_new, reinterpret_cast(PyType_GenericNew)}, 153 | {}}; // Sentinel 154 | 155 | PyType_Spec presenterSpec{"monitors_extension.Presenter", sizeof(PresenterObject), 0, 0, presenterSlots}; 156 | 157 | PyModuleDef monitors_extension{PyModuleDef_HEAD_INIT, "monitors_extension", monitors_extension_doc, 0}; 158 | } 159 | 160 | PyMODINIT_FUNC PyInit_monitors_extension() { 161 | import_array(); 162 | if (PyErr_Occurred()) return nullptr; 163 | 164 | PyObject *presenterType = PyType_FromSpec(&presenterSpec); 165 | if (!presenterType) return nullptr; 166 | 167 | PyObject *m = PyModule_Create(&monitors_extension); 168 | if (m == nullptr) { 169 | Py_DECREF(presenterType); 170 | return nullptr; 171 | } 172 | 173 | if (PyModule_AddObject(m, "Presenter", presenterType) < 0) { 174 | Py_DECREF(presenterType); 175 | Py_DECREF(m); 176 | return nullptr; 177 | } 178 | return m; 179 | } 180 | -------------------------------------------------------------------------------- /pythondemo/2021.1/helpers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (C) 2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | import cv2 18 | 19 | def put_highlighted_text(frame, message, position, font_face, font_scale, color, thickness): 20 | cv2.putText(frame, message, position, font_face, font_scale, (255, 255, 255), thickness + 1) # white border 21 | cv2.putText(frame, message, position, font_face, font_scale, color, thickness) 22 | -------------------------------------------------------------------------------- /pythondemo/2021.1/monitors.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (C) 2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | try: 18 | from monitors_extension import Presenter 19 | except ImportError: 20 | import logging 21 | 22 | 23 | class Presenter: 24 | def __init__(self, keys, yPos=20, graphSize=(150, 60), historySize=20): 25 | self.yPos = yPos 26 | self.graphSize = graphSize 27 | self.graphPadding = 0 28 | if keys: 29 | logging.warning("monitors_extension wasn't found") 30 | 31 | def handleKey(self, key): pass 32 | 33 | def drawGraphs(self, frame): pass 34 | 35 | def reportMeans(self): return '' 36 | -------------------------------------------------------------------------------- /pythondemo/2021.1/monitors_extension/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2019 Intel Corporation 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | find_package(OpenCV 4 REQUIRED COMPONENTS core) 6 | 7 | add_library(monitors_extension MODULE monitors_extension.cpp) 8 | target_include_directories(monitors_extension PRIVATE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} 9 | "${PROJECT_SOURCE_DIR}/common") 10 | target_link_libraries(monitors_extension PRIVATE ${PYTHON_LIBRARIES} opencv_core monitors) 11 | set_target_properties(monitors_extension PROPERTIES PREFIX "") 12 | if(WIN32) 13 | set_target_properties(monitors_extension PROPERTIES SUFFIX ".pyd") 14 | endif() 15 | -------------------------------------------------------------------------------- /pythondemo/2021.1/monitors_extension/monitors_extension.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018-2019 Intel Corporation 2 | // SPDX-License-Identifier: Apache-2.0 3 | // 4 | 5 | #define PY_SSIZE_T_CLEAN 6 | #include 7 | 8 | #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 9 | #include "numpy/arrayobject.h" 10 | 11 | #include 12 | #include 13 | 14 | struct PresenterObject { 15 | PyObject_HEAD 16 | Presenter *_presenter; 17 | }; 18 | 19 | namespace { 20 | void presenter_dealloc(PresenterObject *self) { 21 | delete self->_presenter; 22 | PyTypeObject *tp = Py_TYPE(self); 23 | tp->tp_free(self); 24 | Py_DECREF(tp); 25 | } 26 | 27 | char yPosName[] = "yPos", graphSizeName[] = "graphSize"; 28 | 29 | int presenter_init(PresenterObject *self, PyObject *args, PyObject *kwds) { 30 | static char keysName[] = "keys", historySizeName[] = "graphSize"; 31 | static char *kwlist[] = {keysName, yPosName, graphSizeName, historySizeName, nullptr}; 32 | const char *keys; 33 | int yPos = 20, graphSizeWidth = 150, graphSizeHeight = 60; 34 | unsigned long long historySize = 20; 35 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i(ii)K", kwlist, &keys, &yPos, &graphSizeWidth, &graphSizeHeight, 36 | &historySize)) return -1; 37 | try { 38 | self->_presenter = new Presenter(keys, yPos, {graphSizeWidth, graphSizeHeight}, historySize); 39 | return 0; 40 | } catch (std::exception &exception) { 41 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 42 | return -1; 43 | } 44 | } 45 | 46 | PyObject *presenter_handleKey(PresenterObject *self, PyObject *args, PyObject *kwds) { 47 | if (!self->_presenter) { 48 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 49 | return nullptr; 50 | } 51 | static char keyName[] = "key"; 52 | static char *kwlist[] = {keyName, nullptr}; 53 | int key; 54 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &key)) return nullptr; 55 | try { 56 | self->_presenter->handleKey(key); 57 | Py_RETURN_NONE; 58 | } catch (std::exception &exception) { 59 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 60 | return nullptr; 61 | } 62 | } 63 | 64 | PyObject *presenter_drawGraphs(PresenterObject *self, PyObject *args, PyObject *kwds) { 65 | if (!self->_presenter) { 66 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 67 | return nullptr; 68 | } 69 | static char frameName[] = "frame"; 70 | static char *kwlist[] = {frameName, nullptr}; 71 | PyArrayObject *npFrame; 72 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, &npFrame)) return nullptr; 73 | if (PyArray_Check(npFrame) 74 | && PyArray_TYPE(npFrame) != NPY_UINT8 75 | && PyArray_NDIM(npFrame) != 3 76 | && PyArray_SHAPE(npFrame)[2] != 3) { 77 | PyErr_SetString(PyExc_TypeError, "frame must be an array of type uint8 with 3 dimensions with 3 elements in the" 78 | " last dimension"); 79 | return nullptr; 80 | } 81 | int height = static_cast(PyArray_SHAPE(npFrame)[0]); 82 | int width = static_cast(PyArray_SHAPE(npFrame)[1]); 83 | try { 84 | cv::Mat frame(height, width, CV_8UC3, PyArray_DATA(npFrame), PyArray_STRIDE(npFrame, 0)); 85 | self->_presenter->drawGraphs(frame); 86 | Py_RETURN_NONE; 87 | } catch (std::exception &exception) { 88 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 89 | return nullptr; 90 | } 91 | } 92 | 93 | PyObject *presenter_reportMeans(PresenterObject *self, PyObject *Py_UNUSED(ignored)) { 94 | if (!self->_presenter) { 95 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 96 | return nullptr; 97 | } 98 | try { 99 | return PyUnicode_FromFormat(self->_presenter->reportMeans().c_str()); 100 | } catch (std::exception &exception) { 101 | PyErr_SetString(PyExc_RuntimeError, exception.what()); 102 | return nullptr; 103 | } 104 | } 105 | 106 | PyMethodDef presenter_methods[] = { 107 | {"handleKey", reinterpret_cast(presenter_handleKey), METH_VARARGS | METH_KEYWORDS}, 108 | {"drawGraphs", reinterpret_cast(presenter_drawGraphs), METH_VARARGS | METH_KEYWORDS}, 109 | {"reportMeans", reinterpret_cast(presenter_reportMeans), METH_NOARGS}, 110 | {}}; // Sentinel 111 | 112 | PyObject *presenter_getYPos(PresenterObject *self, void *closure) { 113 | if (!self->_presenter) { 114 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 115 | return nullptr; 116 | } 117 | return PyLong_FromLong(self->_presenter->yPos); 118 | } 119 | 120 | PyObject *presenter_getGraphSize(PresenterObject *self, void *closure) { 121 | if (!self->_presenter) { 122 | PyErr_SetString(PyExc_AssertionError , "Underlying C++ presenter is nullptr"); 123 | return nullptr; 124 | } 125 | return Py_BuildValue("ii", self->_presenter->graphSize.width, self->_presenter->graphSize.height); 126 | } 127 | 128 | PyObject *presenter_getGraphPadding(PresenterObject *self, void *closure) { 129 | if (!self->_presenter) { 130 | PyErr_SetString(PyExc_AssertionError, "Underlying C++ presenter is nullptr"); 131 | return nullptr; 132 | } 133 | return PyLong_FromLong(self->_presenter->graphPadding); 134 | } 135 | 136 | char graphPaddingName[] = "graphPadding"; 137 | PyGetSetDef presenter_getsetters[] = { 138 | {yPosName, reinterpret_cast(presenter_getYPos)}, 139 | {graphSizeName, reinterpret_cast(presenter_getGraphSize)}, 140 | {graphPaddingName, reinterpret_cast(presenter_getGraphPadding)}, 141 | {}}; // Sentinel 142 | 143 | char monitors_extension_doc[] = "The module is a wrapper over C++ monitors. It guarantees that C++ and Python " 144 | "monitors are consistent."; 145 | 146 | PyType_Slot presenterSlots[] = { 147 | {Py_tp_dealloc, reinterpret_cast(presenter_dealloc)}, 148 | {Py_tp_doc, monitors_extension_doc}, 149 | {Py_tp_methods, presenter_methods}, 150 | {Py_tp_getset, presenter_getsetters}, 151 | {Py_tp_init, reinterpret_cast(presenter_init)}, 152 | {Py_tp_new, reinterpret_cast(PyType_GenericNew)}, 153 | {}}; // Sentinel 154 | 155 | PyType_Spec presenterSpec{"monitors_extension.Presenter", sizeof(PresenterObject), 0, 0, presenterSlots}; 156 | 157 | PyModuleDef monitors_extension{PyModuleDef_HEAD_INIT, "monitors_extension", monitors_extension_doc, 0}; 158 | } 159 | 160 | PyMODINIT_FUNC PyInit_monitors_extension() { 161 | import_array(); 162 | if (PyErr_Occurred()) return nullptr; 163 | 164 | PyObject *presenterType = PyType_FromSpec(&presenterSpec); 165 | if (!presenterType) return nullptr; 166 | 167 | PyObject *m = PyModule_Create(&monitors_extension); 168 | if (m == nullptr) { 169 | Py_DECREF(presenterType); 170 | return nullptr; 171 | } 172 | 173 | if (PyModule_AddObject(m, "Presenter", presenterType) < 0) { 174 | Py_DECREF(presenterType); 175 | Py_DECREF(m); 176 | return nullptr; 177 | } 178 | return m; 179 | } 180 | -------------------------------------------------------------------------------- /pythondemo/2021.1/performance_metrics.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (C) 2020 Intel Corporation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | from time import perf_counter 18 | import cv2 19 | from helpers import put_highlighted_text 20 | 21 | 22 | class Statistic: 23 | def __init__(self): 24 | self.latency = 0.0 25 | self.period = 0.0 26 | self.frame_count = 0 27 | 28 | def combine(self, other): 29 | self.latency += other.latency 30 | self.period += other.period 31 | self.frame_count += other.frame_count 32 | 33 | 34 | class PerformanceMetrics: 35 | def __init__(self, time_window=1.0): 36 | # 'time_window' defines the length of the timespan over which the 'current fps' value is calculated 37 | self.time_window_size = time_window 38 | self.last_moving_statistic = Statistic() 39 | self.current_moving_statistic = Statistic() 40 | self.total_statistic = Statistic() 41 | self.last_update_time = None 42 | 43 | def update(self, last_request_start_time, frame, position=(15, 30), 44 | font_scale=0.75, color=(200, 10, 10), thickness=2): 45 | current_time = perf_counter() 46 | 47 | if self.last_update_time is None: 48 | self.last_update_time = current_time 49 | return 50 | 51 | self.current_moving_statistic.latency += current_time - last_request_start_time 52 | self.current_moving_statistic.period = current_time - self.last_update_time 53 | self.current_moving_statistic.frame_count += 1 54 | 55 | if current_time - self.last_update_time > self.time_window_size: 56 | self.last_moving_statistic = self.current_moving_statistic 57 | self.total_statistic.combine(self.last_moving_statistic) 58 | self.current_moving_statistic = Statistic() 59 | 60 | self.last_update_time = current_time 61 | 62 | # Draw performance stats over frame 63 | current_latency, current_fps = self.get_last() 64 | if current_latency is not None: 65 | put_highlighted_text(frame, "Latency: {:.1f} ms".format(current_latency * 1e3), 66 | position, cv2.FONT_HERSHEY_COMPLEX, font_scale, color, thickness) 67 | if current_fps is not None: 68 | put_highlighted_text(frame, "FPS: {:.1f}".format(current_fps), 69 | (position[0], position[1]+30), cv2.FONT_HERSHEY_COMPLEX, font_scale, color, thickness) 70 | 71 | def get_last(self): 72 | return (self.last_moving_statistic.latency / self.last_moving_statistic.frame_count 73 | if self.last_moving_statistic.frame_count != 0 74 | else None, 75 | self.last_moving_statistic.frame_count / self.last_moving_statistic.period 76 | if self.last_moving_statistic.period != 0.0 77 | else None) 78 | 79 | def get_total(self): 80 | frame_count = self.total_statistic.frame_count + self.current_moving_statistic.frame_count 81 | return (((self.total_statistic.latency + self.current_moving_statistic.latency) / frame_count) 82 | if frame_count != 0 83 | else None, 84 | (frame_count / (self.total_statistic.period + self.current_moving_statistic.period)) 85 | if frame_count != 0 86 | else None) 87 | 88 | def print_total(self): 89 | total_latency, total_fps = self.get_total() 90 | print("Latency: {:.1f} ms".format(total_latency * 1e3) if total_latency is not None else "Latency: N/A") 91 | print("FPS: {:.1f}".format(total_fps) if total_fps is not None else "FPS: N/A") 92 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | from PIL import ImageDraw, Image 6 | 7 | 8 | def get_boxes_and_inputs_pb(frozen_graph): 9 | 10 | with frozen_graph.as_default(): 11 | boxes = tf.get_default_graph().get_tensor_by_name("output_boxes:0") 12 | inputs = tf.get_default_graph().get_tensor_by_name("inputs:0") 13 | 14 | return boxes, inputs 15 | 16 | 17 | def get_boxes_and_inputs(model, num_classes, size, data_format): 18 | 19 | inputs = tf.placeholder(tf.float32, [1, size, size, 3]) 20 | 21 | with tf.variable_scope('detector'): 22 | detections = model(inputs, num_classes, 23 | data_format=data_format) 24 | 25 | boxes = detections_boxes(detections) 26 | 27 | return boxes, inputs 28 | 29 | 30 | def load_graph(frozen_graph_filename): 31 | 32 | with tf.gfile.GFile(frozen_graph_filename, "rb") as f: 33 | graph_def = tf.GraphDef() 34 | graph_def.ParseFromString(f.read()) 35 | 36 | with tf.Graph().as_default() as graph: 37 | tf.import_graph_def(graph_def, name="") 38 | 39 | return graph 40 | 41 | 42 | def freeze_graph(sess, output_graph): 43 | 44 | output_node_names = [ 45 | "output_boxes", 46 | "inputs", 47 | ] 48 | output_node_names = ",".join(output_node_names) 49 | 50 | output_graph_def = tf.graph_util.convert_variables_to_constants( 51 | sess, 52 | tf.get_default_graph().as_graph_def(), 53 | output_node_names.split(",") 54 | ) 55 | 56 | with tf.gfile.GFile(output_graph, "wb") as f: 57 | f.write(output_graph_def.SerializeToString()) 58 | 59 | print("{} ops written to {}.".format(len(output_graph_def.node), output_graph)) 60 | 61 | 62 | def load_weights(var_list, weights_file): 63 | """ 64 | Loads and converts pre-trained weights. 65 | :param var_list: list of network variables. 66 | :param weights_file: name of the binary file. 67 | :return: list of assign ops 68 | """ 69 | with open(weights_file, "rb") as fp: 70 | _ = np.fromfile(fp, dtype=np.int32, count=5) 71 | 72 | weights = np.fromfile(fp, dtype=np.float32) 73 | 74 | ptr = 0 75 | i = 0 76 | assign_ops = [] 77 | while i < len(var_list) - 1: 78 | var1 = var_list[i] 79 | var2 = var_list[i + 1] 80 | # do something only if we process conv layer 81 | if 'Conv' in var1.name.split('/')[-2]: 82 | # check type of next layer 83 | if 'BatchNorm' in var2.name.split('/')[-2]: 84 | # load batch norm params 85 | gamma, beta, mean, var = var_list[i + 1:i + 5] 86 | batch_norm_vars = [beta, gamma, mean, var] 87 | for var in batch_norm_vars: 88 | shape = var.shape.as_list() 89 | num_params = np.prod(shape) 90 | var_weights = weights[ptr:ptr + num_params].reshape(shape) 91 | ptr += num_params 92 | assign_ops.append( 93 | tf.assign(var, var_weights, validate_shape=True)) 94 | 95 | # we move the pointer by 4, because we loaded 4 variables 96 | i += 4 97 | elif 'Conv' in var2.name.split('/')[-2]: 98 | # load biases 99 | bias = var2 100 | bias_shape = bias.shape.as_list() 101 | bias_params = np.prod(bias_shape) 102 | bias_weights = weights[ptr:ptr + 103 | bias_params].reshape(bias_shape) 104 | ptr += bias_params 105 | assign_ops.append( 106 | tf.assign(bias, bias_weights, validate_shape=True)) 107 | 108 | # we loaded 1 variable 109 | i += 1 110 | # we can load weights of conv layer 111 | shape = var1.shape.as_list() 112 | num_params = np.prod(shape) 113 | 114 | var_weights = weights[ptr:ptr + num_params].reshape( 115 | (shape[3], shape[2], shape[0], shape[1])) 116 | # remember to transpose to column-major 117 | var_weights = np.transpose(var_weights, (2, 3, 1, 0)) 118 | ptr += num_params 119 | assign_ops.append( 120 | tf.assign(var1, var_weights, validate_shape=True)) 121 | i += 1 122 | 123 | return assign_ops 124 | 125 | 126 | def detections_boxes(detections): 127 | """ 128 | Converts center x, center y, width and height values to coordinates of top left and bottom right points. 129 | 130 | :param detections: outputs of YOLO v3 detector of shape (?, 10647, (num_classes + 5)) 131 | :return: converted detections of same shape as input 132 | """ 133 | center_x, center_y, width, height, attrs = tf.split( 134 | detections, [1, 1, 1, 1, -1], axis=-1) 135 | w2 = width / 2 136 | h2 = height / 2 137 | x0 = center_x - w2 138 | y0 = center_y - h2 139 | x1 = center_x + w2 140 | y1 = center_y + h2 141 | 142 | boxes = tf.concat([x0, y0, x1, y1], axis=-1) 143 | detections = tf.concat([boxes, attrs], axis=-1, name="output_boxes") 144 | return detections 145 | 146 | 147 | def _iou(box1, box2): 148 | """ 149 | Computes Intersection over Union value for 2 bounding boxes 150 | 151 | :param box1: array of 4 values (top left and bottom right coords): [x0, y0, x1, x2] 152 | :param box2: same as box1 153 | :return: IoU 154 | """ 155 | b1_x0, b1_y0, b1_x1, b1_y1 = box1 156 | b2_x0, b2_y0, b2_x1, b2_y1 = box2 157 | 158 | int_x0 = max(b1_x0, b2_x0) 159 | int_y0 = max(b1_y0, b2_y0) 160 | int_x1 = min(b1_x1, b2_x1) 161 | int_y1 = min(b1_y1, b2_y1) 162 | 163 | int_area = max(int_x1 - int_x0, 0) * max(int_y1 - int_y0, 0) 164 | 165 | b1_area = (b1_x1 - b1_x0) * (b1_y1 - b1_y0) 166 | b2_area = (b2_x1 - b2_x0) * (b2_y1 - b2_y0) 167 | 168 | # we add small epsilon of 1e-05 to avoid division by 0 169 | iou = int_area / (b1_area + b2_area - int_area + 1e-05) 170 | return iou 171 | 172 | 173 | def non_max_suppression(predictions_with_boxes, confidence_threshold, iou_threshold=0.4): 174 | """ 175 | Applies Non-max suppression to prediction boxes. 176 | 177 | :param predictions_with_boxes: 3D numpy array, first 4 values in 3rd dimension are bbox attrs, 5th is confidence 178 | :param confidence_threshold: the threshold for deciding if prediction is valid 179 | :param iou_threshold: the threshold for deciding if two boxes overlap 180 | :return: dict: class -> [(box, score)] 181 | """ 182 | conf_mask = np.expand_dims( 183 | (predictions_with_boxes[:, :, 4] > confidence_threshold), -1) 184 | predictions = predictions_with_boxes * conf_mask 185 | 186 | result = {} 187 | for i, image_pred in enumerate(predictions): 188 | shape = image_pred.shape 189 | non_zero_idxs = np.nonzero(image_pred) 190 | image_pred = image_pred[non_zero_idxs] 191 | image_pred = image_pred.reshape(-1, shape[-1]) 192 | 193 | bbox_attrs = image_pred[:, :5] 194 | classes = image_pred[:, 5:] 195 | classes = np.argmax(classes, axis=-1) 196 | 197 | unique_classes = list(set(classes.reshape(-1))) 198 | 199 | for cls in unique_classes: 200 | cls_mask = classes == cls 201 | cls_boxes = bbox_attrs[np.nonzero(cls_mask)] 202 | cls_boxes = cls_boxes[cls_boxes[:, -1].argsort()[::-1]] 203 | cls_scores = cls_boxes[:, -1] 204 | cls_boxes = cls_boxes[:, :-1] 205 | 206 | while len(cls_boxes) > 0: 207 | box = cls_boxes[0] 208 | score = cls_scores[0] 209 | if cls not in result: 210 | result[cls] = [] 211 | result[cls].append((box, score)) 212 | cls_boxes = cls_boxes[1:] 213 | cls_scores = cls_scores[1:] 214 | ious = np.array([_iou(box, x) for x in cls_boxes]) 215 | iou_mask = ious < iou_threshold 216 | cls_boxes = cls_boxes[np.nonzero(iou_mask)] 217 | cls_scores = cls_scores[np.nonzero(iou_mask)] 218 | 219 | return result 220 | 221 | 222 | def load_coco_names(file_name): 223 | names = {} 224 | with open(file_name) as f: 225 | for id, name in enumerate(f): 226 | names[id] = name 227 | return names 228 | 229 | 230 | def draw_boxes(boxes, img, cls_names, detection_size, is_letter_box_image): 231 | draw = ImageDraw.Draw(img) 232 | 233 | for cls, bboxs in boxes.items(): 234 | color = tuple(np.random.randint(0, 256, 3)) 235 | for box, score in bboxs: 236 | box = convert_to_original_size(box, np.array(detection_size), 237 | np.array(img.size), 238 | is_letter_box_image) 239 | draw.rectangle(box, outline=color) 240 | draw.text(box[:2], '{} {:.2f}%'.format( 241 | cls_names[cls], score * 100), fill=color) 242 | 243 | 244 | def convert_to_original_size(box, size, original_size, is_letter_box_image): 245 | if is_letter_box_image: 246 | box = box.reshape(2, 2) 247 | box[0, :] = letter_box_pos_to_original_pos(box[0, :], size, original_size) 248 | box[1, :] = letter_box_pos_to_original_pos(box[1, :], size, original_size) 249 | else: 250 | ratio = original_size / size 251 | box = box.reshape(2, 2) * ratio 252 | return list(box.reshape(-1)) 253 | 254 | 255 | def letter_box_image(image: Image.Image, output_height: int, output_width: int, fill_value)-> np.ndarray: 256 | """ 257 | Fit image with final image with output_width and output_height. 258 | :param image: PILLOW Image object. 259 | :param output_height: width of the final image. 260 | :param output_width: height of the final image. 261 | :param fill_value: fill value for empty area. Can be uint8 or np.ndarray 262 | :return: numpy image fit within letterbox. dtype=uint8, shape=(output_height, output_width) 263 | """ 264 | 265 | height_ratio = float(output_height)/image.size[1] 266 | width_ratio = float(output_width)/image.size[0] 267 | fit_ratio = min(width_ratio, height_ratio) 268 | fit_height = int(image.size[1] * fit_ratio) 269 | fit_width = int(image.size[0] * fit_ratio) 270 | fit_image = np.asarray(image.resize((fit_width, fit_height), resample=Image.BILINEAR)) 271 | 272 | if isinstance(fill_value, int): 273 | fill_value = np.full(fit_image.shape[2], fill_value, fit_image.dtype) 274 | 275 | to_return = np.tile(fill_value, (output_height, output_width, 1)) 276 | pad_top = int(0.5 * (output_height - fit_height)) 277 | pad_left = int(0.5 * (output_width - fit_width)) 278 | to_return[pad_top:pad_top+fit_height, pad_left:pad_left+fit_width] = fit_image 279 | return to_return 280 | 281 | 282 | def letter_box_pos_to_original_pos(letter_pos, current_size, ori_image_size)-> np.ndarray: 283 | """ 284 | Parameters should have same shape and dimension space. (Width, Height) or (Height, Width) 285 | :param letter_pos: The current position within letterbox image including fill value area. 286 | :param current_size: The size of whole image including fill value area. 287 | :param ori_image_size: The size of image before being letter boxed. 288 | :return: 289 | """ 290 | letter_pos = np.asarray(letter_pos, dtype=np.float) 291 | current_size = np.asarray(current_size, dtype=np.float) 292 | ori_image_size = np.asarray(ori_image_size, dtype=np.float) 293 | final_ratio = min(current_size[0]/ori_image_size[0], current_size[1]/ori_image_size[1]) 294 | pad = 0.5 * (current_size - final_ratio * ori_image_size) 295 | pad = pad.astype(np.int32) 296 | to_return_pos = (letter_pos - pad) / final_ratio 297 | return to_return_pos 298 | -------------------------------------------------------------------------------- /yolo_v4.py: -------------------------------------------------------------------------------- 1 | 2 | import numpy as np 3 | import tensorflow as tf 4 | 5 | slim = tf.contrib.slim 6 | 7 | _BATCH_NORM_DECAY = 0.9 8 | _BATCH_NORM_EPSILON = 1e-05 9 | _LEAKY_RELU = 0.1 10 | 11 | _ANCHORS = [(12, 16), (19, 36), (40, 28), 12 | (36, 75), (76, 55), (72, 146), 13 | (142, 110), (192, 243), (459, 401)] 14 | @tf.contrib.framework.add_arg_scope 15 | def _fixed_padding(inputs, kernel_size, *args, mode='CONSTANT', **kwargs): 16 | """ 17 | Pads the input along the spatial dimensions independently of input size. 18 | 19 | Args: 20 | inputs: A tensor of size [batch, channels, height_in, width_in] or 21 | [batch, height_in, width_in, channels] depending on data_format. 22 | kernel_size: The kernel to be used in the conv2d or max_pool2d operation. 23 | Should be a positive integer. 24 | data_format: The input format ('NHWC' or 'NCHW'). 25 | mode: The mode for tf.pad. 26 | 27 | Returns: 28 | A tensor with the same format as the input with the data either intact 29 | (if kernel_size == 1) or padded (if kernel_size > 1). 30 | """ 31 | pad_total = kernel_size - 1 32 | pad_beg = pad_total // 2 33 | pad_end = pad_total - pad_beg 34 | 35 | if kwargs['data_format'] == 'NCHW': 36 | padded_inputs = tf.pad(inputs, [[0, 0], [0, 0], 37 | [pad_beg, pad_end], 38 | [pad_beg, pad_end]], 39 | mode=mode) 40 | else: 41 | padded_inputs = tf.pad(inputs, [[0, 0], [pad_beg, pad_end], 42 | [pad_beg, pad_end], [0, 0]], mode=mode) 43 | return padded_inputs 44 | 45 | 46 | 47 | def _conv2d_fixed_padding(inputs, filters, kernel_size, strides=1): 48 | if strides > 1: 49 | inputs = _fixed_padding(inputs, kernel_size) 50 | inputs = slim.conv2d(inputs, filters, kernel_size, stride=strides, 51 | padding=('SAME' if strides == 1 else 'VALID')) 52 | return inputs 53 | 54 | 55 | def _yolo_res_Block(inputs,in_channels,res_num,data_format,double_ch=False): 56 | out_channels = in_channels 57 | if double_ch: 58 | out_channels = in_channels * 2 59 | net = _conv2d_fixed_padding(inputs,in_channels*2,kernel_size=3,strides=2) 60 | route = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 61 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 62 | 63 | for _ in range(res_num): 64 | tmp=net 65 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=1) 66 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=3) 67 | #shortcut 68 | net = tmp+net 69 | 70 | net=_conv2d_fixed_padding(net,out_channels,kernel_size=1) 71 | 72 | #concat 73 | net=tf.concat([net,route],axis=1 if data_format == 'NCHW' else 3) 74 | net=_conv2d_fixed_padding(net,in_channels*2,kernel_size=1) 75 | return net 76 | 77 | def _yolo_conv_block(net,in_channels,a,b): 78 | for _ in range(a): 79 | out_channels=in_channels/2 80 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 81 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=3) 82 | 83 | out_channels=in_channels 84 | for _ in range(b): 85 | out_channels=out_channels/2 86 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 87 | 88 | return net 89 | 90 | 91 | def _spp_block(inputs, data_format='NCHW'): 92 | return tf.concat([slim.max_pool2d(inputs, 13, 1, 'SAME'), 93 | slim.max_pool2d(inputs, 9, 1, 'SAME'), 94 | slim.max_pool2d(inputs, 5, 1, 'SAME'), 95 | inputs], 96 | axis=1 if data_format == 'NCHW' else 3) 97 | 98 | 99 | def _upsample(inputs, out_shape, data_format='NCHW'): 100 | # tf.image.resize_nearest_neighbor accepts input in format NHWC 101 | if data_format == 'NCHW': 102 | inputs = tf.transpose(inputs, [0, 2, 3, 1]) 103 | 104 | if data_format == 'NCHW': 105 | new_height = out_shape[2] 106 | new_width = out_shape[3] 107 | else: 108 | new_height = out_shape[1] 109 | new_width = out_shape[2] 110 | 111 | inputs = tf.image.resize_nearest_neighbor(inputs, (new_height, new_width)) 112 | 113 | # back to NCHW if needed 114 | if data_format == 'NCHW': 115 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 116 | 117 | inputs = tf.identity(inputs, name='upsampled') 118 | return inputs 119 | 120 | 121 | def csp_darknet53(inputs,data_format,batch_norm_params): 122 | """ 123 | Builds CSPDarknet-53 model.activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU) 124 | """ 125 | with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm, 126 | normalizer_params=batch_norm_params, 127 | biases_initializer=None, 128 | activation_fn=lambda x:x* tf.math.tanh(tf.math.softplus(x))): 129 | net = _conv2d_fixed_padding(inputs,32,kernel_size=3) 130 | #downsample 131 | #res1 132 | net=_yolo_res_Block(net,32,1,data_format,double_ch=True) 133 | #res2 134 | net = _yolo_res_Block(net,64,2,data_format) 135 | #res8 136 | net = _yolo_res_Block(net,128,8,data_format) 137 | 138 | #features of 54 layer 139 | up_route_54=net 140 | #res8 141 | net = _yolo_res_Block(net,256,8,data_format) 142 | #featyres of 85 layer 143 | up_route_85=net 144 | #res4 145 | net=_yolo_res_Block(net,512,4,data_format) 146 | 147 | with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm, 148 | normalizer_params=batch_norm_params, 149 | biases_initializer=None, 150 | activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU)): 151 | ######## 152 | net = _yolo_conv_block(net,1024,1,1) 153 | 154 | net=_spp_block(net,data_format=data_format) 155 | 156 | net=_conv2d_fixed_padding(net,512,kernel_size=1) 157 | net = _conv2d_fixed_padding(net, 1024, kernel_size=3) 158 | net = _conv2d_fixed_padding(net, 512, kernel_size=1) 159 | 160 | #features of 116 layer 161 | route_3=net 162 | 163 | net = _conv2d_fixed_padding(net,256,kernel_size=1) 164 | upsample_size = up_route_85.get_shape().as_list() 165 | net = _upsample(net, upsample_size, data_format) 166 | route= _conv2d_fixed_padding(up_route_85,256,kernel_size=1) 167 | 168 | net = tf.concat([route,net], axis=1 if data_format == 'NCHW' else 3) 169 | net = _yolo_conv_block(net,512,2,1) 170 | #features of 126 layer 171 | route_2=net 172 | 173 | net = _conv2d_fixed_padding(net,128,kernel_size=1) 174 | upsample_size = up_route_54.get_shape().as_list() 175 | net = _upsample(net, upsample_size, data_format) 176 | route= _conv2d_fixed_padding(up_route_54,128,kernel_size=1) 177 | net = tf.concat([route,net], axis=1 if data_format == 'NCHW' else 3) 178 | net = _yolo_conv_block(net,256,2,1) 179 | #features of 136 layer 180 | route_1 = net 181 | 182 | return route_1, route_2, route_3 183 | 184 | def _get_size(shape, data_format): 185 | if len(shape) == 4: 186 | shape = shape[1:] 187 | return shape[1:3] if data_format == 'NCHW' else shape[0:2] 188 | 189 | 190 | def _detection_layer(inputs, num_classes, anchors, img_size, data_format): 191 | num_anchors = len(anchors) 192 | predictions = slim.conv2d(inputs, num_anchors * (5 + num_classes), 1, 193 | stride=1, normalizer_fn=None, 194 | activation_fn=None, 195 | biases_initializer=tf.zeros_initializer()) 196 | 197 | shape = predictions.get_shape().as_list() 198 | grid_size = _get_size(shape, data_format) 199 | dim = grid_size[0] * grid_size[1] 200 | bbox_attrs = 5 + num_classes 201 | 202 | if data_format == 'NCHW': 203 | predictions = tf.reshape( 204 | predictions, [-1, num_anchors * bbox_attrs, dim]) 205 | predictions = tf.transpose(predictions, [0, 2, 1]) 206 | 207 | predictions = tf.reshape(predictions, [-1, num_anchors * dim, bbox_attrs]) 208 | 209 | stride = (img_size[0] // grid_size[0], img_size[1] // grid_size[1]) 210 | 211 | anchors = [(a[0] / stride[0], a[1] / stride[1]) for a in anchors] 212 | 213 | box_centers, box_sizes, confidence, classes = tf.split( 214 | predictions, [2, 2, 1, num_classes], axis=-1) 215 | 216 | box_centers = tf.nn.sigmoid(box_centers) 217 | confidence = tf.nn.sigmoid(confidence) 218 | 219 | grid_x = tf.range(grid_size[0], dtype=tf.float32) 220 | grid_y = tf.range(grid_size[1], dtype=tf.float32) 221 | a, b = tf.meshgrid(grid_x, grid_y) 222 | 223 | x_offset = tf.reshape(a, (-1, 1)) 224 | y_offset = tf.reshape(b, (-1, 1)) 225 | 226 | x_y_offset = tf.concat([x_offset, y_offset], axis=-1) 227 | x_y_offset = tf.reshape(tf.tile(x_y_offset, [1, num_anchors]), [1, -1, 2]) 228 | 229 | box_centers = box_centers + x_y_offset 230 | box_centers = box_centers * stride 231 | 232 | anchors = tf.tile(anchors, [dim, 1]) 233 | box_sizes = tf.exp(box_sizes) * anchors 234 | box_sizes = box_sizes * stride 235 | 236 | detections = tf.concat([box_centers, box_sizes, confidence], axis=-1) 237 | 238 | classes = tf.nn.sigmoid(classes) 239 | predictions = tf.concat([detections, classes], axis=-1) 240 | return predictions 241 | 242 | 243 | 244 | 245 | def yolo_v4(inputs, num_classes, is_training=False, data_format='NCHW', reuse=False): 246 | """ 247 | Creates YOLO v4 model. 248 | 249 | :param inputs: a 4-D tensor of size [batch_size, height, width, channels]. 250 | Dimension batch_size may be undefined. The channel order is RGB. 251 | :param num_classes: number of predicted classes. 252 | :param is_training: whether is training or not. 253 | :param data_format: data format NCHW or NHWC. 254 | :param reuse: whether or not the network and its variables should be reused. 255 | :param with_spp: whether or not is using spp layer. 256 | :return: 257 | """ 258 | 259 | # it will be needed later on 260 | img_size = inputs.get_shape().as_list()[1:3] 261 | 262 | # transpose the inputs to NCHW 263 | if data_format == 'NCHW': 264 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 265 | 266 | # normalize values to range [0..1] 267 | inputs = inputs / 255 268 | 269 | # set batch norm params 270 | batch_norm_params = { 271 | 'decay': _BATCH_NORM_DECAY, 272 | 'epsilon': _BATCH_NORM_EPSILON, 273 | 'scale': True, 274 | 'is_training': is_training, 275 | 'fused': None, # Use fused batch norm if possible. 276 | } 277 | 278 | # Set activation_fn and parameters for conv2d, batch_norm. 279 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding], data_format=data_format, reuse=reuse): 280 | 281 | #weights_regularizer=slim.l2_regularizer(weight_decay) 282 | #weights_initializer=tf.truncated_normal_initializer(0.0, 0.01) 283 | with tf.variable_scope('cspdarknet-53'): 284 | route_1, route_2, route_3 = csp_darknet53(inputs,data_format,batch_norm_params) 285 | 286 | with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm, 287 | normalizer_params=batch_norm_params, 288 | biases_initializer=None, 289 | activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU)): 290 | with tf.variable_scope('yolo-v4'): 291 | #features of y1 292 | net = _conv2d_fixed_padding(route_1,256,kernel_size=3) 293 | detect_1 = _detection_layer( 294 | net, num_classes, _ANCHORS[0:3], img_size, data_format) 295 | detect_1 = tf.identity(detect_1, name='detect_1') 296 | 297 | #features of y2 298 | net = _conv2d_fixed_padding(route_1, 256, kernel_size=3,strides=2) 299 | net=tf.concat([net,route_2], axis=1 if data_format == 'NCHW' else 3) 300 | net=_yolo_conv_block(net,512,2,1) 301 | route_147 =net 302 | net = _conv2d_fixed_padding(net,512,kernel_size=3) 303 | detect_2 = _detection_layer( 304 | net, num_classes, _ANCHORS[3:6], img_size, data_format) 305 | detect_2 = tf.identity(detect_2, name='detect_2') 306 | 307 | # features of y3 308 | net=_conv2d_fixed_padding(route_147,512,strides=2,kernel_size=3) 309 | net = tf.concat([net, route_3], axis=1 if data_format == 'NCHW' else 3) 310 | net = _yolo_conv_block(net,1024,3,0) 311 | detect_3 = _detection_layer( 312 | net, num_classes, _ANCHORS[6:9], img_size, data_format) 313 | detect_3 = tf.identity(detect_3, name='detect_3') 314 | 315 | detections = tf.concat([detect_1, detect_2, detect_3], axis=1) 316 | detections = tf.identity(detections, name='detections') 317 | return detections 318 | 319 | -------------------------------------------------------------------------------- /yolo_v4_tiny.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "TFYOLOV3", 4 | "match_kind": "general", 5 | "custom_attributes": { 6 | "classes": 80, 7 | "anchors": [10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319], 8 | "coords": 4, 9 | "num": 6, 10 | "masks": [[3, 4, 5], [1, 2, 3]], 11 | "entry_points": ["detector/yolo-v4-tiny/Reshape", "detector/yolo-v4-tiny/Reshape_4"] 12 | } 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /yolo_v4_tiny.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | from yolo_v4 import _conv2d_fixed_padding, _fixed_padding, _get_size, \ 6 | _detection_layer, _upsample 7 | 8 | slim = tf.contrib.slim 9 | 10 | _BATCH_NORM_DECAY = 0.9 11 | _BATCH_NORM_EPSILON = 1e-05 12 | _LEAKY_RELU = 0.1 13 | 14 | _ANCHORS = [(10, 14), (23, 27), (37, 58), 15 | (81, 82), (135, 169), (344, 319)] 16 | 17 | def _tiny_res_block(inputs,in_channels,data_format): 18 | net = _conv2d_fixed_padding(inputs,in_channels,kernel_size=3) 19 | 20 | route = net 21 | #_,split=tf.split(net,num_or_size_splits=2,axis=1 if data_format =="NCHW" else 3) 22 | split = net[:, in_channels//2:, :, :]if data_format=="NCHW" else net[:, :, :, in_channels//2:] 23 | net = _conv2d_fixed_padding(split,in_channels//2,kernel_size=3) 24 | route1 = net 25 | net = _conv2d_fixed_padding(net,in_channels//2,kernel_size=3) 26 | net = tf.concat([net, route1], axis=1 if data_format == 'NCHW' else 3) 27 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=1) 28 | feat = net 29 | net = tf.concat([route, net], axis=1 if data_format == 'NCHW' else 3) 30 | net = slim.max_pool2d( 31 | net, [2, 2], scope='pool2') 32 | return net,feat 33 | 34 | 35 | 36 | 37 | def yolo_v4_tiny(inputs, num_classes, is_training=False, data_format='NCHW', reuse=False): 38 | """ 39 | Creates YOLO v4 tiny model. 40 | 41 | :param inputs: a 4-D tensor of size [batch_size, height, width, channels]. 42 | Dimension batch_size may be undefined. The channel order is RGB. 43 | :param num_classes: number of predicted classes. 44 | :param is_training: whether is training or not. 45 | :param data_format: data format NCHW or NHWC. 46 | :param reuse: whether or not the network and its variables should be reused. 47 | :return: 48 | """ 49 | # it will be needed later on 50 | img_size = inputs.get_shape().as_list()[1:3] 51 | 52 | # transpose the inputs to NCHW 53 | if data_format == 'NCHW': 54 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 55 | 56 | # normalize values to range [0..1] 57 | inputs = inputs / 255 58 | 59 | # set batch norm params 60 | batch_norm_params = { 61 | 'decay': _BATCH_NORM_DECAY, 62 | 'epsilon': _BATCH_NORM_EPSILON, 63 | 'scale': True, 64 | 'is_training': is_training, 65 | 'fused': None, # Use fused batch norm if possible. 66 | } 67 | 68 | # Set activation_fn and parameters for conv2d, batch_norm. 69 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding, slim.max_pool2d], data_format=data_format): 70 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding], reuse=reuse): 71 | with slim.arg_scope([slim.conv2d], 72 | normalizer_fn=slim.batch_norm, 73 | normalizer_params=batch_norm_params, 74 | biases_initializer=None, 75 | activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU)): 76 | 77 | with tf.variable_scope('yolo-v4-tiny'): 78 | #CSPDARKENT BEGIN 79 | net = _conv2d_fixed_padding(inputs,32,kernel_size=3,strides=2) 80 | 81 | net = _conv2d_fixed_padding(net, 64, kernel_size=3,strides=2) 82 | 83 | net,_ = _tiny_res_block(net,64,data_format) 84 | net,_ = _tiny_res_block(net,128,data_format) 85 | net,feat = _tiny_res_block(net,256,data_format) 86 | net = _conv2d_fixed_padding(net,512,kernel_size=3) 87 | feat2=net 88 | #CSPDARKNET END 89 | 90 | net=_conv2d_fixed_padding(feat2,256,kernel_size=1) 91 | route = net 92 | net = _conv2d_fixed_padding(route,512,kernel_size=3) 93 | detect_1 = _detection_layer( 94 | net, num_classes, _ANCHORS[3:6], img_size, data_format) 95 | detect_1 = tf.identity(detect_1, name='detect_1') 96 | net = _conv2d_fixed_padding(route,128,kernel_size=1) 97 | upsample_size = feat.get_shape().as_list() 98 | net = _upsample(net, upsample_size, data_format) 99 | net = tf.concat([net,feat], axis=1 if data_format == 'NCHW' else 3) 100 | net = _conv2d_fixed_padding(net,256,kernel_size=3) 101 | detect_2 = _detection_layer( 102 | net, num_classes, _ANCHORS[1:4], img_size, data_format) 103 | detect_2 = tf.identity(detect_2, name='detect_2') 104 | 105 | 106 | detections = tf.concat([detect_1, detect_2], axis=1) 107 | detections = tf.identity(detections, name='detections') 108 | 109 | return detections 110 | -------------------------------------------------------------------------------- /yolov4-relu/cfg/coco.names: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorcycle 5 | airplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | couch 59 | potted plant 60 | bed 61 | dining table 62 | toilet 63 | tv 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /yolov4-relu/cfg/yolov4-tiny.cfg: -------------------------------------------------------------------------------- 1 | [net] 2 | # Testing 3 | #batch=1 4 | #subdivisions=1 5 | # Training 6 | batch=64 7 | subdivisions=1 8 | width=416 9 | height=416 10 | channels=3 11 | momentum=0.9 12 | decay=0.0005 13 | angle=0 14 | saturation = 1.5 15 | exposure = 1.5 16 | hue=.1 17 | 18 | learning_rate=0.00261 19 | burn_in=1000 20 | max_batches = 500200 21 | policy=steps 22 | steps=400000,450000 23 | scales=.1,.1 24 | 25 | [convolutional] 26 | batch_normalize=1 27 | filters=32 28 | size=3 29 | stride=2 30 | pad=1 31 | activation=leaky 32 | 33 | [convolutional] 34 | batch_normalize=1 35 | filters=64 36 | size=3 37 | stride=2 38 | pad=1 39 | activation=leaky 40 | 41 | [convolutional] 42 | batch_normalize=1 43 | filters=64 44 | size=3 45 | stride=1 46 | pad=1 47 | activation=leaky 48 | 49 | [route] 50 | layers=-1 51 | groups=2 52 | group_id=1 53 | 54 | [convolutional] 55 | batch_normalize=1 56 | filters=32 57 | size=3 58 | stride=1 59 | pad=1 60 | activation=leaky 61 | 62 | [convolutional] 63 | batch_normalize=1 64 | filters=32 65 | size=3 66 | stride=1 67 | pad=1 68 | activation=leaky 69 | 70 | [route] 71 | layers = -1,-2 72 | 73 | [convolutional] 74 | batch_normalize=1 75 | filters=64 76 | size=1 77 | stride=1 78 | pad=1 79 | activation=leaky 80 | 81 | [route] 82 | layers = -6,-1 83 | 84 | [maxpool] 85 | size=2 86 | stride=2 87 | 88 | [convolutional] 89 | batch_normalize=1 90 | filters=128 91 | size=3 92 | stride=1 93 | pad=1 94 | activation=leaky 95 | 96 | [route] 97 | layers=-1 98 | groups=2 99 | group_id=1 100 | 101 | [convolutional] 102 | batch_normalize=1 103 | filters=64 104 | size=3 105 | stride=1 106 | pad=1 107 | activation=leaky 108 | 109 | [convolutional] 110 | batch_normalize=1 111 | filters=64 112 | size=3 113 | stride=1 114 | pad=1 115 | activation=leaky 116 | 117 | [route] 118 | layers = -1,-2 119 | 120 | [convolutional] 121 | batch_normalize=1 122 | filters=128 123 | size=1 124 | stride=1 125 | pad=1 126 | activation=leaky 127 | 128 | [route] 129 | layers = -6,-1 130 | 131 | [maxpool] 132 | size=2 133 | stride=2 134 | 135 | [convolutional] 136 | batch_normalize=1 137 | filters=256 138 | size=3 139 | stride=1 140 | pad=1 141 | activation=leaky 142 | 143 | [route] 144 | layers=-1 145 | groups=2 146 | group_id=1 147 | 148 | [convolutional] 149 | batch_normalize=1 150 | filters=128 151 | size=3 152 | stride=1 153 | pad=1 154 | activation=leaky 155 | 156 | [convolutional] 157 | batch_normalize=1 158 | filters=128 159 | size=3 160 | stride=1 161 | pad=1 162 | activation=leaky 163 | 164 | [route] 165 | layers = -1,-2 166 | 167 | [convolutional] 168 | batch_normalize=1 169 | filters=256 170 | size=1 171 | stride=1 172 | pad=1 173 | activation=leaky 174 | 175 | [route] 176 | layers = -6,-1 177 | 178 | [maxpool] 179 | size=2 180 | stride=2 181 | 182 | [convolutional] 183 | batch_normalize=1 184 | filters=512 185 | size=3 186 | stride=1 187 | pad=1 188 | activation=leaky 189 | 190 | ################################## 191 | 192 | [convolutional] 193 | batch_normalize=1 194 | filters=256 195 | size=1 196 | stride=1 197 | pad=1 198 | activation=leaky 199 | 200 | [convolutional] 201 | batch_normalize=1 202 | filters=512 203 | size=3 204 | stride=1 205 | pad=1 206 | activation=leaky 207 | 208 | [convolutional] 209 | size=1 210 | stride=1 211 | pad=1 212 | filters=255 213 | activation=linear 214 | 215 | 216 | 217 | [yolo] 218 | mask = 3,4,5 219 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 220 | classes=80 221 | num=6 222 | jitter=.3 223 | scale_x_y = 1.05 224 | cls_normalizer=1.0 225 | iou_normalizer=0.07 226 | iou_loss=ciou 227 | ignore_thresh = .7 228 | truth_thresh = 1 229 | random=0 230 | resize=1.5 231 | nms_kind=greedynms 232 | beta_nms=0.6 233 | 234 | [route] 235 | layers = -4 236 | 237 | [convolutional] 238 | batch_normalize=1 239 | filters=128 240 | size=1 241 | stride=1 242 | pad=1 243 | activation=leaky 244 | 245 | [upsample] 246 | stride=2 247 | 248 | [route] 249 | layers = -1, 23 250 | 251 | [convolutional] 252 | batch_normalize=1 253 | filters=256 254 | size=3 255 | stride=1 256 | pad=1 257 | activation=leaky 258 | 259 | [convolutional] 260 | size=1 261 | stride=1 262 | pad=1 263 | filters=255 264 | activation=linear 265 | 266 | [yolo] 267 | mask = 1,2,3 268 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 269 | classes=80 270 | num=6 271 | jitter=.3 272 | scale_x_y = 1.05 273 | cls_normalizer=1.0 274 | iou_normalizer=0.07 275 | iou_loss=ciou 276 | ignore_thresh = .7 277 | truth_thresh = 1 278 | random=0 279 | resize=1.5 280 | nms_kind=greedynms 281 | beta_nms=0.6 -------------------------------------------------------------------------------- /yolov4-relu/convert_weights_pb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | import yolo_v4 6 | import yolo_v4_tiny 7 | from PIL import Image, ImageDraw 8 | 9 | from utils import load_weights, load_coco_names, detections_boxes, freeze_graph 10 | 11 | FLAGS = tf.app.flags.FLAGS 12 | 13 | tf.app.flags.DEFINE_string( 14 | 'class_names', 'coco.names', 'File with class names') 15 | tf.app.flags.DEFINE_string( 16 | 'weights_file', 'yolov4.weights', 'Binary file with detector weights') 17 | tf.app.flags.DEFINE_string( 18 | 'data_format', 'NCHW', 'Data format: NCHW (gpu only) / NHWC') 19 | tf.app.flags.DEFINE_string( 20 | 'output_graph', 'frozen_darknet_yolov4_model.pb', 'Frozen tensorflow protobuf model output path') 21 | 22 | tf.app.flags.DEFINE_bool( 23 | 'tiny', False, 'Use tiny version of YOLOv4') 24 | tf.app.flags.DEFINE_integer( 25 | 'size', 416, 'Image size') 26 | 27 | 28 | 29 | def main(argv=None): 30 | if FLAGS.tiny: 31 | model = yolo_v4_tiny.yolo_v4_tiny 32 | else: 33 | model = yolo_v4.yolo_v4 34 | 35 | classes = load_coco_names(FLAGS.class_names) 36 | 37 | # placeholder for detector inputs 38 | inputs = tf.placeholder(tf.float32, [None, FLAGS.size, FLAGS.size, 3], "inputs") 39 | 40 | with tf.variable_scope('detector'): 41 | detections = model(inputs, len(classes), data_format=FLAGS.data_format) 42 | load_ops = load_weights(tf.global_variables(scope='detector'), FLAGS.weights_file) 43 | 44 | # Sets the output nodes in the current session 45 | boxes = detections_boxes(detections) 46 | 47 | with tf.Session() as sess: 48 | sess.run(load_ops) 49 | freeze_graph(sess, FLAGS.output_graph) 50 | 51 | if __name__ == '__main__': 52 | tf.app.run() 53 | -------------------------------------------------------------------------------- /yolov4-relu/utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | from PIL import ImageDraw, Image 6 | 7 | 8 | def get_boxes_and_inputs_pb(frozen_graph): 9 | 10 | with frozen_graph.as_default(): 11 | boxes = tf.get_default_graph().get_tensor_by_name("output_boxes:0") 12 | inputs = tf.get_default_graph().get_tensor_by_name("inputs:0") 13 | 14 | return boxes, inputs 15 | 16 | 17 | def get_boxes_and_inputs(model, num_classes, size, data_format): 18 | 19 | inputs = tf.placeholder(tf.float32, [1, size, size, 3]) 20 | 21 | with tf.variable_scope('detector'): 22 | detections = model(inputs, num_classes, 23 | data_format=data_format) 24 | 25 | boxes = detections_boxes(detections) 26 | 27 | return boxes, inputs 28 | 29 | 30 | def load_graph(frozen_graph_filename): 31 | 32 | with tf.gfile.GFile(frozen_graph_filename, "rb") as f: 33 | graph_def = tf.GraphDef() 34 | graph_def.ParseFromString(f.read()) 35 | 36 | with tf.Graph().as_default() as graph: 37 | tf.import_graph_def(graph_def, name="") 38 | 39 | return graph 40 | 41 | 42 | def freeze_graph(sess, output_graph): 43 | 44 | output_node_names = [ 45 | "output_boxes", 46 | "inputs", 47 | ] 48 | output_node_names = ",".join(output_node_names) 49 | 50 | output_graph_def = tf.graph_util.convert_variables_to_constants( 51 | sess, 52 | tf.get_default_graph().as_graph_def(), 53 | output_node_names.split(",") 54 | ) 55 | 56 | with tf.gfile.GFile(output_graph, "wb") as f: 57 | f.write(output_graph_def.SerializeToString()) 58 | 59 | print("{} ops written to {}.".format(len(output_graph_def.node), output_graph)) 60 | 61 | 62 | def load_weights(var_list, weights_file): 63 | """ 64 | Loads and converts pre-trained weights. 65 | :param var_list: list of network variables. 66 | :param weights_file: name of the binary file. 67 | :return: list of assign ops 68 | """ 69 | with open(weights_file, "rb") as fp: 70 | _ = np.fromfile(fp, dtype=np.int32, count=5) 71 | 72 | weights = np.fromfile(fp, dtype=np.float32) 73 | 74 | ptr = 0 75 | i = 0 76 | assign_ops = [] 77 | while i < len(var_list) - 1: 78 | var1 = var_list[i] 79 | var2 = var_list[i + 1] 80 | # do something only if we process conv layer 81 | if 'Conv' in var1.name.split('/')[-2]: 82 | # check type of next layer 83 | if 'BatchNorm' in var2.name.split('/')[-2]: 84 | # load batch norm params 85 | gamma, beta, mean, var = var_list[i + 1:i + 5] 86 | batch_norm_vars = [beta, gamma, mean, var] 87 | for var in batch_norm_vars: 88 | shape = var.shape.as_list() 89 | num_params = np.prod(shape) 90 | var_weights = weights[ptr:ptr + num_params].reshape(shape) 91 | ptr += num_params 92 | assign_ops.append( 93 | tf.assign(var, var_weights, validate_shape=True)) 94 | 95 | # we move the pointer by 4, because we loaded 4 variables 96 | i += 4 97 | elif 'Conv' in var2.name.split('/')[-2]: 98 | # load biases 99 | bias = var2 100 | bias_shape = bias.shape.as_list() 101 | bias_params = np.prod(bias_shape) 102 | bias_weights = weights[ptr:ptr + 103 | bias_params].reshape(bias_shape) 104 | ptr += bias_params 105 | assign_ops.append( 106 | tf.assign(bias, bias_weights, validate_shape=True)) 107 | 108 | # we loaded 1 variable 109 | i += 1 110 | # we can load weights of conv layer 111 | shape = var1.shape.as_list() 112 | num_params = np.prod(shape) 113 | 114 | var_weights = weights[ptr:ptr + num_params].reshape( 115 | (shape[3], shape[2], shape[0], shape[1])) 116 | # remember to transpose to column-major 117 | var_weights = np.transpose(var_weights, (2, 3, 1, 0)) 118 | ptr += num_params 119 | assign_ops.append( 120 | tf.assign(var1, var_weights, validate_shape=True)) 121 | i += 1 122 | 123 | return assign_ops 124 | 125 | 126 | def detections_boxes(detections): 127 | """ 128 | Converts center x, center y, width and height values to coordinates of top left and bottom right points. 129 | 130 | :param detections: outputs of YOLO v3 detector of shape (?, 10647, (num_classes + 5)) 131 | :return: converted detections of same shape as input 132 | """ 133 | center_x, center_y, width, height, attrs = tf.split( 134 | detections, [1, 1, 1, 1, -1], axis=-1) 135 | w2 = width / 2 136 | h2 = height / 2 137 | x0 = center_x - w2 138 | y0 = center_y - h2 139 | x1 = center_x + w2 140 | y1 = center_y + h2 141 | 142 | boxes = tf.concat([x0, y0, x1, y1], axis=-1) 143 | detections = tf.concat([boxes, attrs], axis=-1, name="output_boxes") 144 | return detections 145 | 146 | 147 | def _iou(box1, box2): 148 | """ 149 | Computes Intersection over Union value for 2 bounding boxes 150 | 151 | :param box1: array of 4 values (top left and bottom right coords): [x0, y0, x1, x2] 152 | :param box2: same as box1 153 | :return: IoU 154 | """ 155 | b1_x0, b1_y0, b1_x1, b1_y1 = box1 156 | b2_x0, b2_y0, b2_x1, b2_y1 = box2 157 | 158 | int_x0 = max(b1_x0, b2_x0) 159 | int_y0 = max(b1_y0, b2_y0) 160 | int_x1 = min(b1_x1, b2_x1) 161 | int_y1 = min(b1_y1, b2_y1) 162 | 163 | int_area = max(int_x1 - int_x0, 0) * max(int_y1 - int_y0, 0) 164 | 165 | b1_area = (b1_x1 - b1_x0) * (b1_y1 - b1_y0) 166 | b2_area = (b2_x1 - b2_x0) * (b2_y1 - b2_y0) 167 | 168 | # we add small epsilon of 1e-05 to avoid division by 0 169 | iou = int_area / (b1_area + b2_area - int_area + 1e-05) 170 | return iou 171 | 172 | 173 | def non_max_suppression(predictions_with_boxes, confidence_threshold, iou_threshold=0.4): 174 | """ 175 | Applies Non-max suppression to prediction boxes. 176 | 177 | :param predictions_with_boxes: 3D numpy array, first 4 values in 3rd dimension are bbox attrs, 5th is confidence 178 | :param confidence_threshold: the threshold for deciding if prediction is valid 179 | :param iou_threshold: the threshold for deciding if two boxes overlap 180 | :return: dict: class -> [(box, score)] 181 | """ 182 | conf_mask = np.expand_dims( 183 | (predictions_with_boxes[:, :, 4] > confidence_threshold), -1) 184 | predictions = predictions_with_boxes * conf_mask 185 | 186 | result = {} 187 | for i, image_pred in enumerate(predictions): 188 | shape = image_pred.shape 189 | non_zero_idxs = np.nonzero(image_pred) 190 | image_pred = image_pred[non_zero_idxs] 191 | image_pred = image_pred.reshape(-1, shape[-1]) 192 | 193 | bbox_attrs = image_pred[:, :5] 194 | classes = image_pred[:, 5:] 195 | classes = np.argmax(classes, axis=-1) 196 | 197 | unique_classes = list(set(classes.reshape(-1))) 198 | 199 | for cls in unique_classes: 200 | cls_mask = classes == cls 201 | cls_boxes = bbox_attrs[np.nonzero(cls_mask)] 202 | cls_boxes = cls_boxes[cls_boxes[:, -1].argsort()[::-1]] 203 | cls_scores = cls_boxes[:, -1] 204 | cls_boxes = cls_boxes[:, :-1] 205 | 206 | while len(cls_boxes) > 0: 207 | box = cls_boxes[0] 208 | score = cls_scores[0] 209 | if cls not in result: 210 | result[cls] = [] 211 | result[cls].append((box, score)) 212 | cls_boxes = cls_boxes[1:] 213 | cls_scores = cls_scores[1:] 214 | ious = np.array([_iou(box, x) for x in cls_boxes]) 215 | iou_mask = ious < iou_threshold 216 | cls_boxes = cls_boxes[np.nonzero(iou_mask)] 217 | cls_scores = cls_scores[np.nonzero(iou_mask)] 218 | 219 | return result 220 | 221 | 222 | def load_coco_names(file_name): 223 | names = {} 224 | with open(file_name) as f: 225 | for id, name in enumerate(f): 226 | names[id] = name 227 | return names 228 | 229 | 230 | def draw_boxes(boxes, img, cls_names, detection_size, is_letter_box_image): 231 | draw = ImageDraw.Draw(img) 232 | 233 | for cls, bboxs in boxes.items(): 234 | color = tuple(np.random.randint(0, 256, 3)) 235 | for box, score in bboxs: 236 | box = convert_to_original_size(box, np.array(detection_size), 237 | np.array(img.size), 238 | is_letter_box_image) 239 | draw.rectangle(box, outline=color) 240 | draw.text(box[:2], '{} {:.2f}%'.format( 241 | cls_names[cls], score * 100), fill=color) 242 | 243 | 244 | def convert_to_original_size(box, size, original_size, is_letter_box_image): 245 | if is_letter_box_image: 246 | box = box.reshape(2, 2) 247 | box[0, :] = letter_box_pos_to_original_pos(box[0, :], size, original_size) 248 | box[1, :] = letter_box_pos_to_original_pos(box[1, :], size, original_size) 249 | else: 250 | ratio = original_size / size 251 | box = box.reshape(2, 2) * ratio 252 | return list(box.reshape(-1)) 253 | 254 | 255 | def letter_box_image(image: Image.Image, output_height: int, output_width: int, fill_value)-> np.ndarray: 256 | """ 257 | Fit image with final image with output_width and output_height. 258 | :param image: PILLOW Image object. 259 | :param output_height: width of the final image. 260 | :param output_width: height of the final image. 261 | :param fill_value: fill value for empty area. Can be uint8 or np.ndarray 262 | :return: numpy image fit within letterbox. dtype=uint8, shape=(output_height, output_width) 263 | """ 264 | 265 | height_ratio = float(output_height)/image.size[1] 266 | width_ratio = float(output_width)/image.size[0] 267 | fit_ratio = min(width_ratio, height_ratio) 268 | fit_height = int(image.size[1] * fit_ratio) 269 | fit_width = int(image.size[0] * fit_ratio) 270 | fit_image = np.asarray(image.resize((fit_width, fit_height), resample=Image.BILINEAR)) 271 | 272 | if isinstance(fill_value, int): 273 | fill_value = np.full(fit_image.shape[2], fill_value, fit_image.dtype) 274 | 275 | to_return = np.tile(fill_value, (output_height, output_width, 1)) 276 | pad_top = int(0.5 * (output_height - fit_height)) 277 | pad_left = int(0.5 * (output_width - fit_width)) 278 | to_return[pad_top:pad_top+fit_height, pad_left:pad_left+fit_width] = fit_image 279 | return to_return 280 | 281 | 282 | def letter_box_pos_to_original_pos(letter_pos, current_size, ori_image_size)-> np.ndarray: 283 | """ 284 | Parameters should have same shape and dimension space. (Width, Height) or (Height, Width) 285 | :param letter_pos: The current position within letterbox image including fill value area. 286 | :param current_size: The size of whole image including fill value area. 287 | :param ori_image_size: The size of image before being letter boxed. 288 | :return: 289 | """ 290 | letter_pos = np.asarray(letter_pos, dtype=np.float) 291 | current_size = np.asarray(current_size, dtype=np.float) 292 | ori_image_size = np.asarray(ori_image_size, dtype=np.float) 293 | final_ratio = min(current_size[0]/ori_image_size[0], current_size[1]/ori_image_size[1]) 294 | pad = 0.5 * (current_size - final_ratio * ori_image_size) 295 | pad = pad.astype(np.int32) 296 | to_return_pos = (letter_pos - pad) / final_ratio 297 | return to_return_pos 298 | -------------------------------------------------------------------------------- /yolov4-relu/yolo_v4.py: -------------------------------------------------------------------------------- 1 | 2 | import numpy as np 3 | import tensorflow as tf 4 | 5 | slim = tf.contrib.slim 6 | 7 | _BATCH_NORM_DECAY = 0.9 8 | _BATCH_NORM_EPSILON = 1e-05 9 | _LEAKY_RELU = 0.1 10 | 11 | _ANCHORS = [(12, 16), (19, 36), (40, 28), 12 | (36, 75), (76, 55), (72, 146), 13 | (142, 110), (192, 243), (459, 401)] 14 | @tf.contrib.framework.add_arg_scope 15 | def _fixed_padding(inputs, kernel_size, *args, mode='CONSTANT', **kwargs): 16 | """ 17 | Pads the input along the spatial dimensions independently of input size. 18 | 19 | Args: 20 | inputs: A tensor of size [batch, channels, height_in, width_in] or 21 | [batch, height_in, width_in, channels] depending on data_format. 22 | kernel_size: The kernel to be used in the conv2d or max_pool2d operation. 23 | Should be a positive integer. 24 | data_format: The input format ('NHWC' or 'NCHW'). 25 | mode: The mode for tf.pad. 26 | 27 | Returns: 28 | A tensor with the same format as the input with the data either intact 29 | (if kernel_size == 1) or padded (if kernel_size > 1). 30 | """ 31 | pad_total = kernel_size - 1 32 | pad_beg = pad_total // 2 33 | pad_end = pad_total - pad_beg 34 | 35 | if kwargs['data_format'] == 'NCHW': 36 | padded_inputs = tf.pad(inputs, [[0, 0], [0, 0], 37 | [pad_beg, pad_end], 38 | [pad_beg, pad_end]], 39 | mode=mode) 40 | else: 41 | padded_inputs = tf.pad(inputs, [[0, 0], [pad_beg, pad_end], 42 | [pad_beg, pad_end], [0, 0]], mode=mode) 43 | return padded_inputs 44 | 45 | 46 | 47 | def _conv2d_fixed_padding(inputs, filters, kernel_size, strides=1): 48 | if strides > 1: 49 | inputs = _fixed_padding(inputs, kernel_size) 50 | inputs = slim.conv2d(inputs, filters, kernel_size, stride=strides, 51 | padding=('SAME' if strides == 1 else 'VALID')) 52 | return inputs 53 | 54 | 55 | def _yolo_res_Block(inputs,in_channels,res_num,data_format,double_ch=False): 56 | out_channels = in_channels 57 | if double_ch: 58 | out_channels = in_channels * 2 59 | net = _conv2d_fixed_padding(inputs,in_channels*2,kernel_size=3,strides=2)#cov后分支 60 | route = _conv2d_fixed_padding(net,out_channels,kernel_size=1)#右 61 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1)#左 62 | 63 | for _ in range(res_num): 64 | tmp=net 65 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=1) 66 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=3) 67 | #shortcut 68 | net = tmp+net 69 | 70 | net=_conv2d_fixed_padding(net,out_channels,kernel_size=1) 71 | 72 | #concat 73 | net=tf.concat([net,route],axis=1 if data_format == 'NCHW' else 3) 74 | net=_conv2d_fixed_padding(net,in_channels*2,kernel_size=1) 75 | return net 76 | 77 | def _yolo_conv_block(net,in_channels,a,b): 78 | for _ in range(a): 79 | out_channels=in_channels/2 80 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 81 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=3) 82 | 83 | out_channels=in_channels 84 | for _ in range(b): 85 | out_channels=out_channels/2 86 | net = _conv2d_fixed_padding(net,out_channels,kernel_size=1) 87 | 88 | return net 89 | 90 | 91 | def _spp_block(inputs, data_format='NCHW'): 92 | return tf.concat([slim.max_pool2d(inputs, 13, 1, 'SAME'), 93 | slim.max_pool2d(inputs, 9, 1, 'SAME'), 94 | slim.max_pool2d(inputs, 5, 1, 'SAME'), 95 | inputs], 96 | axis=1 if data_format == 'NCHW' else 3) 97 | 98 | 99 | def _upsample(inputs, out_shape, data_format='NCHW'): 100 | # tf.image.resize_nearest_neighbor accepts input in format NHWC 101 | if data_format == 'NCHW': 102 | inputs = tf.transpose(inputs, [0, 2, 3, 1]) 103 | 104 | if data_format == 'NCHW': 105 | new_height = out_shape[2] 106 | new_width = out_shape[3] 107 | else: 108 | new_height = out_shape[1] 109 | new_width = out_shape[2] 110 | 111 | inputs = tf.image.resize_nearest_neighbor(inputs, (new_height, new_width)) 112 | 113 | # back to NCHW if needed 114 | if data_format == 'NCHW': 115 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 116 | 117 | inputs = tf.identity(inputs, name='upsampled') 118 | return inputs 119 | 120 | 121 | def csp_darknet53(inputs,data_format): 122 | """ 123 | Builds CSPDarknet-53 model. 124 | """ 125 | net = _conv2d_fixed_padding(inputs,32,kernel_size=3) 126 | #downsample 127 | #res1 128 | net=_yolo_res_Block(net,32,1,data_format,double_ch=True) 129 | #res2 130 | net = _yolo_res_Block(net,64,2,data_format) 131 | #res8 132 | net = _yolo_res_Block(net,128,8,data_format) 133 | 134 | #features of 54 layer 135 | up_route_54=net 136 | #res8 137 | net = _yolo_res_Block(net,256,8,data_format) 138 | #featyres of 85 layer 139 | up_route_85=net 140 | #res4 141 | net=_yolo_res_Block(net,512,4,data_format) 142 | 143 | ######## 144 | net = _yolo_conv_block(net,1024,1,1) 145 | 146 | net=_spp_block(net,data_format=data_format) 147 | 148 | net=_conv2d_fixed_padding(net,512,kernel_size=1) 149 | net = _conv2d_fixed_padding(net, 1024, kernel_size=3) 150 | net = _conv2d_fixed_padding(net, 512, kernel_size=1) 151 | 152 | #features of 116 layer 153 | route_3=net 154 | 155 | net = _conv2d_fixed_padding(net,256,kernel_size=1) 156 | upsample_size = up_route_85.get_shape().as_list() 157 | net = _upsample(net, upsample_size, data_format) 158 | route= _conv2d_fixed_padding(up_route_85,256,kernel_size=1) 159 | 160 | net = tf.concat([route,net], axis=1 if data_format == 'NCHW' else 3) 161 | net = _yolo_conv_block(net,512,2,1) 162 | #features of 126 layer 163 | route_2=net 164 | 165 | net = _conv2d_fixed_padding(net,128,kernel_size=1) 166 | upsample_size = up_route_54.get_shape().as_list() 167 | net = _upsample(net, upsample_size, data_format) 168 | route= _conv2d_fixed_padding(up_route_54,128,kernel_size=1) 169 | net = tf.concat([route,net], axis=1 if data_format == 'NCHW' else 3) 170 | net = _yolo_conv_block(net,256,2,1) 171 | #features of 136 layer 172 | route_1 = net 173 | 174 | return route_1, route_2, route_3 175 | 176 | def _get_size(shape, data_format): 177 | if len(shape) == 4: 178 | shape = shape[1:] 179 | return shape[1:3] if data_format == 'NCHW' else shape[0:2] 180 | 181 | 182 | def _detection_layer(inputs, num_classes, anchors, img_size, data_format): 183 | num_anchors = len(anchors) 184 | predictions = slim.conv2d(inputs, num_anchors * (5 + num_classes), 1, 185 | stride=1, normalizer_fn=None, 186 | activation_fn=None, 187 | biases_initializer=tf.zeros_initializer()) 188 | 189 | shape = predictions.get_shape().as_list() 190 | grid_size = _get_size(shape, data_format) 191 | dim = grid_size[0] * grid_size[1] 192 | bbox_attrs = 5 + num_classes 193 | 194 | if data_format == 'NCHW': 195 | predictions = tf.reshape( 196 | predictions, [-1, num_anchors * bbox_attrs, dim]) 197 | predictions = tf.transpose(predictions, [0, 2, 1]) 198 | 199 | predictions = tf.reshape(predictions, [-1, num_anchors * dim, bbox_attrs]) 200 | 201 | stride = (img_size[0] // grid_size[0], img_size[1] // grid_size[1]) 202 | 203 | anchors = [(a[0] / stride[0], a[1] / stride[1]) for a in anchors] 204 | 205 | box_centers, box_sizes, confidence, classes = tf.split( 206 | predictions, [2, 2, 1, num_classes], axis=-1) 207 | 208 | box_centers = tf.nn.sigmoid(box_centers) 209 | confidence = tf.nn.sigmoid(confidence) 210 | 211 | grid_x = tf.range(grid_size[0], dtype=tf.float32) 212 | grid_y = tf.range(grid_size[1], dtype=tf.float32) 213 | a, b = tf.meshgrid(grid_x, grid_y) 214 | 215 | x_offset = tf.reshape(a, (-1, 1)) 216 | y_offset = tf.reshape(b, (-1, 1)) 217 | 218 | x_y_offset = tf.concat([x_offset, y_offset], axis=-1) 219 | x_y_offset = tf.reshape(tf.tile(x_y_offset, [1, num_anchors]), [1, -1, 2]) 220 | 221 | box_centers = box_centers + x_y_offset 222 | box_centers = box_centers * stride 223 | 224 | anchors = tf.tile(anchors, [dim, 1]) 225 | box_sizes = tf.exp(box_sizes) * anchors 226 | box_sizes = box_sizes * stride 227 | 228 | detections = tf.concat([box_centers, box_sizes, confidence], axis=-1) 229 | 230 | classes = tf.nn.sigmoid(classes) 231 | predictions = tf.concat([detections, classes], axis=-1) 232 | return predictions 233 | 234 | 235 | 236 | 237 | def yolo_v4(inputs, num_classes, is_training=False, data_format='NCHW', reuse=False): 238 | """ 239 | Creates YOLO v4 model. 240 | 241 | :param inputs: a 4-D tensor of size [batch_size, height, width, channels]. 242 | Dimension batch_size may be undefined. The channel order is RGB. 243 | :param num_classes: number of predicted classes. 244 | :param is_training: whether is training or not. 245 | :param data_format: data format NCHW or NHWC. 246 | :param reuse: whether or not the network and its variables should be reused. 247 | :return: 248 | """ 249 | 250 | # it will be needed later on 251 | img_size = inputs.get_shape().as_list()[1:3] 252 | 253 | # transpose the inputs to NCHW 254 | if data_format == 'NCHW': 255 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 256 | 257 | # normalize values to range [0..1] 258 | inputs = inputs / 255 259 | 260 | # set batch norm params 261 | batch_norm_params = { 262 | 'decay': _BATCH_NORM_DECAY, 263 | 'epsilon': _BATCH_NORM_EPSILON, 264 | 'scale': True, 265 | 'is_training': is_training, 266 | 'fused': None, # Use fused batch norm if possible. 267 | } 268 | 269 | # Set activation_fn and parameters for conv2d, batch_norm. 270 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding], data_format=data_format, reuse=reuse): 271 | with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm, 272 | normalizer_params=batch_norm_params, 273 | biases_initializer=None, 274 | activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU)): 275 | #weights_regularizer=slim.l2_regularizer(weight_decay) 276 | #weights_initializer=tf.truncated_normal_initializer(0.0, 0.01) 277 | with tf.variable_scope('csp-darknet-53'): 278 | route_1, route_2, route_3 = csp_darknet53(inputs,data_format) 279 | 280 | with tf.variable_scope('yolo-v4'): 281 | #features of y1 282 | net = _conv2d_fixed_padding(route_1,256,kernel_size=3) 283 | detect_1 = _detection_layer( 284 | net, num_classes, _ANCHORS[0:3], img_size, data_format) 285 | detect_1 = tf.identity(detect_1, name='detect_1') 286 | 287 | #features of y2 288 | net = _conv2d_fixed_padding(route_1, 256, kernel_size=3,strides=2) 289 | net=tf.concat([net,route_2], axis=1 if data_format == 'NCHW' else 3) 290 | net=_yolo_conv_block(net,512,2,1) 291 | route_147 =net 292 | net = _conv2d_fixed_padding(net,512,kernel_size=3) 293 | detect_2 = _detection_layer( 294 | net, num_classes, _ANCHORS[3:6], img_size, data_format) 295 | detect_2 = tf.identity(detect_2, name='detect_2') 296 | 297 | # features of y3 298 | net=_conv2d_fixed_padding(route_147,512,strides=2,kernel_size=3) 299 | net = tf.concat([net, route_3], axis=1 if data_format == 'NCHW' else 3) 300 | net = _yolo_conv_block(net,1024,3,0) 301 | detect_3 = _detection_layer( 302 | net, num_classes, _ANCHORS[6:9], img_size, data_format) 303 | detect_3 = tf.identity(detect_3, name='detect_3') 304 | 305 | detections = tf.concat([detect_1, detect_2, detect_3], axis=1) 306 | detections = tf.identity(detections, name='detections') 307 | return detections 308 | -------------------------------------------------------------------------------- /yolov4-relu/yolo_v4_tiny.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | from yolo_v4 import _conv2d_fixed_padding, _fixed_padding, _get_size, \ 6 | _detection_layer, _upsample 7 | 8 | slim = tf.contrib.slim 9 | 10 | _BATCH_NORM_DECAY = 0.9 11 | _BATCH_NORM_EPSILON = 1e-05 12 | _LEAKY_RELU = 0.1 13 | 14 | _ANCHORS = [(10, 14), (23, 27), (37, 58), 15 | (81, 82), (135, 169), (344, 319)] 16 | 17 | def _tiny_res_block(inputs,in_channels,data_format): 18 | net = _conv2d_fixed_padding(inputs,in_channels,kernel_size=3) 19 | 20 | route = net 21 | #_,split=tf.split(net,num_or_size_splits=2,axis=1 if data_format =="NCHW" else 3) 22 | split = net[:, in_channels//2:, :, :]if data_format=="NCHW" else net[:, :, :, in_channels//2:] 23 | net = _conv2d_fixed_padding(split,in_channels//2,kernel_size=3) 24 | route1 = net 25 | net = _conv2d_fixed_padding(net,in_channels//2,kernel_size=3) 26 | net = tf.concat([net, route1], axis=1 if data_format == 'NCHW' else 3) 27 | net = _conv2d_fixed_padding(net,in_channels,kernel_size=1) 28 | feat = net 29 | net = tf.concat([route, net], axis=1 if data_format == 'NCHW' else 3) 30 | net = slim.max_pool2d( 31 | net, [2, 2], scope='pool2') 32 | return net,feat 33 | 34 | 35 | 36 | 37 | def yolo_v4_tiny(inputs, num_classes, is_training=False, data_format='NCHW', reuse=False): 38 | """ 39 | Creates YOLO v4 tiny model. 40 | 41 | :param inputs: a 4-D tensor of size [batch_size, height, width, channels]. 42 | Dimension batch_size may be undefined. The channel order is RGB. 43 | :param num_classes: number of predicted classes. 44 | :param is_training: whether is training or not. 45 | :param data_format: data format NCHW or NHWC. 46 | :param reuse: whether or not the network and its variables should be reused. 47 | :return: 48 | """ 49 | # it will be needed later on 50 | img_size = inputs.get_shape().as_list()[1:3] 51 | 52 | # transpose the inputs to NCHW 53 | if data_format == 'NCHW': 54 | inputs = tf.transpose(inputs, [0, 3, 1, 2]) 55 | 56 | # normalize values to range [0..1] 57 | inputs = inputs / 255 58 | 59 | # set batch norm params 60 | batch_norm_params = { 61 | 'decay': _BATCH_NORM_DECAY, 62 | 'epsilon': _BATCH_NORM_EPSILON, 63 | 'scale': True, 64 | 'is_training': is_training, 65 | 'fused': None, # Use fused batch norm if possible. 66 | } 67 | 68 | # Set activation_fn and parameters for conv2d, batch_norm. 69 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding, slim.max_pool2d], data_format=data_format): 70 | with slim.arg_scope([slim.conv2d, slim.batch_norm, _fixed_padding], reuse=reuse): 71 | with slim.arg_scope([slim.conv2d], 72 | normalizer_fn=slim.batch_norm, 73 | normalizer_params=batch_norm_params, 74 | biases_initializer=None, 75 | activation_fn=lambda x: tf.nn.leaky_relu(x, alpha=_LEAKY_RELU)): 76 | 77 | with tf.variable_scope('yolo-v4-tiny'): 78 | #CSPDARKENT BEGIN 79 | net = _conv2d_fixed_padding(inputs,32,kernel_size=3,strides=2) 80 | 81 | net = _conv2d_fixed_padding(net, 64, kernel_size=3,strides=2) 82 | 83 | net,_ = _tiny_res_block(net,64,data_format) 84 | net,_ = _tiny_res_block(net,128,data_format) 85 | net,feat = _tiny_res_block(net,256,data_format) 86 | net = _conv2d_fixed_padding(net,512,kernel_size=3) 87 | feat2=net 88 | #CSPDARKNET END 89 | 90 | net=_conv2d_fixed_padding(feat2,256,kernel_size=1) 91 | route = net 92 | net = _conv2d_fixed_padding(route,512,kernel_size=3) 93 | detect_1 = _detection_layer( 94 | net, num_classes, _ANCHORS[3:6], img_size, data_format) 95 | detect_1 = tf.identity(detect_1, name='detect_1') 96 | net = _conv2d_fixed_padding(route,128,kernel_size=1) 97 | upsample_size = feat.get_shape().as_list() 98 | net = _upsample(net, upsample_size, data_format) 99 | net = tf.concat([net,feat], axis=1 if data_format == 'NCHW' else 3) 100 | net = _conv2d_fixed_padding(net,256,kernel_size=3) 101 | detect_2 = _detection_layer( 102 | net, num_classes, _ANCHORS[1:4], img_size, data_format) 103 | detect_2 = tf.identity(detect_2, name='detect_2') 104 | 105 | 106 | detections = tf.concat([detect_1, detect_2], axis=1) 107 | detections = tf.identity(detections, name='detections') 108 | 109 | return detections 110 | -------------------------------------------------------------------------------- /yolov4-relu/yolov4.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "TFYOLOV3", 4 | "match_kind": "general", 5 | "custom_attributes": { 6 | "classes": 80, 7 | "anchors": [12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401], 8 | "coords": 4, 9 | "num": 9, 10 | "masks":[[0, 1, 2], [3, 4, 5], [6, 7, 8]], 11 | "entry_points": ["detector/yolo-v4/Reshape", "detector/yolo-v4/Reshape_4", "detector/yolo-v4/Reshape_8"] 12 | } 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /yolov4.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "TFYOLOV3", 4 | "match_kind": "general", 5 | "custom_attributes": { 6 | "classes": 80, 7 | "anchors": [12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401], 8 | "coords": 4, 9 | "num": 9, 10 | "masks":[[0, 1, 2], [3, 4, 5], [6, 7, 8]], 11 | "entry_points": ["detector/yolo-v4/Reshape", "detector/yolo-v4/Reshape_4", "detector/yolo-v4/Reshape_8"] 12 | } 13 | } 14 | ] 15 | --------------------------------------------------------------------------------