YOLO/PASCAL-VOC detection tutorial

This tutorial demonstrates that Akida can perform object detection using a state-of-the-art model architecture. This is illustrated using a subset of the PASCAL-VOC 2007 dataset with “car” and “person” classes only. The YOLOv2 architecture from Redmon et al (2016) has been chosen to tackle this object detection problem.

1. Introduction

1.1 Object detection

Object detection is a computer vision task that combines two elemental tasks:

  • object classification that consists in assigning a class label to an image like shown in the DS-CNN CIFAR10 or the MobileNet ImageNet example

  • object localization that consists in drawing a bounding box around one or several objects in an image

One can learn more about the subject reading this introduction to object detection blog article.

1.2 YOLO key concepts

You Only Look Once (YOLO) is a deep neural network architecture dedicated to object detection.

As opposed to classic networks that handle object detection, YOLO predicts bounding boxes (localization task) and class probabilities (classification task) from a single neural network in a single evaluation. The object detection task is reduced to a regression problem to spatially separated boxes and associated class probabilities.

YOLO base concept is to divide an input image into regions, forming a grid, and to predict bounding boxes and probabilities for each region. The bounding boxes are weighted by the prediction probabilities.

YOLO also uses the concept of “anchors boxes” or “prior boxes”. The network does not actually predict the actual bounding boxes but offsets from anchors boxes which are templates (width/height ratio) computed by clustering the dimensions of the ground truth boxes from the training dataset. The anchors then represent the average shape and size of the objects to detect. More details on the anchors boxes concept are given in this blog article.

Additional information about YOLO can be found on the Darknet website and source code for the preprocessing and postprocessing functions that are included in akida_models package (see the processing section in the model zoo) is largely inspired from experiencor github.

2. Preprocessing tools

As this example focuses on car and person detection only, a subset of VOC has been prepared with test images from VOC2007 that contains at least one of the occurence of the two classes. Just like the VOC dataset, the subset contains an image folder, an annotation folder and a text file listing the file names of interest.

The YOLO toolkit offers several methods to prepare data for processing, see load_image, preprocess_image or parse_voc_annotations.

import os

from tensorflow.keras.utils import get_file
from akida_models.detection.processing import parse_voc_annotations

# Download validation set from Brainchip data server
data_path = get_file(
    "voc_test_car_person.tar.gz",
    "http://data.brainchip.com/dataset-mirror/voc/voc_test_car_person.tar.gz",
    cache_subdir='datasets/voc',
    extract=True)

data_dir = os.path.dirname(data_path)
gt_folder = os.path.join(data_dir, 'voc_test_car_person', 'Annotations')
image_folder = os.path.join(data_dir, 'voc_test_car_person', 'JPEGImages')
file_path = os.path.join(data_dir, 'voc_test_car_person', 'test_car_person.txt')
labels = ['car', 'person']

val_data = parse_voc_annotations(gt_folder, image_folder, file_path, labels)
print("Loaded VOC2007 test data for car and person classes: "
      f"{len(val_data)} images.")

Out:

