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

     8192/221551911 [..............................] - ETA: 19:41
    73728/221551911 [..............................] - ETA: 4:45 
   270336/221551911 [..............................] - ETA: 2:01
   466944/221551911 [..............................] - ETA: 1:35
   663552/221551911 [..............................] - ETA: 1:24
   860160/221551911 [..............................] - ETA: 1:19
  1056768/221551911 [..............................] - ETA: 1:15
  1253376/221551911 [..............................] - ETA: 1:12
  1449984/221551911 [..............................] - ETA: 1:11
  1646592/221551911 [..............................] - ETA: 1:09
  1843200/221551911 [..............................] - ETA: 1:08
  2039808/221551911 [..............................] - ETA: 1:07
  2236416/221551911 [..............................] - ETA: 1:06
  2433024/221551911 [..............................] - ETA: 1:06
  2629632/221551911 [..............................] - ETA: 1:05
  2826240/221551911 [..............................] - ETA: 1:05
  3022848/221551911 [..............................] - ETA: 1:04
  3219456/221551911 [..............................] - ETA: 1:04
  3416064/221551911 [..............................] - ETA: 1:03
  3612672/221551911 [..............................] - ETA: 1:03
  3809280/221551911 [..............................] - ETA: 1:03
  4005888/221551911 [..............................] - ETA: 1:03
  4202496/221551911 [..............................] - ETA: 1:02
  4399104/221551911 [..............................] - ETA: 1:02
  4595712/221551911 [..............................] - ETA: 1:02
  4792320/221551911 [..............................] - ETA: 1:02
  4988928/221551911 [..............................] - ETA: 1:02
  5185536/221551911 [..............................] - ETA: 1:01
  5382144/221551911 [..............................] - ETA: 1:01
  5578752/221551911 [..............................] - ETA: 1:01
  5775360/221551911 [..............................] - ETA: 1:01
  5971968/221551911 [..............................] - ETA: 1:01
  6168576/221551911 [..............................] - ETA: 1:01
  6365184/221551911 [..............................] - ETA: 1:01
  6561792/221551911 [..............................] - ETA: 1:00
  6758400/221551911 [..............................] - ETA: 1:00
  6955008/221551911 [..............................] - ETA: 1:00
  7151616/221551911 [..............................] - ETA: 1:00
  7348224/221551911 [..............................] - ETA: 1:00
  7544832/221551911 [>.............................] - ETA: 1:00
  7741440/221551911 [>.............................] - ETA: 1:00
  7938048/221551911 [>.............................] - ETA: 1:00
  8134656/221551911 [>.............................] - ETA: 1:00
  8331264/221551911 [>.............................] - ETA: 59s 
  8527872/221551911 [>.............................] - ETA: 59s
  8724480/221551911 [>.............................] - ETA: 59s
  8921088/221551911 [>.............................] - ETA: 59s
  9117696/221551911 [>.............................] - ETA: 59s
  9314304/221551911 [>.............................] - ETA: 59s
  9510912/221551911 [>.............................] - ETA: 59s
  9707520/221551911 [>.............................] - ETA: 59s
  9904128/221551911 [>.............................] - ETA: 59s
 10100736/221551911 [>.............................] - ETA: 59s
 10297344/221551911 [>.............................] - ETA: 58s
 10493952/221551911 [>.............................] - ETA: 58s
 10690560/221551911 [>.............................] - ETA: 58s
 10887168/221551911 [>.............................] - ETA: 58s
 11083776/221551911 [>.............................] - ETA: 58s
 11280384/221551911 [>.............................] - ETA: 58s
 11476992/221551911 [>.............................] - ETA: 58s
 11673600/221551911 [>.............................] - ETA: 58s
 11870208/221551911 [>.............................] - ETA: 58s
 12066816/221551911 [>.............................] - ETA: 58s
 12263424/221551911 [>.............................] - ETA: 58s
 12460032/221551911 [>.............................] - ETA: 58s
 12656640/221551911 [>.............................] - ETA: 58s
 12853248/221551911 [>.............................] - ETA: 58s
 13049856/221551911 [>.............................] - ETA: 57s
 13246464/221551911 [>.............................] - ETA: 57s
 13443072/221551911 [>.............................] - ETA: 57s
 13639680/221551911 [>.............................] - ETA: 57s
 13836288/221551911 [>.............................] - ETA: 57s
 14032896/221551911 [>.............................] - ETA: 57s
 14229504/221551911 [>.............................] - ETA: 57s
 14426112/221551911 [>.............................] - ETA: 57s
 14622720/221551911 [>.............................] - ETA: 57s
 14819328/221551911 [=>............................] - ETA: 57s
 15015936/221551911 [=>............................] - ETA: 57s
 15212544/221551911 [=>............................] - ETA: 57s
 15409152/221551911 [=>............................] - ETA: 57s
 15605760/221551911 [=>............................] - ETA: 57s
 15802368/221551911 [=>............................] - ETA: 56s
 15998976/221551911 [=>............................] - ETA: 56s
 16195584/221551911 [=>............................] - ETA: 56s
 16392192/221551911 [=>............................] - ETA: 56s
 16588800/221551911 [=>............................] - ETA: 56s
 16785408/221551911 [=>............................] - ETA: 56s
 16982016/221551911 [=>............................] - ETA: 56s
 17178624/221551911 [=>............................] - ETA: 56s
 17375232/221551911 [=>............................] - ETA: 56s
 17571840/221551911 [=>............................] - ETA: 56s
 17768448/221551911 [=>............................] - ETA: 56s
 17965056/221551911 [=>............................] - ETA: 56s
 18161664/221551911 [=>............................] - ETA: 56s
 18358272/221551911 [=>............................] - ETA: 56s
 18554880/221551911 [=>............................] - ETA: 56s
 18751488/221551911 [=>............................] - ETA: 55s
 18948096/221551911 [=>............................] - ETA: 55s
 19144704/221551911 [=>............................] - ETA: 55s
 19341312/221551911 [=>............................] - ETA: 55s
 19537920/221551911 [=>............................] - ETA: 55s
 19734528/221551911 [=>............................] - ETA: 55s
 19931136/221551911 [=>............................] - ETA: 55s
 20127744/221551911 [=>............................] - ETA: 55s
 20324352/221551911 [=>............................] - ETA: 55s
 20520960/221551911 [=>............................] - ETA: 55s
 20717568/221551911 [=>............................] - ETA: 55s
 20914176/221551911 [=>............................] - ETA: 55s
 21110784/221551911 [=>............................] - ETA: 55s
 21307392/221551911 [=>............................] - ETA: 55s
 21504000/221551911 [=>............................] - ETA: 55s
 21700608/221551911 [=>............................] - ETA: 55s
 21897216/221551911 [=>............................] - ETA: 55s
 22093824/221551911 [=>............................] - ETA: 54s
 22290432/221551911 [==>...........................] - ETA: 54s
 22487040/221551911 [==>...........................] - ETA: 54s
 22683648/221551911 [==>...........................] - ETA: 54s
 22880256/221551911 [==>...........................] - ETA: 54s
 23076864/221551911 [==>...........................] - ETA: 54s
 23273472/221551911 [==>...........................] - ETA: 54s
 23470080/221551911 [==>...........................] - ETA: 54s
 23666688/221551911 [==>...........................] - ETA: 54s
 23863296/221551911 [==>...........................] - ETA: 54s
 24059904/221551911 [==>...........................] - ETA: 54s
 24256512/221551911 [==>...........................] - ETA: 54s
 24453120/221551911 [==>...........................] - ETA: 54s
 24649728/221551911 [==>...........................] - ETA: 54s
 24846336/221551911 [==>...........................] - ETA: 54s
 25042944/221551911 [==>...........................] - ETA: 54s
 25239552/221551911 [==>...........................] - ETA: 53s
 25436160/221551911 [==>...........................] - ETA: 53s
 25632768/221551911 [==>...........................] - ETA: 53s
 25829376/221551911 [==>...........................] - ETA: 53s
 26025984/221551911 [==>...........................] - ETA: 53s
 26222592/221551911 [==>...........................] - ETA: 53s
 26419200/221551911 [==>...........................] - ETA: 53s
 26615808/221551911 [==>...........................] - ETA: 53s
 26812416/221551911 [==>...........................] - ETA: 53s
 27009024/221551911 [==>...........................] - ETA: 53s
 27205632/221551911 [==>...........................] - ETA: 53s
 27402240/221551911 [==>...........................] - ETA: 53s
 27598848/221551911 [==>...........................] - ETA: 53s
 27795456/221551911 [==>...........................] - ETA: 53s
 27992064/221551911 [==>...........................] - ETA: 53s
 28188672/221551911 [==>...........................] - ETA: 53s
 28385280/221551911 [==>...........................] - ETA: 53s
 28581888/221551911 [==>...........................] - ETA: 53s
 28778496/221551911 [==>...........................] - ETA: 52s
 28975104/221551911 [==>...........................] - ETA: 52s
 29171712/221551911 [==>...........................] - ETA: 52s
 29368320/221551911 [==>...........................] - ETA: 52s
 29564928/221551911 [===>..........................] - ETA: 52s
 29761536/221551911 [===>..........................] - ETA: 52s
 29958144/221551911 [===>..........................] - ETA: 52s
 30154752/221551911 [===>..........................] - ETA: 52s
 30351360/221551911 [===>..........................] - ETA: 52s
 30547968/221551911 [===>..........................] - ETA: 52s
 30744576/221551911 [===>..........................] - ETA: 52s
 30941184/221551911 [===>..........................] - ETA: 52s
 31137792/221551911 [===>..........................] - ETA: 52s
 31334400/221551911 [===>..........................] - ETA: 52s
 31531008/221551911 [===>..........................] - ETA: 52s
 31727616/221551911 [===>..........................] - ETA: 52s
 31924224/221551911 [===>..........................] - ETA: 52s
 32120832/221551911 [===>..........................] - ETA: 51s
 32317440/221551911 [===>..........................] - ETA: 51s
 32514048/221551911 [===>..........................] - ETA: 51s
 32710656/221551911 [===>..........................] - ETA: 51s
 32907264/221551911 [===>..........................] - ETA: 51s
 33103872/221551911 [===>..........................] - ETA: 51s
 33300480/221551911 [===>..........................] - ETA: 51s
 33497088/221551911 [===>..........................] - ETA: 51s
 33693696/221551911 [===>..........................] - ETA: 51s
 33890304/221551911 [===>..........................] - ETA: 51s
 34086912/221551911 [===>..........................] - ETA: 51s
 34283520/221551911 [===>..........................] - ETA: 51s
 34480128/221551911 [===>..........................] - ETA: 51s
 34676736/221551911 [===>..........................] - ETA: 51s
 34873344/221551911 [===>..........................] - ETA: 51s
 35069952/221551911 [===>..........................] - ETA: 51s
 35266560/221551911 [===>..........................] - ETA: 51s
 35463168/221551911 [===>..........................] - ETA: 51s
 35659776/221551911 [===>..........................] - ETA: 50s
 35856384/221551911 [===>..........................] - ETA: 50s
 36052992/221551911 [===>..........................] - ETA: 50s
 36249600/221551911 [===>..........................] - ETA: 50s
 36446208/221551911 [===>..........................] - ETA: 50s
 36642816/221551911 [===>..........................] - ETA: 50s
 36839424/221551911 [===>..........................] - ETA: 50s
 37036032/221551911 [====>.........................] - ETA: 50s
 37232640/221551911 [====>.........................] - ETA: 50s
 37429248/221551911 [====>.........................] - ETA: 50s
 37625856/221551911 [====>.........................] - ETA: 50s
 37822464/221551911 [====>.........................] - ETA: 50s
 38019072/221551911 [====>.........................] - ETA: 50s
 38215680/221551911 [====>.........................] - ETA: 50s
 38412288/221551911 [====>.........................] - ETA: 50s
 38608896/221551911 [====>.........................] - ETA: 50s
 38805504/221551911 [====>.........................] - ETA: 50s
 39002112/221551911 [====>.........................] - ETA: 50s
 39198720/221551911 [====>.........................] - ETA: 49s
 39395328/221551911 [====>.........................] - ETA: 49s
 39591936/221551911 [====>.........................] - ETA: 49s
 39788544/221551911 [====>.........................] - ETA: 49s
 39985152/221551911 [====>.........................] - ETA: 49s
 40181760/221551911 [====>.........................] - ETA: 49s
 40378368/221551911 [====>.........................] - ETA: 49s
 40574976/221551911 [====>.........................] - ETA: 49s
 40771584/221551911 [====>.........................] - ETA: 49s
 40968192/221551911 [====>.........................] - ETA: 49s
 41164800/221551911 [====>.........................] - ETA: 49s
 41361408/221551911 [====>.........................] - ETA: 49s
 41558016/221551911 [====>.........................] - ETA: 49s
 41754624/221551911 [====>.........................] - ETA: 49s
 41951232/221551911 [====>.........................] - ETA: 49s
 42147840/221551911 [====>.........................] - ETA: 49s
 42344448/221551911 [====>.........................] - ETA: 49s
 42541056/221551911 [====>.........................] - ETA: 49s
 42737664/221551911 [====>.........................] - ETA: 48s
 42934272/221551911 [====>.........................] - ETA: 48s
 43130880/221551911 [====>.........................] - ETA: 48s
 43327488/221551911 [====>.........................] - ETA: 48s
 43524096/221551911 [====>.........................] - ETA: 48s
 43720704/221551911 [====>.........................] - ETA: 48s
 43917312/221551911 [====>.........................] - ETA: 48s
 44113920/221551911 [====>.........................] - ETA: 48s
 44310528/221551911 [=====>........................] - ETA: 48s
 44507136/221551911 [=====>........................] - ETA: 48s
 44703744/221551911 [=====>........................] - ETA: 48s
 44900352/221551911 [=====>........................] - ETA: 48s
 45096960/221551911 [=====>........................] - ETA: 48s
 45293568/221551911 [=====>........................] - ETA: 48s
 45490176/221551911 [=====>........................] - ETA: 48s
 45686784/221551911 [=====>........................] - ETA: 48s
 45883392/221551911 [=====>........................] - ETA: 48s
 46080000/221551911 [=====>........................] - ETA: 48s
 46276608/221551911 [=====>........................] - ETA: 47s
 46473216/221551911 [=====>........................] - ETA: 47s
 46669824/221551911 [=====>........................] - ETA: 47s
 46866432/221551911 [=====>........................] - ETA: 47s
 47063040/221551911 [=====>........................] - ETA: 47s
 47259648/221551911 [=====>........................] - ETA: 47s
 47456256/221551911 [=====>........................] - ETA: 47s
 47652864/221551911 [=====>........................] - ETA: 47s
 47849472/221551911 [=====>........................] - ETA: 47s
 48046080/221551911 [=====>........................] - ETA: 47s
 48242688/221551911 [=====>........................] - ETA: 47s
 48439296/221551911 [=====>........................] - ETA: 47s
 48635904/221551911 [=====>........................] - ETA: 47s
 48832512/221551911 [=====>........................] - ETA: 47s
 49029120/221551911 [=====>........................] - ETA: 47s
 49225728/221551911 [=====>........................] - ETA: 47s
 49422336/221551911 [=====>........................] - ETA: 47s
 49618944/221551911 [=====>........................] - ETA: 47s
 49815552/221551911 [=====>........................] - ETA: 46s
 50012160/221551911 [=====>........................] - ETA: 46s
 50208768/221551911 [=====>........................] - ETA: 46s
 50405376/221551911 [=====>........................] - ETA: 46s
 50601984/221551911 [=====>........................] - ETA: 46s
 50798592/221551911 [=====>........................] - ETA: 46s
 50995200/221551911 [=====>........................] - ETA: 46s
 51191808/221551911 [=====>........................] - ETA: 46s
 51388416/221551911 [=====>........................] - ETA: 46s
 51585024/221551911 [=====>........................] - ETA: 46s
 51781632/221551911 [======>.......................] - ETA: 46s
 51978240/221551911 [======>.......................] - ETA: 46s
 52174848/221551911 [======>.......................] - ETA: 46s
 52371456/221551911 [======>.......................] - ETA: 46s
 52568064/221551911 [======>.......................] - ETA: 46s
 52764672/221551911 [======>.......................] - ETA: 46s
 52961280/221551911 [======>.......................] - ETA: 46s
 53157888/221551911 [======>.......................] - ETA: 46s
 53354496/221551911 [======>.......................] - ETA: 45s
 53551104/221551911 [======>.......................] - ETA: 45s
 53747712/221551911 [======>.......................] - ETA: 45s
 53944320/221551911 [======>.......................] - ETA: 45s
 54140928/221551911 [======>.......................] - ETA: 45s
 54337536/221551911 [======>.......................] - ETA: 45s
 54534144/221551911 [======>.......................] - ETA: 45s
 54730752/221551911 [======>.......................] - ETA: 45s
 54927360/221551911 [======>.......................] - ETA: 45s
 55123968/221551911 [======>.......................] - ETA: 45s
 55320576/221551911 [======>.......................] - ETA: 45s
 55517184/221551911 [======>.......................] - ETA: 45s
 55713792/221551911 [======>.......................] - ETA: 45s
 55910400/221551911 [======>.......................] - ETA: 45s
 56107008/221551911 [======>.......................] - ETA: 45s
 56303616/221551911 [======>.......................] - ETA: 45s
 56500224/221551911 [======>.......................] - ETA: 45s
 56696832/221551911 [======>.......................] - ETA: 45s
 56893440/221551911 [======>.......................] - ETA: 45s
 57090048/221551911 [======>.......................] - ETA: 44s
 57286656/221551911 [======>.......................] - ETA: 44s
 57483264/221551911 [======>.......................] - ETA: 44s
 57679872/221551911 [======>.......................] - ETA: 44s
 57876480/221551911 [======>.......................] - ETA: 44s
 58073088/221551911 [======>.......................] - ETA: 44s
 58269696/221551911 [======>.......................] - ETA: 44s
 58466304/221551911 [======>.......................] - ETA: 44s
 58662912/221551911 [======>.......................] - ETA: 44s
 58859520/221551911 [======>.......................] - ETA: 44s
 59056128/221551911 [======>.......................] - ETA: 44s
 59252736/221551911 [=======>......................] - ETA: 44s
 59449344/221551911 [=======>......................] - ETA: 44s
 59645952/221551911 [=======>......................] - ETA: 44s
 59842560/221551911 [=======>......................] - ETA: 44s
 60039168/221551911 [=======>......................] - ETA: 44s
 60235776/221551911 [=======>......................] - ETA: 44s
 60432384/221551911 [=======>......................] - ETA: 44s
 60628992/221551911 [=======>......................] - ETA: 43s
 60825600/221551911 [=======>......................] - ETA: 43s
 61022208/221551911 [=======>......................] - ETA: 43s
 61218816/221551911 [=======>......................] - ETA: 43s
 61415424/221551911 [=======>......................] - ETA: 43s
 61612032/221551911 [=======>......................] - ETA: 43s
 61808640/221551911 [=======>......................] - ETA: 43s
 62005248/221551911 [=======>......................] - ETA: 43s
 62201856/221551911 [=======>......................] - ETA: 43s
 62398464/221551911 [=======>......................] - ETA: 43s
 62595072/221551911 [=======>......................] - ETA: 43s
 62791680/221551911 [=======>......................] - ETA: 43s
 62988288/221551911 [=======>......................] - ETA: 43s
 63184896/221551911 [=======>......................] - ETA: 43s
 63381504/221551911 [=======>......................] - ETA: 43s
 63578112/221551911 [=======>......................] - ETA: 43s
 63774720/221551911 [=======>......................] - ETA: 43s
 63971328/221551911 [=======>......................] - ETA: 43s
 64167936/221551911 [=======>......................] - ETA: 42s
 64364544/221551911 [=======>......................] - ETA: 42s
 64561152/221551911 [=======>......................] - ETA: 42s
 64757760/221551911 [=======>......................] - ETA: 42s
 64954368/221551911 [=======>......................] - ETA: 42s
 65150976/221551911 [=======>......................] - ETA: 42s
 65347584/221551911 [=======>......................] - ETA: 42s
 65544192/221551911 [=======>......................] - ETA: 42s
 65740800/221551911 [=======>......................] - ETA: 42s
 65937408/221551911 [=======>......................] - ETA: 42s
 66134016/221551911 [=======>......................] - ETA: 42s
 66330624/221551911 [=======>......................] - ETA: 42s
 66527232/221551911 [========>.....................] - ETA: 42s
 66723840/221551911 [========>.....................] - ETA: 42s
 66920448/221551911 [========>.....................] - ETA: 42s
 67117056/221551911 [========>.....................] - ETA: 42s
 67313664/221551911 [========>.....................] - ETA: 42s
 67510272/221551911 [========>.....................] - ETA: 42s
 67706880/221551911 [========>.....................] - ETA: 41s
 67903488/221551911 [========>.....................] - ETA: 41s
 68100096/221551911 [========>.....................] - ETA: 41s
 68296704/221551911 [========>.....................] - ETA: 41s
 68493312/221551911 [========>.....................] - ETA: 41s
 68689920/221551911 [========>.....................] - ETA: 41s
 68886528/221551911 [========>.....................] - ETA: 41s
 69083136/221551911 [========>.....................] - ETA: 41s
 69279744/221551911 [========>.....................] - ETA: 41s
 69476352/221551911 [========>.....................] - ETA: 41s
 69672960/221551911 [========>.....................] - ETA: 41s
 69869568/221551911 [========>.....................] - ETA: 41s
 70066176/221551911 [========>.....................] - ETA: 41s
 70262784/221551911 [========>.....................] - ETA: 41s
 70459392/221551911 [========>.....................] - ETA: 41s
 70656000/221551911 [========>.....................] - ETA: 41s
 70852608/221551911 [========>.....................] - ETA: 41s
 71049216/221551911 [========>.....................] - ETA: 41s
 71245824/221551911 [========>.....................] - ETA: 41s
 71442432/221551911 [========>.....................] - ETA: 40s
 71639040/221551911 [========>.....................] - ETA: 40s
 71835648/221551911 [========>.....................] - ETA: 40s
 72032256/221551911 [========>.....................] - ETA: 40s
 72228864/221551911 [========>.....................] - ETA: 40s
 72425472/221551911 [========>.....................] - ETA: 40s
 72622080/221551911 [========>.....................] - ETA: 40s
 72818688/221551911 [========>.....................] - ETA: 40s
 73015296/221551911 [========>.....................] - ETA: 40s
 73211904/221551911 [========>.....................] - ETA: 40s
 73408512/221551911 [========>.....................] - ETA: 40s
 73605120/221551911 [========>.....................] - ETA: 40s
 73801728/221551911 [========>.....................] - ETA: 40s
 73998336/221551911 [=========>....................] - ETA: 40s
 74194944/221551911 [=========>....................] - ETA: 40s
 74391552/221551911 [=========>....................] - ETA: 40s
 74588160/221551911 [=========>....................] - ETA: 40s
 74784768/221551911 [=========>....................] - ETA: 40s
 74981376/221551911 [=========>....................] - ETA: 39s
 75177984/221551911 [=========>....................] - ETA: 39s
 75374592/221551911 [=========>....................] - ETA: 39s
 75571200/221551911 [=========>....................] - ETA: 39s
 75767808/221551911 [=========>....................] - ETA: 39s
 75964416/221551911 [=========>....................] - ETA: 39s
 76161024/221551911 [=========>....................] - ETA: 39s
 76357632/221551911 [=========>....................] - ETA: 39s
 76554240/221551911 [=========>....................] - ETA: 39s
 76750848/221551911 [=========>....................] - ETA: 39s
 76947456/221551911 [=========>....................] - ETA: 39s
 77144064/221551911 [=========>....................] - ETA: 39s
 77340672/221551911 [=========>....................] - ETA: 39s
 77537280/221551911 [=========>....................] - ETA: 39s
 77733888/221551911 [=========>....................] - ETA: 39s
 77930496/221551911 [=========>....................] - ETA: 39s
 78127104/221551911 [=========>....................] - ETA: 39s
 78323712/221551911 [=========>....................] - ETA: 39s
 78520320/221551911 [=========>....................] - ETA: 39s
 78716928/221551911 [=========>....................] - ETA: 38s
 78913536/221551911 [=========>....................] - ETA: 38s
 79110144/221551911 [=========>....................] - ETA: 38s
 79306752/221551911 [=========>....................] - ETA: 38s
 79503360/221551911 [=========>....................] - ETA: 38s
 79699968/221551911 [=========>....................] - ETA: 38s
 79896576/221551911 [=========>....................] - ETA: 38s
 80093184/221551911 [=========>....................] - ETA: 38s
 80289792/221551911 [=========>....................] - ETA: 38s
 80486400/221551911 [=========>....................] - ETA: 38s
 80683008/221551911 [=========>....................] - ETA: 38s
 80879616/221551911 [=========>....................] - ETA: 38s
 81076224/221551911 [=========>....................] - ETA: 38s
 81272832/221551911 [==========>...................] - ETA: 38s
 81469440/221551911 [==========>...................] - ETA: 38s
 81666048/221551911 [==========>...................] - ETA: 38s
 81862656/221551911 [==========>...................] - ETA: 38s
 82059264/221551911 [==========>...................] - ETA: 38s
 82255872/221551911 [==========>...................] - ETA: 37s
 82452480/221551911 [==========>...................] - ETA: 37s
 82649088/221551911 [==========>...................] - ETA: 37s
 82845696/221551911 [==========>...................] - ETA: 37s
 83042304/221551911 [==========>...................] - ETA: 37s
 83238912/221551911 [==========>...................] - ETA: 37s
 83435520/221551911 [==========>...................] - ETA: 37s
 83632128/221551911 [==========>...................] - ETA: 37s
 83828736/221551911 [==========>...................] - ETA: 37s
 84025344/221551911 [==========>...................] - ETA: 37s
 84221952/221551911 [==========>...................] - ETA: 37s
 84418560/221551911 [==========>...................] - ETA: 37s
 84615168/221551911 [==========>...................] - ETA: 37s
 84811776/221551911 [==========>...................] - ETA: 37s
 85008384/221551911 [==========>...................] - ETA: 37s
 85204992/221551911 [==========>...................] - ETA: 37s
 85401600/221551911 [==========>...................] - ETA: 37s
 85598208/221551911 [==========>...................] - ETA: 37s
 85794816/221551911 [==========>...................] - ETA: 37s
 85991424/221551911 [==========>...................] - ETA: 36s
 86188032/221551911 [==========>...................] - ETA: 36s
 86384640/221551911 [==========>...................] - ETA: 36s
 86581248/221551911 [==========>...................] - ETA: 36s
 86777856/221551911 [==========>...................] - ETA: 36s
 86974464/221551911 [==========>...................] - ETA: 36s
 87171072/221551911 [==========>...................] - ETA: 36s
 87367680/221551911 [==========>...................] - ETA: 36s
 87564288/221551911 [==========>...................] - ETA: 36s
 87760896/221551911 [==========>...................] - ETA: 36s
 87957504/221551911 [==========>...................] - ETA: 36s
 88154112/221551911 [==========>...................] - ETA: 36s
 88350720/221551911 [==========>...................] - ETA: 36s
 88547328/221551911 [==========>...................] - ETA: 36s
 88743936/221551911 [===========>..................] - ETA: 36s
 88940544/221551911 [===========>..................] - ETA: 36s
 89137152/221551911 [===========>..................] - ETA: 36s
 89333760/221551911 [===========>..................] - ETA: 36s
 89530368/221551911 [===========>..................] - ETA: 35s
 89726976/221551911 [===========>..................] - ETA: 35s
 89923584/221551911 [===========>..................] - ETA: 35s
 90120192/221551911 [===========>..................] - ETA: 35s
 90316800/221551911 [===========>..................] - ETA: 35s
 90513408/221551911 [===========>..................] - ETA: 35s
 90710016/221551911 [===========>..................] - ETA: 35s
 90906624/221551911 [===========>..................] - ETA: 35s
 91103232/221551911 [===========>..................] - ETA: 35s
 91299840/221551911 [===========>..................] - ETA: 35s
 91496448/221551911 [===========>..................] - ETA: 35s
 91693056/221551911 [===========>..................] - ETA: 35s
 91889664/221551911 [===========>..................] - ETA: 35s
 92086272/221551911 [===========>..................] - ETA: 35s
 92282880/221551911 [===========>..................] - ETA: 35s
 92479488/221551911 [===========>..................] - ETA: 35s
 92676096/221551911 [===========>..................] - ETA: 35s
 92872704/221551911 [===========>..................] - ETA: 35s
 93069312/221551911 [===========>..................] - ETA: 35s
 93265920/221551911 [===========>..................] - ETA: 34s
 93462528/221551911 [===========>..................] - ETA: 34s
 93659136/221551911 [===========>..................] - ETA: 34s
 93855744/221551911 [===========>..................] - ETA: 34s
 94052352/221551911 [===========>..................] - ETA: 34s
 94248960/221551911 [===========>..................] - ETA: 34s
 94445568/221551911 [===========>..................] - ETA: 34s
 94642176/221551911 [===========>..................] - ETA: 34s
 94838784/221551911 [===========>..................] - ETA: 34s
 95035392/221551911 [===========>..................] - ETA: 34s
 95232000/221551911 [===========>..................] - ETA: 34s
 95428608/221551911 [===========>..................] - ETA: 34s
 95625216/221551911 [===========>..................] - ETA: 34s
 95821824/221551911 [===========>..................] - ETA: 34s
 96018432/221551911 [============>.................] - ETA: 34s
 96215040/221551911 [============>.................] - ETA: 34s
 96411648/221551911 [============>.................] - ETA: 34s
 96608256/221551911 [============>.................] - ETA: 34s
 96804864/221551911 [============>.................] - ETA: 33s
 97001472/221551911 [============>.................] - ETA: 33s
 97198080/221551911 [============>.................] - ETA: 33s
 97394688/221551911 [============>.................] - ETA: 33s
 97591296/221551911 [============>.................] - ETA: 33s
 97787904/221551911 [============>.................] - ETA: 33s
 97984512/221551911 [============>.................] - ETA: 33s
 98181120/221551911 [============>.................] - ETA: 33s
 98377728/221551911 [============>.................] - ETA: 33s
 98574336/221551911 [============>.................] - ETA: 33s
 98770944/221551911 [============>.................] - ETA: 33s
 98967552/221551911 [============>.................] - ETA: 33s
 99164160/221551911 [============>.................] - ETA: 33s
 99360768/221551911 [============>.................] - ETA: 33s
 99557376/221551911 [============>.................] - ETA: 33s
 99753984/221551911 [============>.................] - ETA: 33s
 99950592/221551911 [============>.................] - ETA: 33s