Downloading data from http://data.brainchip.com/dataset-mirror/voc/voc_test_car_person.tar.gz

    16384/221551911 [..............................] - ETA: 3:02
   131072/221551911 [..............................] - ETA: 1:54
   335872/221551911 [..............................] - ETA: 1:22
   598016/221551911 [..............................] - ETA: 1:07
   860160/221551911 [..............................] - ETA: 1:01
  1122304/221551911 [..............................] - ETA: 58s 
  1384448/221551911 [..............................] - ETA: 56s
  1646592/221551911 [..............................] - ETA: 55s
  1908736/221551911 [..............................] - ETA: 54s
  2170880/221551911 [..............................] - ETA: 53s
  2433024/221551911 [..............................] - ETA: 52s
  2695168/221551911 [..............................] - ETA: 52s
  2957312/221551911 [..............................] - ETA: 51s
  3219456/221551911 [..............................] - ETA: 51s
  3481600/221551911 [..............................] - ETA: 51s
  3743744/221551911 [..............................] - ETA: 50s
  4005888/221551911 [..............................] - ETA: 50s
  4268032/221551911 [..............................] - ETA: 50s
  4530176/221551911 [..............................] - ETA: 50s
  4792320/221551911 [..............................] - ETA: 49s
  5054464/221551911 [..............................] - ETA: 49s
  5316608/221551911 [..............................] - ETA: 49s
  5578752/221551911 [..............................] - ETA: 49s
  5840896/221551911 [..............................] - ETA: 49s
  6103040/221551911 [..............................] - ETA: 49s
  6365184/221551911 [..............................] - ETA: 48s
  6627328/221551911 [..............................] - ETA: 48s
  6889472/221551911 [..............................] - ETA: 48s
  7151616/221551911 [..............................] - ETA: 48s
  7413760/221551911 [>.............................] - ETA: 48s
  7675904/221551911 [>.............................] - ETA: 48s
  7938048/221551911 [>.............................] - ETA: 48s
  8200192/221551911 [>.............................] - ETA: 48s
  8462336/221551911 [>.............................] - ETA: 48s
  8724480/221551911 [>.............................] - ETA: 47s
  8986624/221551911 [>.............................] - ETA: 47s
  9248768/221551911 [>.............................] - ETA: 47s
  9510912/221551911 [>.............................] - ETA: 47s
  9773056/221551911 [>.............................] - ETA: 47s
 10035200/221551911 [>.............................] - ETA: 47s
 10297344/221551911 [>.............................] - ETA: 47s
 10559488/221551911 [>.............................] - ETA: 47s
 10821632/221551911 [>.............................] - ETA: 47s
 11083776/221551911 [>.............................] - ETA: 47s
 11345920/221551911 [>.............................] - ETA: 47s
 11608064/221551911 [>.............................] - ETA: 46s
 11870208/221551911 [>.............................] - ETA: 46s
 12132352/221551911 [>.............................] - ETA: 46s
 12394496/221551911 [>.............................] - ETA: 46s
 12656640/221551911 [>.............................] - ETA: 46s
 12918784/221551911 [>.............................] - ETA: 46s
 13180928/221551911 [>.............................] - ETA: 46s
 13443072/221551911 [>.............................] - ETA: 46s
 13705216/221551911 [>.............................] - ETA: 46s
 13967360/221551911 [>.............................] - ETA: 46s
 14229504/221551911 [>.............................] - ETA: 46s
 14491648/221551911 [>.............................] - ETA: 46s
 14753792/221551911 [>.............................] - ETA: 46s
 15015936/221551911 [=>............................] - ETA: 46s
 15278080/221551911 [=>............................] - ETA: 45s
 15540224/221551911 [=>............................] - ETA: 45s
 15802368/221551911 [=>............................] - ETA: 45s
 16064512/221551911 [=>............................] - ETA: 45s
 16326656/221551911 [=>............................] - ETA: 45s
 16588800/221551911 [=>............................] - ETA: 45s
 16850944/221551911 [=>............................] - ETA: 45s
 17113088/221551911 [=>............................] - ETA: 45s
 17375232/221551911 [=>............................] - ETA: 45s
 17432576/221551911 [=>............................] - ETA: 49s
 17473536/221551911 [=>............................] - ETA: 49s
 17637376/221551911 [=>............................] - ETA: 49s
 17899520/221551911 [=>............................] - ETA: 49s
 18161664/221551911 [=>............................] - ETA: 49s
 18423808/221551911 [=>............................] - ETA: 49s
 18685952/221551911 [=>............................] - ETA: 49s
 18948096/221551911 [=>............................] - ETA: 49s
 19210240/221551911 [=>............................] - ETA: 49s
 19472384/221551911 [=>............................] - ETA: 48s
 19734528/221551911 [=>............................] - ETA: 48s
 19996672/221551911 [=>............................] - ETA: 48s
 20258816/221551911 [=>............................] - ETA: 48s
 20520960/221551911 [=>............................] - ETA: 48s
 20783104/221551911 [=>............................] - ETA: 48s
 21045248/221551911 [=>............................] - ETA: 48s
 21307392/221551911 [=>............................] - ETA: 48s
 21569536/221551911 [=>............................] - ETA: 47s
 21831680/221551911 [=>............................] - ETA: 47s
 22093824/221551911 [=>............................] - ETA: 47s
 22355968/221551911 [==>...........................] - ETA: 47s
 22618112/221551911 [==>...........................] - ETA: 47s
 22880256/221551911 [==>...........................] - ETA: 47s
 23142400/221551911 [==>...........................] - ETA: 47s
 23404544/221551911 [==>...........................] - ETA: 47s
 23666688/221551911 [==>...........................] - ETA: 47s
 23928832/221551911 [==>...........................] - ETA: 46s
 24190976/221551911 [==>...........................] - ETA: 46s
 24453120/221551911 [==>...........................] - ETA: 46s
 24715264/221551911 [==>...........................] - ETA: 46s
 24977408/221551911 [==>...........................] - ETA: 46s
 25239552/221551911 [==>...........................] - ETA: 46s
 25501696/221551911 [==>...........................] - ETA: 46s
 25763840/221551911 [==>...........................] - ETA: 46s
 26025984/221551911 [==>...........................] - ETA: 46s
 26288128/221551911 [==>...........................] - ETA: 46s
 26550272/221551911 [==>...........................] - ETA: 46s
 26812416/221551911 [==>...........................] - ETA: 45s
 27074560/221551911 [==>...........................] - ETA: 45s
 27336704/221551911 [==>...........................] - ETA: 45s
 27598848/221551911 [==>...........................] - ETA: 45s
 27860992/221551911 [==>...........................] - ETA: 45s
 28123136/221551911 [==>...........................] - ETA: 45s
 28385280/221551911 [==>...........................] - ETA: 45s
 28647424/221551911 [==>...........................] - ETA: 45s
 28909568/221551911 [==>...........................] - ETA: 45s
 29171712/221551911 [==>...........................] - ETA: 45s
 29433856/221551911 [==>...........................] - ETA: 45s
 29696000/221551911 [===>..........................] - ETA: 44s
 29958144/221551911 [===>..........................] - ETA: 44s
 30220288/221551911 [===>..........................] - ETA: 44s
 30482432/221551911 [===>..........................] - ETA: 44s
 30744576/221551911 [===>..........................] - ETA: 44s
 31006720/221551911 [===>..........................] - ETA: 44s
 31268864/221551911 [===>..........................] - ETA: 44s
 31531008/221551911 [===>..........................] - ETA: 44s
 31793152/221551911 [===>..........................] - ETA: 44s
 32055296/221551911 [===>..........................] - ETA: 44s
 32317440/221551911 [===>..........................] - ETA: 44s
 32579584/221551911 [===>..........................] - ETA: 44s
 32841728/221551911 [===>..........................] - ETA: 43s
 33103872/221551911 [===>..........................] - ETA: 43s
 33366016/221551911 [===>..........................] - ETA: 43s
 33628160/221551911 [===>..........................] - ETA: 43s
 33890304/221551911 [===>..........................] - ETA: 43s
 34152448/221551911 [===>..........................] - ETA: 43s
 34414592/221551911 [===>..........................] - ETA: 43s
 34676736/221551911 [===>..........................] - ETA: 43s
 34938880/221551911 [===>..........................] - ETA: 43s
 35201024/221551911 [===>..........................] - ETA: 43s
 35463168/221551911 [===>..........................] - ETA: 43s
 35725312/221551911 [===>..........................] - ETA: 43s
 35987456/221551911 [===>..........................] - ETA: 43s
 36249600/221551911 [===>..........................] - ETA: 42s
 36511744/221551911 [===>..........................] - ETA: 42s
 36773888/221551911 [===>..........................] - ETA: 42s
 37036032/221551911 [====>.........................] - ETA: 42s
 37298176/221551911 [====>.........................] - ETA: 42s
 37560320/221551911 [====>.........................] - ETA: 42s
 37822464/221551911 [====>.........................] - ETA: 42s
 38084608/221551911 [====>.........................] - ETA: 42s
 38346752/221551911 [====>.........................] - ETA: 42s
 38608896/221551911 [====>.........................] - ETA: 42s
 38871040/221551911 [====>.........................] - ETA: 42s
 39133184/221551911 [====>.........................] - ETA: 42s
 39395328/221551911 [====>.........................] - ETA: 42s
 39657472/221551911 [====>.........................] - ETA: 41s
 39919616/221551911 [====>.........................] - ETA: 41s
 40181760/221551911 [====>.........................] - ETA: 41s
 40443904/221551911 [====>.........................] - ETA: 41s
 40706048/221551911 [====>.........................] - ETA: 41s
 40968192/221551911 [====>.........................] - ETA: 41s
 41230336/221551911 [====>.........................] - ETA: 41s
 41492480/221551911 [====>.........................] - ETA: 41s
 41754624/221551911 [====>.........................] - ETA: 41s
 42016768/221551911 [====>.........................] - ETA: 41s
 42278912/221551911 [====>.........................] - ETA: 41s
 42541056/221551911 [====>.........................] - ETA: 41s
 42803200/221551911 [====>.........................] - ETA: 41s
 43065344/221551911 [====>.........................] - ETA: 41s
 43327488/221551911 [====>.........................] - ETA: 40s
 43589632/221551911 [====>.........................] - ETA: 40s
 43851776/221551911 [====>.........................] - ETA: 40s
 44113920/221551911 [====>.........................] - ETA: 40s
 44376064/221551911 [=====>........................] - ETA: 40s
 44638208/221551911 [=====>........................] - ETA: 40s
 44900352/221551911 [=====>........................] - ETA: 40s
 45162496/221551911 [=====>........................] - ETA: 40s
 45424640/221551911 [=====>........................] - ETA: 40s
 45686784/221551911 [=====>........................] - ETA: 40s
 45948928/221551911 [=====>........................] - ETA: 40s
 46211072/221551911 [=====>........................] - ETA: 40s
 46473216/221551911 [=====>........................] - ETA: 40s
 46735360/221551911 [=====>........................] - ETA: 40s
 46997504/221551911 [=====>........................] - ETA: 39s
 47259648/221551911 [=====>........................] - ETA: 39s
 47521792/221551911 [=====>........................] - ETA: 39s
 47783936/221551911 [=====>........................] - ETA: 39s
 48046080/221551911 [=====>........................] - ETA: 39s
 48308224/221551911 [=====>........................] - ETA: 39s
 48570368/221551911 [=====>........................] - ETA: 39s
 48832512/221551911 [=====>........................] - ETA: 39s
 49094656/221551911 [=====>........................] - ETA: 39s
 49356800/221551911 [=====>........................] - ETA: 39s
 49618944/221551911 [=====>........................] - ETA: 39s
 49881088/221551911 [=====>........................] - ETA: 39s
 50143232/221551911 [=====>........................] - ETA: 39s
 50405376/221551911 [=====>........................] - ETA: 39s
 50667520/221551911 [=====>........................] - ETA: 39s
 50929664/221551911 [=====>........................] - ETA: 38s
 51191808/221551911 [=====>........................] - ETA: 38s
 51453952/221551911 [=====>........................] - ETA: 38s
 51716096/221551911 [======>.......................] - ETA: 38s
 51978240/221551911 [======>.......................] - ETA: 38s
 52240384/221551911 [======>.......................] - ETA: 38s
 52502528/221551911 [======>.......................] - ETA: 38s
 52764672/221551911 [======>.......................] - ETA: 38s
 53026816/221551911 [======>.......................] - ETA: 38s
 53288960/221551911 [======>.......................] - ETA: 38s
 53551104/221551911 [======>.......................] - ETA: 38s
 53813248/221551911 [======>.......................] - ETA: 38s
 54075392/221551911 [======>.......................] - ETA: 38s
 54337536/221551911 [======>.......................] - ETA: 38s
 54599680/221551911 [======>.......................] - ETA: 38s
 54861824/221551911 [======>.......................] - ETA: 37s
 55123968/221551911 [======>.......................] - ETA: 37s
 55386112/221551911 [======>.......................] - ETA: 37s
 55648256/221551911 [======>.......................] - ETA: 37s
 55910400/221551911 [======>.......................] - ETA: 37s
 56172544/221551911 [======>.......................] - ETA: 37s
 56434688/221551911 [======>.......................] - ETA: 37s
 56696832/221551911 [======>.......................] - ETA: 37s
 56958976/221551911 [======>.......................] - ETA: 37s
 57221120/221551911 [======>.......................] - ETA: 37s
 57483264/221551911 [======>.......................] - ETA: 37s
 57745408/221551911 [======>.......................] - ETA: 37s
 58007552/221551911 [======>.......................] - ETA: 37s
 58269696/221551911 [======>.......................] - ETA: 37s
 58531840/221551911 [======>.......................] - ETA: 37s
 58793984/221551911 [======>.......................] - ETA: 36s
 59056128/221551911 [======>.......................] - ETA: 36s
 59318272/221551911 [=======>......................] - ETA: 36s
 59580416/221551911 [=======>......................] - ETA: 36s
 59842560/221551911 [=======>......................] - ETA: 36s
 60104704/221551911 [=======>......................] - ETA: 36s
 60366848/221551911 [=======>......................] - ETA: 36s
 60628992/221551911 [=======>......................] - ETA: 36s
 60891136/221551911 [=======>......................] - ETA: 36s
 61153280/221551911 [=======>......................] - ETA: 36s
 61415424/221551911 [=======>......................] - ETA: 36s
 61677568/221551911 [=======>......................] - ETA: 36s
 61939712/221551911 [=======>......................] - ETA: 36s
 62201856/221551911 [=======>......................] - ETA: 36s
 62464000/221551911 [=======>......................] - ETA: 36s
 62726144/221551911 [=======>......................] - ETA: 35s
 62988288/221551911 [=======>......................] - ETA: 35s
 63250432/221551911 [=======>......................] - ETA: 35s
 63512576/221551911 [=======>......................] - ETA: 35s
 63774720/221551911 [=======>......................] - ETA: 35s
 64036864/221551911 [=======>......................] - ETA: 35s
 64299008/221551911 [=======>......................] - ETA: 35s
 64561152/221551911 [=======>......................] - ETA: 35s
 64823296/221551911 [=======>......................] - ETA: 35s
 65085440/221551911 [=======>......................] - ETA: 35s
 65347584/221551911 [=======>......................] - ETA: 35s
 65609728/221551911 [=======>......................] - ETA: 35s
 65871872/221551911 [=======>......................] - ETA: 35s
 66134016/221551911 [=======>......................] - ETA: 35s
 66396160/221551911 [=======>......................] - ETA: 35s
 66658304/221551911 [========>.....................] - ETA: 35s
 66920448/221551911 [========>.....................] - ETA: 34s
 67182592/221551911 [========>.....................] - ETA: 34s
 67444736/221551911 [========>.....................] - ETA: 34s
 67706880/221551911 [========>.....................] - ETA: 34s
 67969024/221551911 [========>.....................] - ETA: 34s
 68231168/221551911 [========>.....................] - ETA: 34s
 68493312/221551911 [========>.....................] - ETA: 34s
 68755456/221551911 [========>.....................] - ETA: 34s
 69017600/221551911 [========>.....................] - ETA: 34s
 69279744/221551911 [========>.....................] - ETA: 34s
 69541888/221551911 [========>.....................] - ETA: 34s
 69804032/221551911 [========>.....................] - ETA: 34s
 70066176/221551911 [========>.....................] - ETA: 34s
 70328320/221551911 [========>.....................] - ETA: 34s
 70590464/221551911 [========>.....................] - ETA: 34s
 70852608/221551911 [========>.....................] - ETA: 34s
 71114752/221551911 [========>.....................] - ETA: 33s
 71376896/221551911 [========>.....................] - ETA: 33s
 71639040/221551911 [========>.....................] - ETA: 33s
 71901184/221551911 [========>.....................] - ETA: 33s
 72163328/221551911 [========>.....................] - ETA: 33s
 72425472/221551911 [========>.....................] - ETA: 33s
 72687616/221551911 [========>.....................] - ETA: 33s
 72949760/221551911 [========>.....................] - ETA: 33s
 73211904/221551911 [========>.....................] - ETA: 33s
 73474048/221551911 [========>.....................] - ETA: 33s
 73736192/221551911 [========>.....................] - ETA: 33s
 73998336/221551911 [=========>....................] - ETA: 33s
 74260480/221551911 [=========>....................] - ETA: 33s
 74522624/221551911 [=========>....................] - ETA: 33s
 74784768/221551911 [=========>....................] - ETA: 33s
 75046912/221551911 [=========>....................] - ETA: 33s
 75309056/221551911 [=========>....................] - ETA: 32s
 75571200/221551911 [=========>....................] - ETA: 32s
 75833344/221551911 [=========>....................] - ETA: 32s
 76095488/221551911 [=========>....................] - ETA: 32s
 76357632/221551911 [=========>....................] - ETA: 32s
 76619776/221551911 [=========>....................] - ETA: 32s
 76881920/221551911 [=========>....................] - ETA: 32s
 77144064/221551911 [=========>....................] - ETA: 32s
 77406208/221551911 [=========>....................] - ETA: 32s
 77668352/221551911 [=========>....................] - ETA: 32s
 77930496/221551911 [=========>....................] - ETA: 32s
 78192640/221551911 [=========>....................] - ETA: 32s
 78454784/221551911 [=========>....................] - ETA: 32s
 78716928/221551911 [=========>....................] - ETA: 32s
 78979072/221551911 [=========>....................] - ETA: 32s
 79241216/221551911 [=========>....................] - ETA: 32s
 79503360/221551911 [=========>....................] - ETA: 31s
 79765504/221551911 [=========>....................] - ETA: 31s
 80027648/221551911 [=========>....................] - ETA: 31s
 80289792/221551911 [=========>....................] - ETA: 31s
 80551936/221551911 [=========>....................] - ETA: 31s
 80814080/221551911 [=========>....................] - ETA: 31s
 81076224/221551911 [=========>....................] - ETA: 31s
 81338368/221551911 [==========>...................] - ETA: 31s
 81600512/221551911 [==========>...................] - ETA: 31s
 81862656/221551911 [==========>...................] - ETA: 31s
 82124800/221551911 [==========>...................] - ETA: 31s
 82386944/221551911 [==========>...................] - ETA: 31s
 82649088/221551911 [==========>...................] - ETA: 31s
 82911232/221551911 [==========>...................] - ETA: 31s
 83173376/221551911 [==========>...................] - ETA: 31s
 83435520/221551911 [==========>...................] - ETA: 31s
 83697664/221551911 [==========>...................] - ETA: 30s
 83959808/221551911 [==========>...................] - ETA: 30s
 84221952/221551911 [==========>...................] - ETA: 30s
 84484096/221551911 [==========>...................] - ETA: 30s
 84746240/221551911 [==========>...................] - ETA: 30s
 85008384/221551911 [==========>...................] - ETA: 30s
 85270528/221551911 [==========>...................] - ETA: 30s
 85532672/221551911 [==========>...................] - ETA: 30s
 85794816/221551911 [==========>...................] - ETA: 30s
 86056960/221551911 [==========>...................] - ETA: 30s
 86319104/221551911 [==========>...................] - ETA: 30s
 86581248/221551911 [==========>...................] - ETA: 30s
 86843392/221551911 [==========>...................] - ETA: 30s
 87105536/221551911 [==========>...................] - ETA: 30s
 87367680/221551911 [==========>...................] - ETA: 30s
 87629824/221551911 [==========>...................] - ETA: 30s
 87891968/221551911 [==========>...................] - ETA: 30s
 88154112/221551911 [==========>...................] - ETA: 29s
 88416256/221551911 [==========>...................] - ETA: 29s
 88678400/221551911 [===========>..................] - ETA: 29s
 88940544/221551911 [===========>..................] - ETA: 29s
 89063424/221551911 [===========>..................] - ETA: 29s
 89268224/221551911 [===========>..................] - ETA: 29s
 89530368/221551911 [===========>..................] - ETA: 29s
 89792512/221551911 [===========>..................] - ETA: 29s
 90054656/221551911 [===========>..................] - ETA: 29s
 90316800/221551911 [===========>..................] - ETA: 29s
 90578944/221551911 [===========>..................] - ETA: 29s
 90841088/221551911 [===========>..................] - ETA: 29s
 91103232/221551911 [===========>..................] - ETA: 29s
 91365376/221551911 [===========>..................] - ETA: 29s
 91627520/221551911 [===========>..................] - ETA: 29s
 91889664/221551911 [===========>..................] - ETA: 29s
 92151808/221551911 [===========>..................] - ETA: 29s
 92413952/221551911 [===========>..................] - ETA: 29s
 92676096/221551911 [===========>..................] - ETA: 28s
 92938240/221551911 [===========>..................] - ETA: 28s
 93200384/221551911 [===========>..................] - ETA: 28s
 93462528/221551911 [===========>..................] - ETA: 28s
 93724672/221551911 [===========>..................] - ETA: 28s
 93986816/221551911 [===========>..................] - ETA: 28s
 94248960/221551911 [===========>..................] - ETA: 28s
 94511104/221551911 [===========>..................] - ETA: 28s
 94773248/221551911 [===========>..................] - ETA: 28s
 95035392/221551911 [===========>..................] - ETA: 28s
 95297536/221551911 [===========>..................] - ETA: 28s
 95559680/221551911 [===========>..................] - ETA: 28s
 95821824/221551911 [===========>..................] - ETA: 28s
 96083968/221551911 [============>.................] - ETA: 28s
 96346112/221551911 [============>.................] - ETA: 28s
 96608256/221551911 [============>.................] - ETA: 28s
 96870400/221551911 [============>.................] - ETA: 27s
 97132544/221551911 [============>.................] - ETA: 27s
 97394688/221551911 [============>.................] - ETA: 27s
 97656832/221551911 [============>.................] - ETA: 27s
 97918976/221551911 [============>.................] - ETA: 27s
 98181120/221551911 [============>.................] - ETA: 27s
 98443264/221551911 [============>.................] - ETA: 27s
 98705408/221551911 [============>.................] - ETA: 27s
 98967552/221551911 [============>.................] - ETA: 27s
 99229696/221551911 [============>.................] - ETA: 27s
 99491840/221551911 [============>.................] - ETA: 27s
 99753984/221551911 [============>.................] - ETA: 27s