100147200/221551911 [============>.................] - ETA: 33s
100343808/221551911 [============>.................] - ETA: 33s
100540416/221551911 [============>.................] - ETA: 32s
100737024/221551911 [============>.................] - ETA: 32s
100933632/221551911 [============>.................] - ETA: 32s
101130240/221551911 [============>.................] - ETA: 32s
101326848/221551911 [============>.................] - ETA: 32s
101523456/221551911 [============>.................] - ETA: 32s
101720064/221551911 [============>.................] - ETA: 32s
101916672/221551911 [============>.................] - ETA: 32s
102113280/221551911 [============>.................] - ETA: 32s
102309888/221551911 [============>.................] - ETA: 32s
102506496/221551911 [============>.................] - ETA: 32s
102703104/221551911 [============>.................] - ETA: 32s
102899712/221551911 [============>.................] - ETA: 32s
103096320/221551911 [============>.................] - ETA: 32s
103292928/221551911 [============>.................] - ETA: 32s
103489536/221551911 [=============>................] - ETA: 32s
103686144/221551911 [=============>................] - ETA: 32s
103882752/221551911 [=============>................] - ETA: 32s
104079360/221551911 [=============>................] - ETA: 32s
104275968/221551911 [=============>................] - ETA: 31s
104472576/221551911 [=============>................] - ETA: 31s
104669184/221551911 [=============>................] - ETA: 31s
104865792/221551911 [=============>................] - ETA: 31s
105062400/221551911 [=============>................] - ETA: 31s
105259008/221551911 [=============>................] - ETA: 31s
105455616/221551911 [=============>................] - ETA: 31s
105652224/221551911 [=============>................] - ETA: 31s
105848832/221551911 [=============>................] - ETA: 31s
106045440/221551911 [=============>................] - ETA: 31s
106242048/221551911 [=============>................] - ETA: 31s
106438656/221551911 [=============>................] - ETA: 31s
106635264/221551911 [=============>................] - ETA: 31s
106831872/221551911 [=============>................] - ETA: 31s
107028480/221551911 [=============>................] - ETA: 31s
107225088/221551911 [=============>................] - ETA: 31s
107421696/221551911 [=============>................] - ETA: 31s
107618304/221551911 [=============>................] - ETA: 31s
107814912/221551911 [=============>................] - ETA: 30s
108011520/221551911 [=============>................] - ETA: 30s
108208128/221551911 [=============>................] - ETA: 30s
108404736/221551911 [=============>................] - ETA: 30s
108601344/221551911 [=============>................] - ETA: 30s
108797952/221551911 [=============>................] - ETA: 30s
108994560/221551911 [=============>................] - ETA: 30s
109191168/221551911 [=============>................] - ETA: 30s
109387776/221551911 [=============>................] - ETA: 30s
109584384/221551911 [=============>................] - ETA: 30s
109780992/221551911 [=============>................] - ETA: 30s
109977600/221551911 [=============>................] - ETA: 30s
110174208/221551911 [=============>................] - ETA: 30s
110370816/221551911 [=============>................] - ETA: 30s
110567424/221551911 [=============>................] - ETA: 30s
110764032/221551911 [=============>................] - ETA: 30s
110960640/221551911 [==============>...............] - ETA: 30s
111157248/221551911 [==============>...............] - ETA: 30s
111353856/221551911 [==============>...............] - ETA: 30s
111550464/221551911 [==============>...............] - ETA: 29s
111747072/221551911 [==============>...............] - ETA: 29s
111943680/221551911 [==============>...............] - ETA: 29s
112140288/221551911 [==============>...............] - ETA: 29s
112336896/221551911 [==============>...............] - ETA: 29s
112533504/221551911 [==============>...............] - ETA: 29s
112730112/221551911 [==============>...............] - ETA: 29s
112926720/221551911 [==============>...............] - ETA: 29s
113123328/221551911 [==============>...............] - ETA: 29s
113319936/221551911 [==============>...............] - ETA: 29s
113516544/221551911 [==============>...............] - ETA: 29s
113713152/221551911 [==============>...............] - ETA: 29s
113909760/221551911 [==============>...............] - ETA: 29s
114106368/221551911 [==============>...............] - ETA: 29s
114302976/221551911 [==============>...............] - ETA: 29s
114499584/221551911 [==============>...............] - ETA: 29s
114696192/221551911 [==============>...............] - ETA: 29s
114892800/221551911 [==============>...............] - ETA: 29s
115089408/221551911 [==============>...............] - ETA: 28s
115286016/221551911 [==============>...............] - ETA: 28s
115482624/221551911 [==============>...............] - ETA: 28s
115679232/221551911 [==============>...............] - ETA: 28s
115875840/221551911 [==============>...............] - ETA: 28s
116072448/221551911 [==============>...............] - ETA: 28s
116269056/221551911 [==============>...............] - ETA: 28s
116465664/221551911 [==============>...............] - ETA: 28s
116662272/221551911 [==============>...............] - ETA: 28s
116858880/221551911 [==============>...............] - ETA: 28s
117055488/221551911 [==============>...............] - ETA: 28s
117252096/221551911 [==============>...............] - ETA: 28s
117448704/221551911 [==============>...............] - ETA: 28s
117645312/221551911 [==============>...............] - ETA: 28s
117841920/221551911 [==============>...............] - ETA: 28s
118038528/221551911 [==============>...............] - ETA: 28s
118235136/221551911 [===============>..............] - ETA: 28s
118431744/221551911 [===============>..............] - ETA: 28s
118628352/221551911 [===============>..............] - ETA: 28s
118824960/221551911 [===============>..............] - ETA: 27s
119021568/221551911 [===============>..............] - ETA: 27s
119218176/221551911 [===============>..............] - ETA: 27s
119414784/221551911 [===============>..............] - ETA: 27s
119611392/221551911 [===============>..............] - ETA: 27s
119808000/221551911 [===============>..............] - ETA: 27s
120004608/221551911 [===============>..............] - ETA: 27s
120201216/221551911 [===============>..............] - ETA: 27s
120397824/221551911 [===============>..............] - ETA: 27s
120594432/221551911 [===============>..............] - ETA: 27s
120791040/221551911 [===============>..............] - ETA: 27s
120987648/221551911 [===============>..............] - ETA: 27s
121184256/221551911 [===============>..............] - ETA: 27s
121380864/221551911 [===============>..............] - ETA: 27s
121577472/221551911 [===============>..............] - ETA: 27s
121774080/221551911 [===============>..............] - ETA: 27s
121970688/221551911 [===============>..............] - ETA: 27s
122167296/221551911 [===============>..............] - ETA: 27s
122363904/221551911 [===============>..............] - ETA: 27s
122560512/221551911 [===============>..............] - ETA: 26s
122757120/221551911 [===============>..............] - ETA: 26s
122953728/221551911 [===============>..............] - ETA: 26s
123150336/221551911 [===============>..............] - ETA: 26s
123346944/221551911 [===============>..............] - ETA: 26s
123543552/221551911 [===============>..............] - ETA: 26s
123740160/221551911 [===============>..............] - ETA: 26s
123936768/221551911 [===============>..............] - ETA: 26s
124133376/221551911 [===============>..............] - ETA: 26s
124329984/221551911 [===============>..............] - ETA: 26s
124526592/221551911 [===============>..............] - ETA: 26s
124723200/221551911 [===============>..............] - ETA: 26s
124919808/221551911 [===============>..............] - ETA: 26s
125116416/221551911 [===============>..............] - ETA: 26s
125313024/221551911 [===============>..............] - ETA: 26s
125509632/221551911 [===============>..............] - ETA: 26s
125706240/221551911 [================>.............] - ETA: 26s
125902848/221551911 [================>.............] - ETA: 26s
126099456/221551911 [================>.............] - ETA: 25s
126296064/221551911 [================>.............] - ETA: 25s
126492672/221551911 [================>.............] - ETA: 25s
126689280/221551911 [================>.............] - ETA: 25s
126885888/221551911 [================>.............] - ETA: 25s
127082496/221551911 [================>.............] - ETA: 25s
127279104/221551911 [================>.............] - ETA: 25s
127475712/221551911 [================>.............] - ETA: 25s
127672320/221551911 [================>.............] - ETA: 25s
127868928/221551911 [================>.............] - ETA: 25s
128065536/221551911 [================>.............] - ETA: 25s
128262144/221551911 [================>.............] - ETA: 25s
128458752/221551911 [================>.............] - ETA: 25s
128655360/221551911 [================>.............] - ETA: 25s
128851968/221551911 [================>.............] - ETA: 25s
129048576/221551911 [================>.............] - ETA: 25s
129245184/221551911 [================>.............] - ETA: 25s
129441792/221551911 [================>.............] - ETA: 25s
129638400/221551911 [================>.............] - ETA: 25s
129835008/221551911 [================>.............] - ETA: 24s
130031616/221551911 [================>.............] - ETA: 24s
130228224/221551911 [================>.............] - ETA: 24s
130424832/221551911 [================>.............] - ETA: 24s
130621440/221551911 [================>.............] - ETA: 24s
130818048/221551911 [================>.............] - ETA: 24s
131014656/221551911 [================>.............] - ETA: 24s
131211264/221551911 [================>.............] - ETA: 24s
131407872/221551911 [================>.............] - ETA: 24s
131604480/221551911 [================>.............] - ETA: 24s
131801088/221551911 [================>.............] - ETA: 24s
131997696/221551911 [================>.............] - ETA: 24s
132194304/221551911 [================>.............] - ETA: 24s
132390912/221551911 [================>.............] - ETA: 24s
132587520/221551911 [================>.............] - ETA: 24s
132784128/221551911 [================>.............] - ETA: 24s
132980736/221551911 [=================>............] - ETA: 24s
133177344/221551911 [=================>............] - ETA: 24s
133373952/221551911 [=================>............] - ETA: 24s
133570560/221551911 [=================>............] - ETA: 23s
133767168/221551911 [=================>............] - ETA: 23s
133963776/221551911 [=================>............] - ETA: 23s
134160384/221551911 [=================>............] - ETA: 23s
134356992/221551911 [=================>............] - ETA: 23s
134553600/221551911 [=================>............] - ETA: 23s
134750208/221551911 [=================>............] - ETA: 23s
134946816/221551911 [=================>............] - ETA: 23s
135143424/221551911 [=================>............] - ETA: 23s
135340032/221551911 [=================>............] - ETA: 23s
135536640/221551911 [=================>............] - ETA: 23s
135733248/221551911 [=================>............] - ETA: 23s
135929856/221551911 [=================>............] - ETA: 23s
136126464/221551911 [=================>............] - ETA: 23s
136323072/221551911 [=================>............] - ETA: 23s
136519680/221551911 [=================>............] - ETA: 23s
136716288/221551911 [=================>............] - ETA: 23s
136912896/221551911 [=================>............] - ETA: 23s
137109504/221551911 [=================>............] - ETA: 22s
137306112/221551911 [=================>............] - ETA: 22s
137502720/221551911 [=================>............] - ETA: 22s
137699328/221551911 [=================>............] - ETA: 22s
137895936/221551911 [=================>............] - ETA: 22s
138092544/221551911 [=================>............] - ETA: 22s
138289152/221551911 [=================>............] - ETA: 22s
138485760/221551911 [=================>............] - ETA: 22s
138682368/221551911 [=================>............] - ETA: 22s
138878976/221551911 [=================>............] - ETA: 22s
139075584/221551911 [=================>............] - ETA: 22s
139272192/221551911 [=================>............] - ETA: 22s
139468800/221551911 [=================>............] - ETA: 22s
139665408/221551911 [=================>............] - ETA: 22s
139862016/221551911 [=================>............] - ETA: 22s
140058624/221551911 [=================>............] - ETA: 22s
140255232/221551911 [=================>............] - ETA: 22s
140451840/221551911 [==================>...........] - ETA: 22s
140648448/221551911 [==================>...........] - ETA: 22s
140845056/221551911 [==================>...........] - ETA: 21s
141041664/221551911 [==================>...........] - ETA: 21s
141238272/221551911 [==================>...........] - ETA: 21s
141434880/221551911 [==================>...........] - ETA: 21s
141631488/221551911 [==================>...........] - ETA: 21s
141828096/221551911 [==================>...........] - ETA: 21s
142024704/221551911 [==================>...........] - ETA: 21s
142221312/221551911 [==================>...........] - ETA: 21s
142417920/221551911 [==================>...........] - ETA: 21s
142614528/221551911 [==================>...........] - ETA: 21s
142811136/221551911 [==================>...........] - ETA: 21s
143007744/221551911 [==================>...........] - ETA: 21s
143204352/221551911 [==================>...........] - ETA: 21s
143400960/221551911 [==================>...........] - ETA: 21s
143597568/221551911 [==================>...........] - ETA: 21s
143794176/221551911 [==================>...........] - ETA: 21s
143990784/221551911 [==================>...........] - ETA: 21s
144187392/221551911 [==================>...........] - ETA: 21s
144384000/221551911 [==================>...........] - ETA: 21s
144580608/221551911 [==================>...........] - ETA: 20s
144777216/221551911 [==================>...........] - ETA: 20s
144973824/221551911 [==================>...........] - ETA: 20s
145170432/221551911 [==================>...........] - ETA: 20s
145367040/221551911 [==================>...........] - ETA: 20s
145563648/221551911 [==================>...........] - ETA: 20s
145760256/221551911 [==================>...........] - ETA: 20s
145956864/221551911 [==================>...........] - ETA: 20s
146153472/221551911 [==================>...........] - ETA: 20s
146350080/221551911 [==================>...........] - ETA: 20s
146546688/221551911 [==================>...........] - ETA: 20s
146743296/221551911 [==================>...........] - ETA: 20s
146939904/221551911 [==================>...........] - ETA: 20s
147136512/221551911 [==================>...........] - ETA: 20s
147333120/221551911 [==================>...........] - ETA: 20s
147529728/221551911 [==================>...........] - ETA: 20s
147726336/221551911 [===================>..........] - ETA: 20s
147922944/221551911 [===================>..........] - ETA: 20s
148119552/221551911 [===================>..........] - ETA: 19s
148316160/221551911 [===================>..........] - ETA: 19s
148512768/221551911 [===================>..........] - ETA: 19s
148709376/221551911 [===================>..........] - ETA: 19s
148905984/221551911 [===================>..........] - ETA: 19s
149102592/221551911 [===================>..........] - ETA: 19s
149299200/221551911 [===================>..........] - ETA: 19s
149495808/221551911 [===================>..........] - ETA: 19s
149692416/221551911 [===================>..........] - ETA: 19s
149889024/221551911 [===================>..........] - ETA: 19s
150085632/221551911 [===================>..........] - ETA: 19s
150282240/221551911 [===================>..........] - ETA: 19s
150478848/221551911 [===================>..........] - ETA: 19s
150675456/221551911 [===================>..........] - ETA: 19s
150872064/221551911 [===================>..........] - ETA: 19s
151068672/221551911 [===================>..........] - ETA: 19s
151265280/221551911 [===================>..........] - ETA: 19s
151461888/221551911 [===================>..........] - ETA: 19s
151658496/221551911 [===================>..........] - ETA: 19s
151855104/221551911 [===================>..........] - ETA: 18s
152051712/221551911 [===================>..........] - ETA: 18s
152248320/221551911 [===================>..........] - ETA: 18s
152444928/221551911 [===================>..........] - ETA: 18s
152641536/221551911 [===================>..........] - ETA: 18s
152838144/221551911 [===================>..........] - ETA: 18s
153034752/221551911 [===================>..........] - ETA: 18s
153231360/221551911 [===================>..........] - ETA: 18s
153427968/221551911 [===================>..........] - ETA: 18s
153624576/221551911 [===================>..........] - ETA: 18s
153821184/221551911 [===================>..........] - ETA: 18s
154017792/221551911 [===================>..........] - ETA: 18s
154214400/221551911 [===================>..........] - ETA: 18s
154411008/221551911 [===================>..........] - ETA: 18s
154607616/221551911 [===================>..........] - ETA: 18s
154804224/221551911 [===================>..........] - ETA: 18s
155000832/221551911 [===================>..........] - ETA: 18s
155197440/221551911 [====================>.........] - ETA: 18s
155394048/221551911 [====================>.........] - ETA: 18s
155590656/221551911 [====================>.........] - ETA: 17s
155787264/221551911 [====================>.........] - ETA: 17s
155983872/221551911 [====================>.........] - ETA: 17s
156180480/221551911 [====================>.........] - ETA: 17s
156377088/221551911 [====================>.........] - ETA: 17s
156573696/221551911 [====================>.........] - ETA: 17s
156770304/221551911 [====================>.........] - ETA: 17s
156966912/221551911 [====================>.........] - ETA: 17s
157163520/221551911 [====================>.........] - ETA: 17s
157360128/221551911 [====================>.........] - ETA: 17s
157556736/221551911 [====================>.........] - ETA: 17s
157753344/221551911 [====================>.........] - ETA: 17s
157949952/221551911 [====================>.........] - ETA: 17s
158146560/221551911 [====================>.........] - ETA: 17s
158343168/221551911 [====================>.........] - ETA: 17s
158539776/221551911 [====================>.........] - ETA: 17s
158736384/221551911 [====================>.........] - ETA: 17s
158932992/221551911 [====================>.........] - ETA: 17s
159129600/221551911 [====================>.........] - ETA: 16s
159326208/221551911 [====================>.........] - ETA: 16s
159522816/221551911 [====================>.........] - ETA: 16s
159719424/221551911 [====================>.........] - ETA: 16s
159916032/221551911 [====================>.........] - ETA: 16s
160112640/221551911 [====================>.........] - ETA: 16s
160309248/221551911 [====================>.........] - ETA: 16s
160505856/221551911 [====================>.........] - ETA: 16s
160702464/221551911 [====================>.........] - ETA: 16s
160899072/221551911 [====================>.........] - ETA: 16s
161095680/221551911 [====================>.........] - ETA: 16s
161292288/221551911 [====================>.........] - ETA: 16s
161488896/221551911 [====================>.........] - ETA: 16s
161685504/221551911 [====================>.........] - ETA: 16s
161882112/221551911 [====================>.........] - ETA: 16s
162078720/221551911 [====================>.........] - ETA: 16s
162275328/221551911 [====================>.........] - ETA: 16s
162471936/221551911 [=====================>........] - ETA: 16s
162668544/221551911 [=====================>........] - ETA: 16s
162865152/221551911 [=====================>........] - ETA: 15s
163061760/221551911 [=====================>........] - ETA: 15s
163258368/221551911 [=====================>........] - ETA: 15s
163454976/221551911 [=====================>........] - ETA: 15s
163651584/221551911 [=====================>........] - ETA: 15s
163848192/221551911 [=====================>........] - ETA: 15s
164044800/221551911 [=====================>........] - ETA: 15s
164241408/221551911 [=====================>........] - ETA: 15s
164438016/221551911 [=====================>........] - ETA: 15s
164634624/221551911 [=====================>........] - ETA: 15s
164831232/221551911 [=====================>........] - ETA: 15s
165027840/221551911 [=====================>........] - ETA: 15s
165224448/221551911 [=====================>........] - ETA: 15s
165421056/221551911 [=====================>........] - ETA: 15s
165617664/221551911 [=====================>........] - ETA: 15s
165814272/221551911 [=====================>........] - ETA: 15s
166010880/221551911 [=====================>........] - ETA: 15s
166207488/221551911 [=====================>........] - ETA: 15s
166404096/221551911 [=====================>........] - ETA: 15s
166600704/221551911 [=====================>........] - ETA: 14s
166797312/221551911 [=====================>........] - ETA: 14s
166993920/221551911 [=====================>........] - ETA: 14s
167190528/221551911 [=====================>........] - ETA: 14s
167387136/221551911 [=====================>........] - ETA: 14s
167583744/221551911 [=====================>........] - ETA: 14s
167780352/221551911 [=====================>........] - ETA: 14s
167976960/221551911 [=====================>........] - ETA: 14s
168173568/221551911 [=====================>........] - ETA: 14s
168370176/221551911 [=====================>........] - ETA: 14s
168566784/221551911 [=====================>........] - ETA: 14s
168763392/221551911 [=====================>........] - ETA: 14s
168960000/221551911 [=====================>........] - ETA: 14s
169156608/221551911 [=====================>........] - ETA: 14s
169353216/221551911 [=====================>........] - ETA: 14s
169549824/221551911 [=====================>........] - ETA: 14s
169746432/221551911 [=====================>........] - ETA: 14s
169943040/221551911 [======================>.......] - ETA: 14s
170139648/221551911 [======================>.......] - ETA: 13s
170336256/221551911 [======================>.......] - ETA: 13s
170532864/221551911 [======================>.......] - ETA: 13s
170729472/221551911 [======================>.......] - ETA: 13s
170926080/221551911 [======================>.......] - ETA: 13s
171122688/221551911 [======================>.......] - ETA: 13s
171319296/221551911 [======================>.......] - ETA: 13s
171515904/221551911 [======================>.......] - ETA: 13s
171712512/221551911 [======================>.......] - ETA: 13s
171909120/221551911 [======================>.......] - ETA: 13s
172105728/221551911 [======================>.......] - ETA: 13s
172302336/221551911 [======================>.......] - ETA: 13s
172498944/221551911 [======================>.......] - ETA: 13s
172695552/221551911 [======================>.......] - ETA: 13s
172892160/221551911 [======================>.......] - ETA: 13s
173088768/221551911 [======================>.......] - ETA: 13s
173285376/221551911 [======================>.......] - ETA: 13s
173481984/221551911 [======================>.......] - ETA: 13s
173678592/221551911 [======================>.......] - ETA: 13s
173875200/221551911 [======================>.......] - ETA: 12s
174071808/221551911 [======================>.......] - ETA: 12s
174268416/221551911 [======================>.......] - ETA: 12s
174465024/221551911 [======================>.......] - ETA: 12s
174661632/221551911 [======================>.......] - ETA: 12s
174858240/221551911 [======================>.......] - ETA: 12s
175054848/221551911 [======================>.......] - ETA: 12s
175251456/221551911 [======================>.......] - ETA: 12s
175448064/221551911 [======================>.......] - ETA: 12s
175644672/221551911 [======================>.......] - ETA: 12s
175841280/221551911 [======================>.......] - ETA: 12s
176037888/221551911 [======================>.......] - ETA: 12s
176234496/221551911 [======================>.......] - ETA: 12s
176431104/221551911 [======================>.......] - ETA: 12s
176627712/221551911 [======================>.......] - ETA: 12s
176824320/221551911 [======================>.......] - ETA: 12s
177020928/221551911 [======================>.......] - ETA: 12s
177217536/221551911 [======================>.......] - ETA: 12s
177414144/221551911 [=======================>......] - ETA: 12s
177610752/221551911 [=======================>......] - ETA: 11s
177807360/221551911 [=======================>......] - ETA: 11s
178003968/221551911 [=======================>......] - ETA: 11s
178200576/221551911 [=======================>......] - ETA: 11s
178397184/221551911 [=======================>......] - ETA: 11s
178593792/221551911 [=======================>......] - ETA: 11s
178790400/221551911 [=======================>......] - ETA: 11s
178987008/221551911 [=======================>......] - ETA: 11s
179183616/221551911 [=======================>......] - ETA: 11s
179380224/221551911 [=======================>......] - ETA: 11s
179576832/221551911 [=======================>......] - ETA: 11s
179773440/221551911 [=======================>......] - ETA: 11s
179970048/221551911 [=======================>......] - ETA: 11s
180166656/221551911 [=======================>......] - ETA: 11s
180363264/221551911 [=======================>......] - ETA: 11s
180559872/221551911 [=======================>......] - ETA: 11s
180756480/221551911 [=======================>......] - ETA: 11s
180953088/221551911 [=======================>......] - ETA: 11s
181149696/221551911 [=======================>......] - ETA: 10s
181346304/221551911 [=======================>......] - ETA: 10s
181542912/221551911 [=======================>......] - ETA: 10s
181739520/221551911 [=======================>......] - ETA: 10s
181936128/221551911 [=======================>......] - ETA: 10s
182132736/221551911 [=======================>......] - ETA: 10s
182329344/221551911 [=======================>......] - ETA: 10s
182525952/221551911 [=======================>......] - ETA: 10s
182722560/221551911 [=======================>......] - ETA: 10s
182919168/221551911 [=======================>......] - ETA: 10s
183115776/221551911 [=======================>......] - ETA: 10s
183312384/221551911 [=======================>......] - ETA: 10s
183508992/221551911 [=======================>......] - ETA: 10s
183705600/221551911 [=======================>......] - ETA: 10s
183902208/221551911 [=======================>......] - ETA: 10s
184098816/221551911 [=======================>......] - ETA: 10s
184295424/221551911 [=======================>......] - ETA: 10s
184492032/221551911 [=======================>......] - ETA: 10s
184688640/221551911 [========================>.....] - ETA: 10s
184885248/221551911 [========================>.....] - ETA: 9s 
185081856/221551911 [========================>.....] - ETA: 9s
185278464/221551911 [========================>.....] - ETA: 9s
185475072/221551911 [========================>.....] - ETA: 9s
185671680/221551911 [========================>.....] - ETA: 9s
185868288/221551911 [========================>.....] - ETA: 9s
186064896/221551911 [========================>.....] - ETA: 9s
186261504/221551911 [========================>.....] - ETA: 9s
186458112/221551911 [========================>.....] - ETA: 9s
186654720/221551911 [========================>.....] - ETA: 9s
186851328/221551911 [========================>.....] - ETA: 9s
187047936/221551911 [========================>.....] - ETA: 9s
187244544/221551911 [========================>.....] - ETA: 9s
187441152/221551911 [========================>.....] - ETA: 9s
187637760/221551911 [========================>.....] - ETA: 9s
187834368/221551911 [========================>.....] - ETA: 9s
188030976/221551911 [========================>.....] - ETA: 9s
188227584/221551911 [========================>.....] - ETA: 9s
188424192/221551911 [========================>.....] - ETA: 9s
188620800/221551911 [========================>.....] - ETA: 8s
188817408/221551911 [========================>.....] - ETA: 8s
189014016/221551911 [========================>.....] - ETA: 8s
189210624/221551911 [========================>.....] - ETA: 8s
189407232/221551911 [========================>.....] - ETA: 8s
189603840/221551911 [========================>.....] - ETA: 8s
189800448/221551911 [========================>.....] - ETA: 8s
189997056/221551911 [========================>.....] - ETA: 8s
190193664/221551911 [========================>.....] - ETA: 8s
190390272/221551911 [========================>.....] - ETA: 8s
190586880/221551911 [========================>.....] - ETA: 8s
190783488/221551911 [========================>.....] - ETA: 8s
190980096/221551911 [========================>.....] - ETA: 8s
191176704/221551911 [========================>.....] - ETA: 8s
191373312/221551911 [========================>.....] - ETA: 8s
191569920/221551911 [========================>.....] - ETA: 8s
191766528/221551911 [========================>.....] - ETA: 8s
191963136/221551911 [========================>.....] - ETA: 8s
192159744/221551911 [=========================>....] - ETA: 7s
192356352/221551911 [=========================>....] - ETA: 7s
192552960/221551911 [=========================>....] - ETA: 7s
192749568/221551911 [=========================>....] - ETA: 7s
192946176/221551911 [=========================>....] - ETA: 7s
193142784/221551911 [=========================>....] - ETA: 7s
193339392/221551911 [=========================>....] - ETA: 7s
193536000/221551911 [=========================>....] - ETA: 7s
193732608/221551911 [=========================>....] - ETA: 7s
193929216/221551911 [=========================>....] - ETA: 7s
194125824/221551911 [=========================>....] - ETA: 7s
194322432/221551911 [=========================>....] - ETA: 7s
194519040/221551911 [=========================>....] - ETA: 7s
194715648/221551911 [=========================>....] - ETA: 7s
194912256/221551911 [=========================>....] - ETA: 7s
195108864/221551911 [=========================>....] - ETA: 7s
195305472/221551911 [=========================>....] - ETA: 7s
195502080/221551911 [=========================>....] - ETA: 7s
195698688/221551911 [=========================>....] - ETA: 7s
195895296/221551911 [=========================>....] - ETA: 6s
196091904/221551911 [=========================>....] - ETA: 6s
196288512/221551911 [=========================>....] - ETA: 6s
196485120/221551911 [=========================>....] - ETA: 6s
196681728/221551911 [=========================>....] - ETA: 6s
196878336/221551911 [=========================>....] - ETA: 6s
197074944/221551911 [=========================>....] - ETA: 6s
197271552/221551911 [=========================>....] - ETA: 6s
197468160/221551911 [=========================>....] - ETA: 6s
197664768/221551911 [=========================>....] - ETA: 6s
197861376/221551911 [=========================>....] - ETA: 6s
198057984/221551911 [=========================>....] - ETA: 6s
198254592/221551911 [=========================>....] - ETA: 6s
198451200/221551911 [=========================>....] - ETA: 6s
198647808/221551911 [=========================>....] - ETA: 6s
198844416/221551911 [=========================>....] - ETA: 6s
199041024/221551911 [=========================>....] - ETA: 6s
199237632/221551911 [=========================>....] - ETA: 6s
199434240/221551911 [==========================>...] - ETA: 6s
199630848/221551911 [==========================>...] - ETA: 5s
199827456/221551911 [==========================>...] - ETA: 5s
200024064/221551911 [==========================>...] - ETA: 5s
200220672/221551911 [==========================>...] - ETA: 5s
200417280/221551911 [==========================>...] - ETA: 5s
200613888/221551911 [==========================>...] - ETA: 5s
200810496/221551911 [==========================>...] - ETA: 5s
201007104/221551911 [==========================>...] - ETA: 5s
201203712/221551911 [==========================>...] - ETA: 5s
201400320/221551911 [==========================>...] - ETA: 5s
201596928/221551911 [==========================>...] - ETA: 5s
201793536/221551911 [==========================>...] - ETA: 5s
201990144/221551911 [==========================>...] - ETA: 5s
202186752/221551911 [==========================>...] - ETA: 5s
202383360/221551911 [==========================>...] - ETA: 5s
202579968/221551911 [==========================>...] - ETA: 5s
202776576/221551911 [==========================>...] - ETA: 5s
202973184/221551911 [==========================>...] - ETA: 5s
203169792/221551911 [==========================>...] - ETA: 5s
203366400/221551911 [==========================>...] - ETA: 4s
203563008/221551911 [==========================>...] - ETA: 4s
203759616/221551911 [==========================>...] - ETA: 4s
203956224/221551911 [==========================>...] - ETA: 4s
204152832/221551911 [==========================>...] - ETA: 4s
204349440/221551911 [==========================>...] - ETA: 4s
204546048/221551911 [==========================>...] - ETA: 4s
204742656/221551911 [==========================>...] - ETA: 4s
204939264/221551911 [==========================>...] - ETA: 4s
205135872/221551911 [==========================>...] - ETA: 4s
205332480/221551911 [==========================>...] - ETA: 4s
205529088/221551911 [==========================>...] - ETA: 4s
205725696/221551911 [==========================>...] - ETA: 4s
205922304/221551911 [==========================>...] - ETA: 4s
206118912/221551911 [==========================>...] - ETA: 4s
206315520/221551911 [==========================>...] - ETA: 4s
206512128/221551911 [==========================>...] - ETA: 4s
206708736/221551911 [==========================>...] - ETA: 4s
206905344/221551911 [===========================>..] - ETA: 3s
207101952/221551911 [===========================>..] - ETA: 3s
207298560/221551911 [===========================>..] - ETA: 3s
207495168/221551911 [===========================>..] - ETA: 3s
207691776/221551911 [===========================>..] - ETA: 3s
207888384/221551911 [===========================>..] - ETA: 3s
208084992/221551911 [===========================>..] - ETA: 3s
208281600/221551911 [===========================>..] - ETA: 3s
208478208/221551911 [===========================>..] - ETA: 3s
208674816/221551911 [===========================>..] - ETA: 3s
208871424/221551911 [===========================>..] - ETA: 3s
209068032/221551911 [===========================>..] - ETA: 3s
209264640/221551911 [===========================>..] - ETA: 3s
209461248/221551911 [===========================>..] - ETA: 3s
209657856/221551911 [===========================>..] - ETA: 3s
209854464/221551911 [===========================>..] - ETA: 3s
210051072/221551911 [===========================>..] - ETA: 3s
210247680/221551911 [===========================>..] - ETA: 3s
210444288/221551911 [===========================>..] - ETA: 3s
210640896/221551911 [===========================>..] - ETA: 2s
210837504/221551911 [===========================>..] - ETA: 2s
211034112/221551911 [===========================>..] - ETA: 2s
211230720/221551911 [===========================>..] - ETA: 2s
211427328/221551911 [===========================>..] - ETA: 2s
211623936/221551911 [===========================>..] - ETA: 2s
211820544/221551911 [===========================>..] - ETA: 2s
212017152/221551911 [===========================>..] - ETA: 2s
212213760/221551911 [===========================>..] - ETA: 2s
212410368/221551911 [===========================>..] - ETA: 2s
212606976/221551911 [===========================>..] - ETA: 2s
212803584/221551911 [===========================>..] - ETA: 2s
213000192/221551911 [===========================>..] - ETA: 2s
213196800/221551911 [===========================>..] - ETA: 2s
213393408/221551911 [===========================>..] - ETA: 2s
213590016/221551911 [===========================>..] - ETA: 2s
213786624/221551911 [===========================>..] - ETA: 2s
213983232/221551911 [===========================>..] - ETA: 2s
214179840/221551911 [============================>.] - ETA: 2s
214376448/221551911 [============================>.] - ETA: 1s
214573056/221551911 [============================>.] - ETA: 1s
214769664/221551911 [============================>.] - ETA: 1s
214966272/221551911 [============================>.] - ETA: 1s
215162880/221551911 [============================>.] - ETA: 1s
215359488/221551911 [============================>.] - ETA: 1s
215556096/221551911 [============================>.] - ETA: 1s
215752704/221551911 [============================>.] - ETA: 1s
215949312/221551911 [============================>.] - ETA: 1s
216145920/221551911 [============================>.] - ETA: 1s
216342528/221551911 [============================>.] - ETA: 1s
216539136/221551911 [============================>.] - ETA: 1s
216735744/221551911 [============================>.] - ETA: 1s
216932352/221551911 [============================>.] - ETA: 1s
217128960/221551911 [============================>.] - ETA: 1s
217325568/221551911 [============================>.] - ETA: 1s
217522176/221551911 [============================>.] - ETA: 1s
217718784/221551911 [============================>.] - ETA: 1s
217915392/221551911 [============================>.] - ETA: 0s
218112000/221551911 [============================>.] - ETA: 0s
218308608/221551911 [============================>.] - ETA: 0s
218505216/221551911 [============================>.] - ETA: 0s
218701824/221551911 [============================>.] - ETA: 0s
218898432/221551911 [============================>.] - ETA: 0s
219095040/221551911 [============================>.] - ETA: 0s
219291648/221551911 [============================>.] - ETA: 0s
219488256/221551911 [============================>.] - ETA: 0s
219684864/221551911 [============================>.] - ETA: 0s
219881472/221551911 [============================>.] - ETA: 0s
220078080/221551911 [============================>.] - ETA: 0s
220274688/221551911 [============================>.] - ETA: 0s
220471296/221551911 [============================>.] - ETA: 0s
220667904/221551911 [============================>.] - ETA: 0s
220864512/221551911 [============================>.] - ETA: 0s
221061120/221551911 [============================>.] - ETA: 0s
221257728/221551911 [============================>.] - ETA: 0s
221454336/221551911 [============================>.] - ETA: 0s
221552640/221551911 [==============================] - 60s 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.63889, 1.14344], [1.27364, 2.80864], [2.33321, 2.99208], [3.63886, 5.07125], [5.26998, 5.73651]]

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,
                  grid_size=grid_size,
                  alpha=0.5)