100016128/221551911 [============>.................] - ETA: 27s
100278272/221551911 [============>.................] - ETA: 27s
100540416/221551911 [============>.................] - ETA: 27s
100802560/221551911 [============>.................] - ETA: 27s
101064704/221551911 [============>.................] - ETA: 27s
101326848/221551911 [============>.................] - ETA: 26s
101588992/221551911 [============>.................] - ETA: 26s
101851136/221551911 [============>.................] - ETA: 26s
102113280/221551911 [============>.................] - ETA: 26s
102375424/221551911 [============>.................] - ETA: 26s
102637568/221551911 [============>.................] - ETA: 26s
102899712/221551911 [============>.................] - ETA: 26s
103161856/221551911 [============>.................] - ETA: 26s
103424000/221551911 [=============>................] - ETA: 26s
103686144/221551911 [=============>................] - ETA: 26s
103948288/221551911 [=============>................] - ETA: 26s
104210432/221551911 [=============>................] - ETA: 26s
104472576/221551911 [=============>................] - ETA: 26s
104734720/221551911 [=============>................] - ETA: 26s
104996864/221551911 [=============>................] - ETA: 26s
105259008/221551911 [=============>................] - ETA: 26s
105521152/221551911 [=============>................] - ETA: 26s
105783296/221551911 [=============>................] - ETA: 25s
106045440/221551911 [=============>................] - ETA: 25s
106307584/221551911 [=============>................] - ETA: 25s
106569728/221551911 [=============>................] - ETA: 25s
106831872/221551911 [=============>................] - ETA: 25s
107094016/221551911 [=============>................] - ETA: 25s
107356160/221551911 [=============>................] - ETA: 25s
107618304/221551911 [=============>................] - ETA: 25s
107880448/221551911 [=============>................] - ETA: 25s
108142592/221551911 [=============>................] - ETA: 25s
108404736/221551911 [=============>................] - ETA: 25s
108666880/221551911 [=============>................] - ETA: 25s
108929024/221551911 [=============>................] - ETA: 25s
109191168/221551911 [=============>................] - ETA: 25s
109453312/221551911 [=============>................] - ETA: 25s
109715456/221551911 [=============>................] - ETA: 25s
109977600/221551911 [=============>................] - ETA: 24s
110239744/221551911 [=============>................] - ETA: 24s
110501888/221551911 [=============>................] - ETA: 24s
110764032/221551911 [=============>................] - ETA: 24s
111026176/221551911 [==============>...............] - ETA: 24s
111288320/221551911 [==============>...............] - ETA: 24s
111550464/221551911 [==============>...............] - ETA: 24s
111812608/221551911 [==============>...............] - ETA: 24s
112074752/221551911 [==============>...............] - ETA: 24s
112336896/221551911 [==============>...............] - ETA: 24s
112599040/221551911 [==============>...............] - ETA: 24s
112861184/221551911 [==============>...............] - ETA: 24s
113123328/221551911 [==============>...............] - ETA: 24s
113385472/221551911 [==============>...............] - ETA: 24s
113647616/221551911 [==============>...............] - ETA: 24s
113909760/221551911 [==============>...............] - ETA: 24s
114171904/221551911 [==============>...............] - ETA: 24s
114434048/221551911 [==============>...............] - ETA: 23s
114696192/221551911 [==============>...............] - ETA: 23s
114958336/221551911 [==============>...............] - ETA: 23s
115220480/221551911 [==============>...............] - ETA: 23s
115482624/221551911 [==============>...............] - ETA: 23s
115744768/221551911 [==============>...............] - ETA: 23s
116006912/221551911 [==============>...............] - ETA: 23s
116269056/221551911 [==============>...............] - ETA: 23s
116531200/221551911 [==============>...............] - ETA: 23s
116793344/221551911 [==============>...............] - ETA: 23s
117055488/221551911 [==============>...............] - ETA: 23s
117317632/221551911 [==============>...............] - ETA: 23s
117579776/221551911 [==============>...............] - ETA: 23s
117841920/221551911 [==============>...............] - ETA: 23s
118104064/221551911 [==============>...............] - ETA: 23s
118366208/221551911 [===============>..............] - ETA: 23s
118628352/221551911 [===============>..............] - ETA: 23s
118890496/221551911 [===============>..............] - ETA: 22s
119152640/221551911 [===============>..............] - ETA: 22s
119414784/221551911 [===============>..............] - ETA: 22s
119676928/221551911 [===============>..............] - ETA: 22s
119939072/221551911 [===============>..............] - ETA: 22s
120201216/221551911 [===============>..............] - ETA: 22s
120463360/221551911 [===============>..............] - ETA: 22s
120725504/221551911 [===============>..............] - ETA: 22s
120987648/221551911 [===============>..............] - ETA: 22s
121249792/221551911 [===============>..............] - ETA: 22s
121511936/221551911 [===============>..............] - ETA: 22s
121774080/221551911 [===============>..............] - ETA: 22s
122036224/221551911 [===============>..............] - ETA: 22s
122298368/221551911 [===============>..............] - ETA: 22s
122560512/221551911 [===============>..............] - ETA: 22s
122822656/221551911 [===============>..............] - ETA: 22s
123084800/221551911 [===============>..............] - ETA: 22s
123346944/221551911 [===============>..............] - ETA: 21s
123609088/221551911 [===============>..............] - ETA: 21s
123871232/221551911 [===============>..............] - ETA: 21s
124133376/221551911 [===============>..............] - ETA: 21s
124395520/221551911 [===============>..............] - ETA: 21s
124657664/221551911 [===============>..............] - ETA: 21s
124919808/221551911 [===============>..............] - ETA: 21s
125181952/221551911 [===============>..............] - ETA: 21s
125444096/221551911 [===============>..............] - ETA: 21s
125706240/221551911 [================>.............] - ETA: 21s
125968384/221551911 [================>.............] - ETA: 21s
126230528/221551911 [================>.............] - ETA: 21s
126492672/221551911 [================>.............] - ETA: 21s
126754816/221551911 [================>.............] - ETA: 21s
127016960/221551911 [================>.............] - ETA: 21s
127279104/221551911 [================>.............] - ETA: 21s
127541248/221551911 [================>.............] - ETA: 20s
127803392/221551911 [================>.............] - ETA: 20s
128065536/221551911 [================>.............] - ETA: 20s
128327680/221551911 [================>.............] - ETA: 20s
128589824/221551911 [================>.............] - ETA: 20s
128851968/221551911 [================>.............] - ETA: 20s
129114112/221551911 [================>.............] - ETA: 20s
129376256/221551911 [================>.............] - ETA: 20s
129638400/221551911 [================>.............] - ETA: 20s
129900544/221551911 [================>.............] - ETA: 20s
130162688/221551911 [================>.............] - ETA: 20s
130424832/221551911 [================>.............] - ETA: 20s
130686976/221551911 [================>.............] - ETA: 20s
130949120/221551911 [================>.............] - ETA: 20s
131211264/221551911 [================>.............] - ETA: 20s
131473408/221551911 [================>.............] - ETA: 20s
131735552/221551911 [================>.............] - ETA: 20s
131997696/221551911 [================>.............] - ETA: 19s
132259840/221551911 [================>.............] - ETA: 19s
132521984/221551911 [================>.............] - ETA: 19s
132784128/221551911 [================>.............] - ETA: 19s
133046272/221551911 [=================>............] - ETA: 19s
133308416/221551911 [=================>............] - ETA: 19s
133570560/221551911 [=================>............] - ETA: 19s
133832704/221551911 [=================>............] - ETA: 19s
134094848/221551911 [=================>............] - ETA: 19s
134356992/221551911 [=================>............] - ETA: 19s
134619136/221551911 [=================>............] - ETA: 19s
134881280/221551911 [=================>............] - ETA: 19s
135143424/221551911 [=================>............] - ETA: 19s
135405568/221551911 [=================>............] - ETA: 19s
135667712/221551911 [=================>............] - ETA: 19s
135929856/221551911 [=================>............] - ETA: 19s
136192000/221551911 [=================>............] - ETA: 19s
136454144/221551911 [=================>............] - ETA: 18s
136716288/221551911 [=================>............] - ETA: 18s
136978432/221551911 [=================>............] - ETA: 18s
137240576/221551911 [=================>............] - ETA: 18s
137502720/221551911 [=================>............] - ETA: 18s
137764864/221551911 [=================>............] - ETA: 18s
138027008/221551911 [=================>............] - ETA: 18s
138289152/221551911 [=================>............] - ETA: 18s
138551296/221551911 [=================>............] - ETA: 18s
138813440/221551911 [=================>............] - ETA: 18s
139075584/221551911 [=================>............] - ETA: 18s
139337728/221551911 [=================>............] - ETA: 18s
139599872/221551911 [=================>............] - ETA: 18s
139862016/221551911 [=================>............] - ETA: 18s
140124160/221551911 [=================>............] - ETA: 18s
140386304/221551911 [==================>...........] - ETA: 18s
140648448/221551911 [==================>...........] - ETA: 18s
140910592/221551911 [==================>...........] - ETA: 17s
141172736/221551911 [==================>...........] - ETA: 17s
141434880/221551911 [==================>...........] - ETA: 17s
141697024/221551911 [==================>...........] - ETA: 17s
141959168/221551911 [==================>...........] - ETA: 17s
142221312/221551911 [==================>...........] - ETA: 17s
142483456/221551911 [==================>...........] - ETA: 17s
142745600/221551911 [==================>...........] - ETA: 17s
143007744/221551911 [==================>...........] - ETA: 17s
143269888/221551911 [==================>...........] - ETA: 17s
143532032/221551911 [==================>...........] - ETA: 17s
143794176/221551911 [==================>...........] - ETA: 17s
144056320/221551911 [==================>...........] - ETA: 17s
144318464/221551911 [==================>...........] - ETA: 17s
144580608/221551911 [==================>...........] - ETA: 17s
144842752/221551911 [==================>...........] - ETA: 17s
145104896/221551911 [==================>...........] - ETA: 17s
145367040/221551911 [==================>...........] - ETA: 16s
145629184/221551911 [==================>...........] - ETA: 16s
145891328/221551911 [==================>...........] - ETA: 16s
146153472/221551911 [==================>...........] - ETA: 16s
146415616/221551911 [==================>...........] - ETA: 16s
146677760/221551911 [==================>...........] - ETA: 16s
146939904/221551911 [==================>...........] - ETA: 16s
147202048/221551911 [==================>...........] - ETA: 16s
147464192/221551911 [==================>...........] - ETA: 16s
147726336/221551911 [===================>..........] - ETA: 16s
147988480/221551911 [===================>..........] - ETA: 16s
148250624/221551911 [===================>..........] - ETA: 16s
148512768/221551911 [===================>..........] - ETA: 16s
148774912/221551911 [===================>..........] - ETA: 16s
149037056/221551911 [===================>..........] - ETA: 16s
149299200/221551911 [===================>..........] - ETA: 16s
149561344/221551911 [===================>..........] - ETA: 16s
149823488/221551911 [===================>..........] - ETA: 15s
150085632/221551911 [===================>..........] - ETA: 15s
150347776/221551911 [===================>..........] - ETA: 15s
150609920/221551911 [===================>..........] - ETA: 15s
150872064/221551911 [===================>..........] - ETA: 15s
151134208/221551911 [===================>..........] - ETA: 15s
151396352/221551911 [===================>..........] - ETA: 15s
151658496/221551911 [===================>..........] - ETA: 15s
151920640/221551911 [===================>..........] - ETA: 15s
152182784/221551911 [===================>..........] - ETA: 15s
152444928/221551911 [===================>..........] - ETA: 15s
152707072/221551911 [===================>..........] - ETA: 15s
152969216/221551911 [===================>..........] - ETA: 15s
153231360/221551911 [===================>..........] - ETA: 15s
153493504/221551911 [===================>..........] - ETA: 15s
153755648/221551911 [===================>..........] - ETA: 15s
154017792/221551911 [===================>..........] - ETA: 15s
154279936/221551911 [===================>..........] - ETA: 14s
154542080/221551911 [===================>..........] - ETA: 14s
154804224/221551911 [===================>..........] - ETA: 14s
155066368/221551911 [===================>..........] - ETA: 14s
155328512/221551911 [====================>.........] - ETA: 14s
155590656/221551911 [====================>.........] - ETA: 14s
155852800/221551911 [====================>.........] - ETA: 14s
156114944/221551911 [====================>.........] - ETA: 14s
156377088/221551911 [====================>.........] - ETA: 14s
156639232/221551911 [====================>.........] - ETA: 14s
156901376/221551911 [====================>.........] - ETA: 14s
157163520/221551911 [====================>.........] - ETA: 14s
157425664/221551911 [====================>.........] - ETA: 14s
157687808/221551911 [====================>.........] - ETA: 14s
157949952/221551911 [====================>.........] - ETA: 14s
158212096/221551911 [====================>.........] - ETA: 14s
158474240/221551911 [====================>.........] - ETA: 14s
158736384/221551911 [====================>.........] - ETA: 13s
158998528/221551911 [====================>.........] - ETA: 13s
159260672/221551911 [====================>.........] - ETA: 13s
159522816/221551911 [====================>.........] - ETA: 13s
159784960/221551911 [====================>.........] - ETA: 13s
160047104/221551911 [====================>.........] - ETA: 13s
160309248/221551911 [====================>.........] - ETA: 13s
160571392/221551911 [====================>.........] - ETA: 13s
160833536/221551911 [====================>.........] - ETA: 13s
161095680/221551911 [====================>.........] - ETA: 13s
161357824/221551911 [====================>.........] - ETA: 13s
161619968/221551911 [====================>.........] - ETA: 13s
161742848/221551911 [====================>.........] - ETA: 13s
161947648/221551911 [====================>.........] - ETA: 13s
162209792/221551911 [====================>.........] - ETA: 13s
162471936/221551911 [=====================>........] - ETA: 13s
162734080/221551911 [=====================>........] - ETA: 13s
162996224/221551911 [=====================>........] - ETA: 13s
163258368/221551911 [=====================>........] - ETA: 12s
163520512/221551911 [=====================>........] - ETA: 12s
163782656/221551911 [=====================>........] - ETA: 12s
164044800/221551911 [=====================>........] - ETA: 12s
164306944/221551911 [=====================>........] - ETA: 12s
164569088/221551911 [=====================>........] - ETA: 12s
164831232/221551911 [=====================>........] - ETA: 12s
165093376/221551911 [=====================>........] - ETA: 12s
165355520/221551911 [=====================>........] - ETA: 12s
165617664/221551911 [=====================>........] - ETA: 12s
165879808/221551911 [=====================>........] - ETA: 12s
166141952/221551911 [=====================>........] - ETA: 12s
166404096/221551911 [=====================>........] - ETA: 12s
166666240/221551911 [=====================>........] - ETA: 12s
166928384/221551911 [=====================>........] - ETA: 12s
167190528/221551911 [=====================>........] - ETA: 12s
167452672/221551911 [=====================>........] - ETA: 12s
167714816/221551911 [=====================>........] - ETA: 11s
167976960/221551911 [=====================>........] - ETA: 11s
168239104/221551911 [=====================>........] - ETA: 11s
168501248/221551911 [=====================>........] - ETA: 11s
168763392/221551911 [=====================>........] - ETA: 11s
169025536/221551911 [=====================>........] - ETA: 11s
169287680/221551911 [=====================>........] - ETA: 11s
169549824/221551911 [=====================>........] - ETA: 11s
169811968/221551911 [=====================>........] - ETA: 11s
170074112/221551911 [======================>.......] - ETA: 11s
170336256/221551911 [======================>.......] - ETA: 11s
170598400/221551911 [======================>.......] - ETA: 11s
170860544/221551911 [======================>.......] - ETA: 11s
171122688/221551911 [======================>.......] - ETA: 11s
171384832/221551911 [======================>.......] - ETA: 11s
171646976/221551911 [======================>.......] - ETA: 11s
171909120/221551911 [======================>.......] - ETA: 11s
172171264/221551911 [======================>.......] - ETA: 10s
172433408/221551911 [======================>.......] - ETA: 10s
172695552/221551911 [======================>.......] - ETA: 10s
172957696/221551911 [======================>.......] - ETA: 10s
173219840/221551911 [======================>.......] - ETA: 10s
173481984/221551911 [======================>.......] - ETA: 10s
173744128/221551911 [======================>.......] - ETA: 10s
174006272/221551911 [======================>.......] - ETA: 10s
174268416/221551911 [======================>.......] - ETA: 10s
174530560/221551911 [======================>.......] - ETA: 10s
174792704/221551911 [======================>.......] - ETA: 10s
175054848/221551911 [======================>.......] - ETA: 10s
175316992/221551911 [======================>.......] - ETA: 10s
175579136/221551911 [======================>.......] - ETA: 10s
175841280/221551911 [======================>.......] - ETA: 10s
176103424/221551911 [======================>.......] - ETA: 10s
176365568/221551911 [======================>.......] - ETA: 10s
176627712/221551911 [======================>.......] - ETA: 9s 
176889856/221551911 [======================>.......] - ETA: 9s
177152000/221551911 [======================>.......] - ETA: 9s
177414144/221551911 [=======================>......] - ETA: 9s
177676288/221551911 [=======================>......] - ETA: 9s
177938432/221551911 [=======================>......] - ETA: 9s
178200576/221551911 [=======================>......] - ETA: 9s
178462720/221551911 [=======================>......] - ETA: 9s
178724864/221551911 [=======================>......] - ETA: 9s
178987008/221551911 [=======================>......] - ETA: 9s
179249152/221551911 [=======================>......] - ETA: 9s
179511296/221551911 [=======================>......] - ETA: 9s
179773440/221551911 [=======================>......] - ETA: 9s
180035584/221551911 [=======================>......] - ETA: 9s
180297728/221551911 [=======================>......] - ETA: 9s
180559872/221551911 [=======================>......] - ETA: 9s
180822016/221551911 [=======================>......] - ETA: 9s
181084160/221551911 [=======================>......] - ETA: 9s
181346304/221551911 [=======================>......] - ETA: 8s
181608448/221551911 [=======================>......] - ETA: 8s
181870592/221551911 [=======================>......] - ETA: 8s
182132736/221551911 [=======================>......] - ETA: 8s
182394880/221551911 [=======================>......] - ETA: 8s
182657024/221551911 [=======================>......] - ETA: 8s
182919168/221551911 [=======================>......] - ETA: 8s
183181312/221551911 [=======================>......] - ETA: 8s
183443456/221551911 [=======================>......] - ETA: 8s
183705600/221551911 [=======================>......] - ETA: 8s
183967744/221551911 [=======================>......] - ETA: 8s
184229888/221551911 [=======================>......] - ETA: 8s
184492032/221551911 [=======================>......] - ETA: 8s
184754176/221551911 [========================>.....] - ETA: 8s
185016320/221551911 [========================>.....] - ETA: 8s
185278464/221551911 [========================>.....] - ETA: 8s
185540608/221551911 [========================>.....] - ETA: 8s
185802752/221551911 [========================>.....] - ETA: 7s
186064896/221551911 [========================>.....] - ETA: 7s
186327040/221551911 [========================>.....] - ETA: 7s
186589184/221551911 [========================>.....] - ETA: 7s
186851328/221551911 [========================>.....] - ETA: 7s
187113472/221551911 [========================>.....] - ETA: 7s
187375616/221551911 [========================>.....] - ETA: 7s
187637760/221551911 [========================>.....] - ETA: 7s
187899904/221551911 [========================>.....] - ETA: 7s
188162048/221551911 [========================>.....] - ETA: 7s
188424192/221551911 [========================>.....] - ETA: 7s
188686336/221551911 [========================>.....] - ETA: 7s
188948480/221551911 [========================>.....] - ETA: 7s
189210624/221551911 [========================>.....] - ETA: 7s
189472768/221551911 [========================>.....] - ETA: 7s
189734912/221551911 [========================>.....] - ETA: 7s
189997056/221551911 [========================>.....] - ETA: 7s
190259200/221551911 [========================>.....] - ETA: 6s
190521344/221551911 [========================>.....] - ETA: 6s
190783488/221551911 [========================>.....] - ETA: 6s
191045632/221551911 [========================>.....] - ETA: 6s
191307776/221551911 [========================>.....] - ETA: 6s
191569920/221551911 [========================>.....] - ETA: 6s
191832064/221551911 [========================>.....] - ETA: 6s
192094208/221551911 [=========================>....] - ETA: 6s
192356352/221551911 [=========================>....] - ETA: 6s
192618496/221551911 [=========================>....] - ETA: 6s
192880640/221551911 [=========================>....] - ETA: 6s
193142784/221551911 [=========================>....] - ETA: 6s
193404928/221551911 [=========================>....] - ETA: 6s
193667072/221551911 [=========================>....] - ETA: 6s
193929216/221551911 [=========================>....] - ETA: 6s
194191360/221551911 [=========================>....] - ETA: 6s
194453504/221551911 [=========================>....] - ETA: 6s
194715648/221551911 [=========================>....] - ETA: 5s
194977792/221551911 [=========================>....] - ETA: 5s
195239936/221551911 [=========================>....] - ETA: 5s
195502080/221551911 [=========================>....] - ETA: 5s
195764224/221551911 [=========================>....] - ETA: 5s
196026368/221551911 [=========================>....] - ETA: 5s
196288512/221551911 [=========================>....] - ETA: 5s
196550656/221551911 [=========================>....] - ETA: 5s
196812800/221551911 [=========================>....] - ETA: 5s
197074944/221551911 [=========================>....] - ETA: 5s
197337088/221551911 [=========================>....] - ETA: 5s
197599232/221551911 [=========================>....] - ETA: 5s
197861376/221551911 [=========================>....] - ETA: 5s
198123520/221551911 [=========================>....] - ETA: 5s
198385664/221551911 [=========================>....] - ETA: 5s
198647808/221551911 [=========================>....] - ETA: 5s
198909952/221551911 [=========================>....] - ETA: 5s
199172096/221551911 [=========================>....] - ETA: 4s
199434240/221551911 [==========================>...] - ETA: 4s
199696384/221551911 [==========================>...] - ETA: 4s
199958528/221551911 [==========================>...] - ETA: 4s
200220672/221551911 [==========================>...] - ETA: 4s
200482816/221551911 [==========================>...] - ETA: 4s
200744960/221551911 [==========================>...] - ETA: 4s
201007104/221551911 [==========================>...] - ETA: 4s
201269248/221551911 [==========================>...] - ETA: 4s
201531392/221551911 [==========================>...] - ETA: 4s
201793536/221551911 [==========================>...] - ETA: 4s
202055680/221551911 [==========================>...] - ETA: 4s
202317824/221551911 [==========================>...] - ETA: 4s
202579968/221551911 [==========================>...] - ETA: 4s
202842112/221551911 [==========================>...] - ETA: 4s
203104256/221551911 [==========================>...] - ETA: 4s
203366400/221551911 [==========================>...] - ETA: 4s
203628544/221551911 [==========================>...] - ETA: 3s
203890688/221551911 [==========================>...] - ETA: 3s
204152832/221551911 [==========================>...] - ETA: 3s
204414976/221551911 [==========================>...] - ETA: 3s
204677120/221551911 [==========================>...] - ETA: 3s
204939264/221551911 [==========================>...] - ETA: 3s
205201408/221551911 [==========================>...] - ETA: 3s
205463552/221551911 [==========================>...] - ETA: 3s
205725696/221551911 [==========================>...] - ETA: 3s
205987840/221551911 [==========================>...] - ETA: 3s
206249984/221551911 [==========================>...] - ETA: 3s
206512128/221551911 [==========================>...] - ETA: 3s
206774272/221551911 [==========================>...] - ETA: 3s
207036416/221551911 [===========================>..] - ETA: 3s
207298560/221551911 [===========================>..] - ETA: 3s
207560704/221551911 [===========================>..] - ETA: 3s
207822848/221551911 [===========================>..] - ETA: 3s
208084992/221551911 [===========================>..] - ETA: 2s
208347136/221551911 [===========================>..] - ETA: 2s
208609280/221551911 [===========================>..] - ETA: 2s
208871424/221551911 [===========================>..] - ETA: 2s
209133568/221551911 [===========================>..] - ETA: 2s
209395712/221551911 [===========================>..] - ETA: 2s
209657856/221551911 [===========================>..] - ETA: 2s
209920000/221551911 [===========================>..] - ETA: 2s
210182144/221551911 [===========================>..] - ETA: 2s
210444288/221551911 [===========================>..] - ETA: 2s
210706432/221551911 [===========================>..] - ETA: 2s
210968576/221551911 [===========================>..] - ETA: 2s
211230720/221551911 [===========================>..] - ETA: 2s
211492864/221551911 [===========================>..] - ETA: 2s
211755008/221551911 [===========================>..] - ETA: 2s
212017152/221551911 [===========================>..] - ETA: 2s
212279296/221551911 [===========================>..] - ETA: 2s
212541440/221551911 [===========================>..] - ETA: 2s
212803584/221551911 [===========================>..] - ETA: 1s
213065728/221551911 [===========================>..] - ETA: 1s
213327872/221551911 [===========================>..] - ETA: 1s
213590016/221551911 [===========================>..] - ETA: 1s
213852160/221551911 [===========================>..] - ETA: 1s
214114304/221551911 [===========================>..] - ETA: 1s
214376448/221551911 [============================>.] - ETA: 1s
214638592/221551911 [============================>.] - ETA: 1s
214900736/221551911 [============================>.] - ETA: 1s
215162880/221551911 [============================>.] - ETA: 1s
215425024/221551911 [============================>.] - ETA: 1s
215687168/221551911 [============================>.] - ETA: 1s
215949312/221551911 [============================>.] - ETA: 1s
216211456/221551911 [============================>.] - ETA: 1s
216473600/221551911 [============================>.] - ETA: 1s
216735744/221551911 [============================>.] - ETA: 1s
216997888/221551911 [============================>.] - ETA: 1s
217260032/221551911 [============================>.] - ETA: 0s
217522176/221551911 [============================>.] - ETA: 0s
217784320/221551911 [============================>.] - ETA: 0s
218046464/221551911 [============================>.] - ETA: 0s
218308608/221551911 [============================>.] - ETA: 0s
218570752/221551911 [============================>.] - ETA: 0s
218832896/221551911 [============================>.] - ETA: 0s
219095040/221551911 [============================>.] - ETA: 0s
219357184/221551911 [============================>.] - ETA: 0s
219619328/221551911 [============================>.] - ETA: 0s
219881472/221551911 [============================>.] - ETA: 0s
220143616/221551911 [============================>.] - ETA: 0s
220405760/221551911 [============================>.] - ETA: 0s
220667904/221551911 [============================>.] - ETA: 0s
220930048/221551911 [============================>.] - ETA: 0s
221192192/221551911 [============================>.] - ETA: 0s
221454336/221551911 [============================>.] - ETA: 0s
221552640/221551911 [==============================] - 49s 0us/step

221560832/221551911 [==============================] - 49s 0us/step
Loaded VOC2007 test data for car and person classes: 2500 images.

Anchors can also be computed easily using YOLO toolkit.

Note

The following code is given as an example. In a real use case scenario, anchors are computed on the training dataset.

from akida_models.detection.generate_anchors import generate_anchors

num_anchors = 5
grid_size = (7, 7)
anchors_example = generate_anchors(val_data, num_anchors, grid_size)

Out:

Average IOU for 5 anchors: 0.61
Anchors:  [[0.63263, 1.13864], [1.29467, 2.90717], [2.26527, 2.97757], [3.80627, 5.03516], [5.21984, 5.79988]]

3. Model architecture

The model zoo contains a YOLO model that is built upon the MobileNet architecture and 3 separable convolutional layers at the top for bounding box and class estimation followed by a final separable convolutional which is the detection layer. Note that for efficiency, the alpha parameter in MobileNet (network width or number of filter in each layer) is set to 0.5.

from akida_models import yolo_base

# Create a yolo model for 2 classes with 5 anchors and grid size of 7
classes = 2

model = yolo_base(input_shape=(224, 224, 3),
                  classes=classes,
                  nb_box=num_anchors,
                  alpha=0.5)
model.summary()

Out:

Model: "yolo_base"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
input_32 (InputLayer)        [(None, 224, 224, 3)]     0
_________________________________________________________________
rescaling_1 (Rescaling)      (None, 224, 224, 3)       0
_________________________________________________________________
conv_0 (Conv2D)              (None, 112, 112, 16)      432
_________________________________________________________________
conv_0_BN (BatchNormalizatio (None, 112, 112, 16)      64
_________________________________________________________________
conv_0_relu (ReLU)           (None, 112, 112, 16)      0
_________________________________________________________________
separable_1 (SeparableConv2D (None, 112, 112, 32)      656
_________________________________________________________________
separable_1_BN (BatchNormali (None, 112, 112, 32)      128
_________________________________________________________________
separable_1_relu (ReLU)      (None, 112, 112, 32)      0
_________________________________________________________________
separable_2 (SeparableConv2D (None, 112, 112, 64)      2336
_________________________________________________________________
separable_2_maxpool (MaxPool (None, 56, 56, 64)        0
_________________________________________________________________
separable_2_BN (BatchNormali (None, 56, 56, 64)        256
_________________________________________________________________
separable_2_relu (ReLU)      (None, 56, 56, 64)        0
_________________________________________________________________
separable_3 (SeparableConv2D (None, 56, 56, 64)        4672
_________________________________________________________________
separable_3_BN (BatchNormali (None, 56, 56, 64)        256
_________________________________________________________________
separable_3_relu (ReLU)      (None, 56, 56, 64)        0
_________________________________________________________________
separable_4 (SeparableConv2D (None, 56, 56, 128)       8768
_________________________________________________________________
separable_4_maxpool (MaxPool (None, 28, 28, 128)       0
_________________________________________________________________
separable_4_BN (BatchNormali (None, 28, 28, 128)       512
_________________________________________________________________
separable_4_relu (ReLU)      (None, 28, 28, 128)       0
_________________________________________________________________
separable_5 (SeparableConv2D (None, 28, 28, 128)       17536
_________________________________________________________________
separable_5_BN (BatchNormali (None, 28, 28, 128)       512
_________________________________________________________________
separable_5_relu (ReLU)      (None, 28, 28, 128)       0
_________________________________________________________________
separable_6 (SeparableConv2D (None, 28, 28, 256)       33920
_________________________________________________________________
separable_6_maxpool (MaxPool (None, 14, 14, 256)       0
_________________________________________________________________
separable_6_BN (BatchNormali (None, 14, 14, 256)       1024
_________________________________________________________________
separable_6_relu (ReLU)      (None, 14, 14, 256)       0
_________________________________________________________________
separable_7 (SeparableConv2D (None, 14, 14, 256)       67840
_________________________________________________________________
separable_7_BN (BatchNormali (None, 14, 14, 256)       1024
_________________________________________________________________
separable_7_relu (ReLU)      (None, 14, 14, 256)       0
_________________________________________________________________
separable_8 (SeparableConv2D (None, 14, 14, 256)       67840
_________________________________________________________________
separable_8_BN (BatchNormali (None, 14, 14, 256)       1024
_________________________________________________________________
separable_8_relu (ReLU)      (None, 14, 14, 256)       0
_________________________________________________________________
separable_9 (SeparableConv2D (None, 14, 14, 256)       67840
_________________________________________________________________
separable_9_BN (BatchNormali (None, 14, 14, 256)       1024
_________________________________________________________________
separable_9_relu (ReLU)      (None, 14, 14, 256)       0
_________________________________________________________________
separable_10 (SeparableConv2 (None, 14, 14, 256)       67840
_________________________________________________________________
separable_10_BN (BatchNormal (None, 14, 14, 256)       1024
_________________________________________________________________
separable_10_relu (ReLU)     (None, 14, 14, 256)       0
_________________________________________________________________
separable_11 (SeparableConv2 (None, 14, 14, 256)       67840
_________________________________________________________________
separable_11_BN (BatchNormal (None, 14, 14, 256)       1024
_________________________________________________________________
separable_11_relu (ReLU)     (None, 14, 14, 256)       0
_________________________________________________________________
separable_12 (SeparableConv2 (None, 14, 14, 512)       133376
_________________________________________________________________
separable_12_maxpool (MaxPoo (None, 7, 7, 512)         0
_________________________________________________________________
separable_12_BN (BatchNormal (None, 7, 7, 512)         2048
_________________________________________________________________
separable_12_relu (ReLU)     (None, 7, 7, 512)         0
_________________________________________________________________
separable_13 (SeparableConv2 (None, 7, 7, 512)         266752
_________________________________________________________________
separable_13_BN (BatchNormal (None, 7, 7, 512)         2048
_________________________________________________________________
separable_13_relu (ReLU)     (None, 7, 7, 512)         0
_________________________________________________________________
1conv (SeparableConv2D)      (None, 7, 7, 1024)        528896
_________________________________________________________________
1conv_BN (BatchNormalization (None, 7, 7, 1024)        4096
_________________________________________________________________
1conv_relu (ReLU)            (None, 7, 7, 1024)        0
_________________________________________________________________
2conv (SeparableConv2D)      (None, 7, 7, 1024)        1057792
_________________________________________________________________
2conv_BN (BatchNormalization (None, 7, 7, 1024)        4096
_________________________________________________________________
2conv_relu (ReLU)            (None, 7, 7, 1024)        0
_________________________________________________________________
3conv (SeparableConv2D)      (None, 7, 7, 1024)        1057792
_________________________________________________________________
3conv_BN (BatchNormalization (None, 7, 7, 1024)        4096
_________________________________________________________________
3conv_relu (ReLU)            (None, 7, 7, 1024)        0
_________________________________________________________________
detection_layer (SeparableCo (None, 7, 7, 35)          45091
=================================================================
Total params: 3,521,475
Trainable params: 3,509,347
Non-trainable params: 12,128
_________________________________________________________________

The model output can be reshaped to a more natural shape of:

(grid_height, grid_width, anchors_box, 4 + 1 + num_classes)

where the “4 + 1” term represents the coordinates of the estimated bounding boxes (top left x, top left y, width and height) and a confidence score. In other words, the output channels are actually grouped by anchor boxes, and in each group one channel provides either a coordinate, a global confidence score or a class confidence score. This process is done automatically in the decode_output function.

from tensorflow.keras import Model
from tensorflow.keras.layers import Reshape

# Define a reshape output to be added to the YOLO model
output = Reshape((grid_size[1], grid_size[0], num_anchors, 4 + 1 + classes),
                 name="YOLO_output")(model.output)

# Build the complete model
full_model = Model(model.input, output)
full_model.output

Out:

<KerasTensor: shape=(None, 7, 7, 5, 7) dtype=float32 (created by layer 'YOLO_output')>

4. Training

As the YOLO model relies on Brainchip MobileNet/ImageNet network, it is possible to perform transfer learning from ImageNet pretrained weights when training a YOLO model. See the cats vs. dogs transfer learning example for a detail explanation on transfer learning principles.

When using transfer learning for YOLO training, we advise to proceed in several steps that include step-wise quantization:

  • instantiate the yolo_base model and load MobileNet/ImageNet pretrained float weights,

  • freeze the MobileNet layers and perform training,

  • unfreeze all layers, lower the learning rate and quantize the network (e.g to 8-bits weights and activations),

  • quantize to a lower bitwidth until reaching the target bitwidth and retrain.

Even if transfer learning should be the preferred way to train a YOLO model, it has been observed that for some datasets training all layers from scratch gives better results. That is the case for our YOLO WiderFace model to detect faces. In such a case, the training pipeline to follow is described in the typical training scenario.

5. Performance

The model zoo also contains an helper method that allows to create a YOLO model for VOC and load pretrained weights for the car and person detection task and the corresponding anchors. The anchors are used to interpret the model outputs.

The metric used to evaluate YOLO is the mean average precision (mAP) which is the percentage of correct prediction and is given for an intersection over union (IoU) ratio. Scores in this example are given for the standard IoU of 0.5 meaning that a detection is considered valid if the intersection over union ratio with its ground truth equivalent is above 0.5.

Note

A call to evaluate_map will preprocess the images, make the call to Model.predict and use decode_output before computing precision for all classes.

Reported performanced for all training steps are as follows:

Float

8-bit/8-bit

4-bit/4-bit

Global mAP

42.07 %

41.45 %

30.23 %

from timeit import default_timer as timer
from akida_models import yolo_voc_pretrained
from akida_models.detection.map_evaluation import MapEvaluation

# Load the pretrained model along with anchors
model_keras, anchors = yolo_voc_pretrained()

# Define the final reshape and build the model
output = Reshape((grid_size[1], grid_size[0], num_anchors, 4 + 1 + classes),
                 name="YOLO_output")(model_keras.output)
model_keras = Model(model_keras.input, output)

# Create the mAP evaluator object
num_images = 100

map_evaluator = MapEvaluation(model_keras, val_data[:num_images], labels,
                              anchors)

# Compute the scores for all validation images
start = timer()
mAP, average_precisions = map_evaluator.evaluate_map()
end = timer()

for label, average_precision in average_precisions.items():
    print(labels[label], '{:.4f}'.format(average_precision))
print('mAP: {:.4f}'.format(mAP))
print(f'Keras inference on {num_images} images took {end-start:.2f} s.\n')

Out:

Downloading data from http://data.brainchip.com/dataset-mirror/voc/voc_anchors.pkl

16384/126 [============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================] - 0s 0us/step
Downloading data from http://data.brainchip.com/models/yolo/yolo_voc_iq8_wq4_aq4.h5

   16384/14127248 [..............................] - ETA: 11s
  139264/14127248 [..............................] - ETA: 6s 
  401408/14127248 [..............................] - ETA: 4s
  663552/14127248 [>.............................] - ETA: 3s
  925696/14127248 [>.............................] - ETA: 3s
 1187840/14127248 [=>............................] - ETA: 3s
 1449984/14127248 [==>...........................] - ETA: 3s
 1712128/14127248 [==>...........................] - ETA: 3s
 1974272/14127248 [===>..........................] - ETA: 2s
 2236416/14127248 [===>..........................] - ETA: 2s
 2498560/14127248 [====>.........................] - ETA: 2s
 2760704/14127248 [====>.........................] - ETA: 2s
 3022848/14127248 [=====>........................] - ETA: 2s
 3284992/14127248 [=====>........................] - ETA: 2s
 3547136/14127248 [======>.......................] - ETA: 2s
 3809280/14127248 [=======>......................] - ETA: 2s
 4071424/14127248 [=======>......................] - ETA: 2s
 4333568/14127248 [========>.....................] - ETA: 2s
 4595712/14127248 [========>.....................] - ETA: 2s
 4857856/14127248 [=========>....................] - ETA: 2s
 5120000/14127248 [=========>....................] - ETA: 2s
 5382144/14127248 [==========>...................] - ETA: 1s
 5644288/14127248 [==========>...................] - ETA: 1s
 5906432/14127248 [===========>..................] - ETA: 1s
 6168576/14127248 [============>.................] - ETA: 1s
 6430720/14127248 [============>.................] - ETA: 1s
 6692864/14127248 [=============>................] - ETA: 1s
 6955008/14127248 [=============>................] - ETA: 1s
 7217152/14127248 [==============>...............] - ETA: 1s
 7479296/14127248 [==============>...............] - ETA: 1s
 7741440/14127248 [===============>..............] - ETA: 1s
 8003584/14127248 [===============>..............] - ETA: 1s
 8265728/14127248 [================>.............] - ETA: 1s
 8527872/14127248 [=================>............] - ETA: 1s
 8790016/14127248 [=================>............] - ETA: 1s
 9052160/14127248 [==================>...........] - ETA: 1s
 9314304/14127248 [==================>...........] - ETA: 1s
 9576448/14127248 [===================>..........] - ETA: 1s
 9838592/14127248 [===================>..........] - ETA: 0s
10100736/14127248 [====================>.........] - ETA: 0s
10362880/14127248 [=====================>........] - ETA: 0s
10625024/14127248 [=====================>........] - ETA: 0s
10887168/14127248 [======================>.......] - ETA: 0s
11149312/14127248 [======================>.......] - ETA: 0s
11411456/14127248 [=======================>......] - ETA: 0s
11673600/14127248 [=======================>......] - ETA: 0s
11935744/14127248 [========================>.....] - ETA: 0s
12197888/14127248 [========================>.....] - ETA: 0s
12460032/14127248 [=========================>....] - ETA: 0s
12722176/14127248 [==========================>...] - ETA: 0s
12984320/14127248 [==========================>...] - ETA: 0s
13246464/14127248 [===========================>..] - ETA: 0s
13508608/14127248 [===========================>..] - ETA: 0s
13770752/14127248 [============================>.] - ETA: 0s
14032896/14127248 [============================>.] - ETA: 0s
14131200/14127248 [==============================] - 3s 0us/step

14139392/14127248 [==============================] - 3s 0us/step
car 0.2669
person 0.2877
mAP: 0.2773
Keras inference on 100 images took 3.84 s.

6. Conversion to Akida

6.1 Convert to Akida model

Check model compatibility before akida conversion

from cnn2snn import check_model_compatibility

compat = check_model_compatibility(model_keras, False)

Out:

The Keras quantized model is not compatible for a conversion to an Akida model:
 The Reshape layer YOLO_output can only be used to transform a tensor of shape (N,) to a tensor of shape (1, 1, N), and vice-versa. Receives input_shape (7, 7, 35) and output_shape (7, 7, 5, 7).

The last YOLO_output layer that was added for splitting channels into values for each box must be removed before akida conversion.

# Rebuild a model without the last layer
compatible_model = Model(model_keras.input, model_keras.layers[-2].output)

When converting to an Akida model, we just need to pass the Keras model and the input scaling that was used during training to cnn2snn.convert. In YOLO preprocess_image function, images are zero centered and normalized between [-1, 1] hence the scaling values.

from cnn2snn import convert

model_akida = convert(compatible_model)
model_akida.summary()

Out:

                 Model Summary
________________________________________________
Input shape    Output shape  Sequences  Layers
================================================
[224, 224, 3]  [7, 7, 35]    1          18
________________________________________________

              SW/conv_0-detection_layer (Software)
_________________________________________________________________
Layer (type)                 Output shape    Kernel shape
=================================================================
conv_0 (InputConv.)          [112, 112, 16]  (3, 3, 3, 16)
_________________________________________________________________
separable_1 (Sep.Conv.)      [112, 112, 32]  (3, 3, 16, 1)
_________________________________________________________________
                                             (1, 1, 16, 32)
_________________________________________________________________
separable_2 (Sep.Conv.)      [56, 56, 64]    (3, 3, 32, 1)
_________________________________________________________________
                                             (1, 1, 32, 64)
_________________________________________________________________
separable_3 (Sep.Conv.)      [56, 56, 64]    (3, 3, 64, 1)
_________________________________________________________________
                                             (1, 1, 64, 64)
_________________________________________________________________
separable_4 (Sep.Conv.)      [28, 28, 128]   (3, 3, 64, 1)
_________________________________________________________________
                                             (1, 1, 64, 128)
_________________________________________________________________
separable_5 (Sep.Conv.)      [28, 28, 128]   (3, 3, 128, 1)
_________________________________________________________________
                                             (1, 1, 128, 128)
_________________________________________________________________
separable_6 (Sep.Conv.)      [14, 14, 256]   (3, 3, 128, 1)
_________________________________________________________________
                                             (1, 1, 128, 256)
_________________________________________________________________
separable_7 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_8 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_9 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_10 (Sep.Conv.)     [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_11 (Sep.Conv.)     [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_12 (Sep.Conv.)     [7, 7, 512]     (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 512)
_________________________________________________________________
separable_13 (Sep.Conv.)     [7, 7, 512]     (3, 3, 512, 1)
_________________________________________________________________
                                             (1, 1, 512, 512)
_________________________________________________________________
1conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 512, 1)
_________________________________________________________________
                                             (1, 1, 512, 1024)
_________________________________________________________________
2conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 1024)
_________________________________________________________________
3conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 1024)
_________________________________________________________________
detection_layer (Sep.Conv.)  [7, 7, 35]      (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 35)
_________________________________________________________________

6.1 Check performance

Akida model accuracy is tested on the first n images of the validation set.

The table below summarizes the expected results:

#Images

Keras mAP

Akida mAP

100

27.82 %

27.18 %

1000

30.65 %

30.83 %

2500

30.23 %

29.39 %

# Create the mAP evaluator object
map_evaluator_ak = MapEvaluation(model_akida,
                                 val_data[:num_images],
                                 labels,
                                 anchors,
                                 is_keras_model=False)

# Compute the scores for all validation images
start = timer()
mAP_ak, average_precisions_ak = map_evaluator_ak.evaluate_map()
end = timer()

for label, average_precision in average_precisions_ak.items():
    print(labels[label], '{:.4f}'.format(average_precision))
print('mAP: {:.4f}'.format(mAP_ak))
print(f'Akida inference on {num_images} images took {end-start:.2f} s.\n')

Out:

car 0.2552
person 0.2852
mAP: 0.2702
Akida inference on 100 images took 16.74 s.

6.2 Show predictions for a random image

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches

from akida_models.detection.processing import load_image, preprocess_image, decode_output

# Take a random test image
i = np.random.randint(len(val_data))

input_shape = model_akida.layers[0].input_dims

# Load the image
raw_image = load_image(val_data[i]['image_path'])

# Keep the original image size for later bounding boxes rescaling
raw_height, raw_width, _ = raw_image.shape

# Pre-process the image
image = preprocess_image(raw_image, input_shape)
input_image = image[np.newaxis, :].astype(np.uint8)

# Call evaluate on the image
pots = model_akida.evaluate(input_image)[0]

# Reshape the potentials to prepare for decoding
w, h, c = pots.shape
pots = pots.reshape((w, h, len(anchors), 4 + 1 + len(labels)))

# Akida potentials are transposed because they are given in (W,H) format while
# the decode_output API uses the Keras-style (H,W).
pots = pots.transpose((1, 0, 2, 3))

# Decode potentials into bounding boxes
raw_boxes = decode_output(pots, anchors, len(labels))

# Rescale boxes to the original image size
pred_boxes = np.array([[
    box.x1 * raw_width, box.y1 * raw_height, box.x2 * raw_width,
    box.y2 * raw_height,
    box.get_label(),
    box.get_score()
] for box in raw_boxes])

fig = plt.figure(
    num='VOC2012 car and person detection by Akida Execution Engine')
ax = fig.subplots(1)
img_plot = ax.imshow(np.zeros(raw_image.shape, dtype=np.uint8))
img_plot.set_data(raw_image)

for box in pred_boxes:
    rect = patches.Rectangle((box[0], box[1]),
                             box[2] - box[0],
                             box[3] - box[1],
                             linewidth=1,
                             edgecolor='r',
                             facecolor='none')
    ax.add_patch(rect)
    class_score = ax.text(box[0],
                          box[1] - 5,
                          f"{labels[int(box[4])]} - {box[5]:.2f}",
                          color='red')

plt.axis('off')
plt.show()
plot 6 voc yolo detection

Total running time of the script: ( 1 minutes 29.958 seconds)

Gallery generated by Sphinx-Gallery