model.summary()

Out:

WARNING: Keyword argument 'strides' is not supported in conv_block except for the first layer.
Model: "yolo_base"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
input_10 (InputLayer)        [(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:

<tf.Tensor 'YOLO_output/Identity:0' shape=(None, 7, 7, 5, 7) dtype=float32>

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.99 %

42.13 %

35.54 %

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

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

    8192/14122408 [..............................] - ETA: 51s
   73728/14122408 [..............................] - ETA: 15s
  270336/14122408 [..............................] - ETA: 6s 
  466944/14122408 [..............................] - ETA: 5s
  663552/14122408 [>.............................] - ETA: 4s
  860160/14122408 [>.............................] - ETA: 4s
 1056768/14122408 [=>............................] - ETA: 4s
 1253376/14122408 [=>............................] - ETA: 4s
 1449984/14122408 [==>...........................] - ETA: 3s
 1646592/14122408 [==>...........................] - ETA: 3s
 1843200/14122408 [==>...........................] - ETA: 3s
 2039808/14122408 [===>..........................] - ETA: 3s
 2236416/14122408 [===>..........................] - ETA: 3s
 2433024/14122408 [====>.........................] - ETA: 3s
 2629632/14122408 [====>.........................] - ETA: 3s
 2826240/14122408 [=====>........................] - ETA: 3s
 3022848/14122408 [=====>........................] - ETA: 3s
 3219456/14122408 [=====>........................] - ETA: 3s
 3416064/14122408 [======>.......................] - ETA: 3s
 3612672/14122408 [======>.......................] - ETA: 3s
 3809280/14122408 [=======>......................] - ETA: 2s
 4005888/14122408 [=======>......................] - ETA: 2s
 4202496/14122408 [=======>......................] - ETA: 2s
 4399104/14122408 [========>.....................] - ETA: 2s
 4595712/14122408 [========>.....................] - ETA: 2s
 4792320/14122408 [=========>....................] - ETA: 2s
 4988928/14122408 [=========>....................] - ETA: 2s
 5185536/14122408 [==========>...................] - ETA: 2s
 5382144/14122408 [==========>...................] - ETA: 2s
 5578752/14122408 [==========>...................] - ETA: 2s
 5775360/14122408 [===========>..................] - ETA: 2s
 5971968/14122408 [===========>..................] - ETA: 2s
 6168576/14122408 [============>.................] - ETA: 2s
 6365184/14122408 [============>.................] - ETA: 2s
 6561792/14122408 [============>.................] - ETA: 2s
 6758400/14122408 [=============>................] - ETA: 2s
 6955008/14122408 [=============>................] - ETA: 2s
 7151616/14122408 [==============>...............] - ETA: 1s
 7348224/14122408 [==============>...............] - ETA: 1s
 7544832/14122408 [===============>..............] - ETA: 1s
 7741440/14122408 [===============>..............] - ETA: 1s
 7938048/14122408 [===============>..............] - ETA: 1s
 8134656/14122408 [================>.............] - ETA: 1s
 8331264/14122408 [================>.............] - ETA: 1s
 8527872/14122408 [=================>............] - ETA: 1s
 8724480/14122408 [=================>............] - ETA: 1s
 8921088/14122408 [=================>............] - ETA: 1s
 9117696/14122408 [==================>...........] - ETA: 1s
 9314304/14122408 [==================>...........] - ETA: 1s
 9510912/14122408 [===================>..........] - ETA: 1s
 9707520/14122408 [===================>..........] - ETA: 1s
 9904128/14122408 [====================>.........] - ETA: 1s
10100736/14122408 [====================>.........] - ETA: 1s
10297344/14122408 [====================>.........] - ETA: 1s
10493952/14122408 [=====================>........] - ETA: 1s
10690560/14122408 [=====================>........] - ETA: 0s
10887168/14122408 [======================>.......] - ETA: 0s
11083776/14122408 [======================>.......] - ETA: 0s
11280384/14122408 [======================>.......] - ETA: 0s
11476992/14122408 [=======================>......] - ETA: 0s
11673600/14122408 [=======================>......] - ETA: 0s
11870208/14122408 [========================>.....] - ETA: 0s
12066816/14122408 [========================>.....] - ETA: 0s
12263424/14122408 [=========================>....] - ETA: 0s
12460032/14122408 [=========================>....] - ETA: 0s
12656640/14122408 [=========================>....] - ETA: 0s
12853248/14122408 [==========================>...] - ETA: 0s
13049856/14122408 [==========================>...] - ETA: 0s
13246464/14122408 [===========================>..] - ETA: 0s
13443072/14122408 [===========================>..] - ETA: 0s
13639680/14122408 [===========================>..] - ETA: 0s
13836288/14122408 [============================>.] - ETA: 0s
14032896/14122408 [============================>.] - ETA: 0s
14123008/14122408 [==============================] - 4s 0us/step
car 0.3496
person 0.3020
mAP: 0.3258
Keras inference on 100 images took 3.26 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, input_scaling=(127.5, 127.5))
model_akida.summary()

Out:

                                         Model Summary
_______________________________________________________________________________________________
Layer (type)                              Output shape    Kernel shape
===============================================================================================
conv_0 (InputConvolutional)               [112, 112, 16]  (3, 3, 3, 16)
_______________________________________________________________________________________________
separable_1 (SeparableConvolutional)      [112, 112, 32]  (3, 3, 16, 1), (1, 1, 16, 32)
_______________________________________________________________________________________________
separable_2 (SeparableConvolutional)      [56, 56, 64]    (3, 3, 32, 1), (1, 1, 32, 64)
_______________________________________________________________________________________________
separable_3 (SeparableConvolutional)      [56, 56, 64]    (3, 3, 64, 1), (1, 1, 64, 64)
_______________________________________________________________________________________________
separable_4 (SeparableConvolutional)      [28, 28, 128]   (3, 3, 64, 1), (1, 1, 64, 128)
_______________________________________________________________________________________________
separable_5 (SeparableConvolutional)      [28, 28, 128]   (3, 3, 128, 1), (1, 1, 128, 128)
_______________________________________________________________________________________________
separable_6 (SeparableConvolutional)      [14, 14, 256]   (3, 3, 128, 1), (1, 1, 128, 256)
_______________________________________________________________________________________________
separable_7 (SeparableConvolutional)      [14, 14, 256]   (3, 3, 256, 1), (1, 1, 256, 256)
_______________________________________________________________________________________________
separable_8 (SeparableConvolutional)      [14, 14, 256]   (3, 3, 256, 1), (1, 1, 256, 256)
_______________________________________________________________________________________________
separable_9 (SeparableConvolutional)      [14, 14, 256]   (3, 3, 256, 1), (1, 1, 256, 256)
_______________________________________________________________________________________________
separable_10 (SeparableConvolutional)     [14, 14, 256]   (3, 3, 256, 1), (1, 1, 256, 256)
_______________________________________________________________________________________________
separable_11 (SeparableConvolutional)     [14, 14, 256]   (3, 3, 256, 1), (1, 1, 256, 256)
_______________________________________________________________________________________________
separable_12 (SeparableConvolutional)     [7, 7, 512]     (3, 3, 256, 1), (1, 1, 256, 512)
_______________________________________________________________________________________________
separable_13 (SeparableConvolutional)     [7, 7, 512]     (3, 3, 512, 1), (1, 1, 512, 512)
_______________________________________________________________________________________________
1conv (SeparableConvolutional)            [7, 7, 1024]    (3, 3, 512, 1), (1, 1, 512, 1024)
_______________________________________________________________________________________________
2conv (SeparableConvolutional)            [7, 7, 1024]    (3, 3, 1024, 1), (1, 1, 1024, 1024)
_______________________________________________________________________________________________
3conv (SeparableConvolutional)            [7, 7, 1024]    (3, 3, 1024, 1), (1, 1, 1024, 1024)
_______________________________________________________________________________________________
detection_layer (SeparableConvolutional)  [7, 7, 35]      (3, 3, 1024, 1), (1, 1, 1024, 35)
_______________________________________________________________________________________________
Input shape: 224, 224, 3
Backend type: Software - 1.8.9

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

26.70 %

29.87 %

1000

32.95 %

33.47 %

2500

35.54 %

31.65 %

# 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.4114
person 0.3006
mAP: 0.3560
Akida inference on 100 images took 19.44 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, False)
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 voc yolo detection

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

Gallery generated by Sphinx-Gallery