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: 7:16
    73728/221551911 [..............................] - ETA: 3:19
   204800/221551911 [..............................] - ETA: 2:06
   401408/221551911 [..............................] - ETA: 1:33
   598016/221551911 [..............................] - ETA: 1:21
   794624/221551911 [..............................] - ETA: 1:16
   991232/221551911 [..............................] - ETA: 1:12
  1187840/221551911 [..............................] - ETA: 1:10
  1384448/221551911 [..............................] - ETA: 1:08
  1581056/221551911 [..............................] - ETA: 1:07
  1777664/221551911 [..............................] - ETA: 1:06
  1974272/221551911 [..............................] - ETA: 1:05
  2170880/221551911 [..............................] - ETA: 1:04
  2367488/221551911 [..............................] - ETA: 1:04
  2564096/221551911 [..............................] - ETA: 1:03
  2760704/221551911 [..............................] - ETA: 1:03
  2957312/221551911 [..............................] - ETA: 1:02
  3153920/221551911 [..............................] - ETA: 1:02
  3350528/221551911 [..............................] - ETA: 1:02
  3547136/221551911 [..............................] - ETA: 1:01
  3743744/221551911 [..............................] - ETA: 1:01
  3940352/221551911 [..............................] - ETA: 1:01
  4136960/221551911 [..............................] - ETA: 1:01
  4333568/221551911 [..............................] - ETA: 1:01
  4530176/221551911 [..............................] - ETA: 1:00
  4726784/221551911 [..............................] - ETA: 1:00
  4923392/221551911 [..............................] - ETA: 1:00
  5120000/221551911 [..............................] - ETA: 1:00
  5316608/221551911 [..............................] - ETA: 1:00
  5513216/221551911 [..............................] - ETA: 1:00
  5709824/221551911 [..............................] - ETA: 59s 
  5906432/221551911 [..............................] - ETA: 59s
  6103040/221551911 [..............................] - ETA: 59s
  6299648/221551911 [..............................] - ETA: 59s
  6496256/221551911 [..............................] - ETA: 59s
  6692864/221551911 [..............................] - ETA: 59s
  6889472/221551911 [..............................] - ETA: 59s
  6930432/221551911 [..............................] - ETA: 1:09
  6971392/221551911 [..............................] - ETA: 1:11
  7086080/221551911 [..............................] - ETA: 1:11
  7282688/221551911 [..............................] - ETA: 1:11
  7479296/221551911 [>.............................] - ETA: 1:10
  7675904/221551911 [>.............................] - ETA: 1:10
  7872512/221551911 [>.............................] - ETA: 1:10
  8069120/221551911 [>.............................] - ETA: 1:09
  8265728/221551911 [>.............................] - ETA: 1:09
  8462336/221551911 [>.............................] - ETA: 1:08
  8658944/221551911 [>.............................] - ETA: 1:08
  8855552/221551911 [>.............................] - ETA: 1:08
  9052160/221551911 [>.............................] - ETA: 1:07
  9248768/221551911 [>.............................] - ETA: 1:07
  9445376/221551911 [>.............................] - ETA: 1:07
  9641984/221551911 [>.............................] - ETA: 1:07
  9838592/221551911 [>.............................] - ETA: 1:06
 10035200/221551911 [>.............................] - ETA: 1:06
 10231808/221551911 [>.............................] - ETA: 1:06
 10428416/221551911 [>.............................] - ETA: 1:05
 10625024/221551911 [>.............................] - ETA: 1:05
 10821632/221551911 [>.............................] - ETA: 1:05
 11018240/221551911 [>.............................] - ETA: 1:05
 11214848/221551911 [>.............................] - ETA: 1:05
 11411456/221551911 [>.............................] - ETA: 1:04
 11608064/221551911 [>.............................] - ETA: 1:04
 11804672/221551911 [>.............................] - ETA: 1:04
 12001280/221551911 [>.............................] - ETA: 1:04
 12197888/221551911 [>.............................] - ETA: 1:04
 12394496/221551911 [>.............................] - ETA: 1:03
 12591104/221551911 [>.............................] - ETA: 1:03
 12787712/221551911 [>.............................] - ETA: 1:03
 12984320/221551911 [>.............................] - ETA: 1:03
 13180928/221551911 [>.............................] - ETA: 1:03
 13377536/221551911 [>.............................] - ETA: 1:02
 13574144/221551911 [>.............................] - ETA: 1:02
 13770752/221551911 [>.............................] - ETA: 1:02
 13967360/221551911 [>.............................] - ETA: 1:02
 14163968/221551911 [>.............................] - ETA: 1:02
 14360576/221551911 [>.............................] - ETA: 1:02
 14557184/221551911 [>.............................] - ETA: 1:01
 14753792/221551911 [>.............................] - ETA: 1:01
 14950400/221551911 [=>............................] - ETA: 1:01
 15147008/221551911 [=>............................] - ETA: 1:01
 15343616/221551911 [=>............................] - ETA: 1:01
 15540224/221551911 [=>............................] - ETA: 1:01
 15736832/221551911 [=>............................] - ETA: 1:01
 15933440/221551911 [=>............................] - ETA: 1:00
 16130048/221551911 [=>............................] - ETA: 1:00
 16326656/221551911 [=>............................] - ETA: 1:00
 16523264/221551911 [=>............................] - ETA: 1:00
 16719872/221551911 [=>............................] - ETA: 1:00
 16916480/221551911 [=>............................] - ETA: 1:00
 17113088/221551911 [=>............................] - ETA: 1:00
 17309696/221551911 [=>............................] - ETA: 1:00
 17506304/221551911 [=>............................] - ETA: 59s 
 17702912/221551911 [=>............................] - ETA: 59s
 17899520/221551911 [=>............................] - ETA: 59s
 18096128/221551911 [=>............................] - ETA: 59s
 18292736/221551911 [=>............................] - ETA: 59s
 18489344/221551911 [=>............................] - ETA: 59s
 18685952/221551911 [=>............................] - ETA: 59s
 18882560/221551911 [=>............................] - ETA: 59s
 19079168/221551911 [=>............................] - ETA: 58s
 19275776/221551911 [=>............................] - ETA: 58s
 19472384/221551911 [=>............................] - ETA: 58s
 19668992/221551911 [=>............................] - ETA: 58s
 19865600/221551911 [=>............................] - ETA: 58s
 20062208/221551911 [=>............................] - ETA: 58s
 20258816/221551911 [=>............................] - ETA: 58s
 20455424/221551911 [=>............................] - ETA: 58s
 20652032/221551911 [=>............................] - ETA: 58s
 20848640/221551911 [=>............................] - ETA: 58s
 21045248/221551911 [=>............................] - ETA: 57s
 21241856/221551911 [=>............................] - ETA: 57s
 21438464/221551911 [=>............................] - ETA: 57s
 21635072/221551911 [=>............................] - ETA: 57s
 21831680/221551911 [=>............................] - ETA: 57s
 22028288/221551911 [=>............................] - ETA: 57s
 22224896/221551911 [==>...........................] - ETA: 57s
 22421504/221551911 [==>...........................] - ETA: 57s
 22618112/221551911 [==>...........................] - ETA: 57s
 22814720/221551911 [==>...........................] - ETA: 57s
 23011328/221551911 [==>...........................] - ETA: 56s
 23207936/221551911 [==>...........................] - ETA: 56s
 23404544/221551911 [==>...........................] - ETA: 56s
 23601152/221551911 [==>...........................] - ETA: 56s
 23797760/221551911 [==>...........................] - ETA: 56s
 23994368/221551911 [==>...........................] - ETA: 56s
 24190976/221551911 [==>...........................] - ETA: 56s
 24387584/221551911 [==>...........................] - ETA: 56s
 24584192/221551911 [==>...........................] - ETA: 56s
 24780800/221551911 [==>...........................] - ETA: 56s
 24977408/221551911 [==>...........................] - ETA: 56s
 25174016/221551911 [==>...........................] - ETA: 55s
 25370624/221551911 [==>...........................] - ETA: 55s
 25567232/221551911 [==>...........................] - ETA: 55s
 25763840/221551911 [==>...........................] - ETA: 55s
 25960448/221551911 [==>...........................] - ETA: 55s
 26157056/221551911 [==>...........................] - ETA: 55s
 26353664/221551911 [==>...........................] - ETA: 55s
 26550272/221551911 [==>...........................] - ETA: 55s
 26746880/221551911 [==>...........................] - ETA: 55s
 26943488/221551911 [==>...........................] - ETA: 55s
 27140096/221551911 [==>...........................] - ETA: 55s
 27336704/221551911 [==>...........................] - ETA: 55s
 27533312/221551911 [==>...........................] - ETA: 55s
 27729920/221551911 [==>...........................] - ETA: 54s
 27926528/221551911 [==>...........................] - ETA: 54s
 28123136/221551911 [==>...........................] - ETA: 54s
 28319744/221551911 [==>...........................] - ETA: 54s
 28516352/221551911 [==>...........................] - ETA: 54s
 28712960/221551911 [==>...........................] - ETA: 54s
 28909568/221551911 [==>...........................] - ETA: 54s
 29106176/221551911 [==>...........................] - ETA: 54s
 29302784/221551911 [==>...........................] - ETA: 54s
 29499392/221551911 [==>...........................] - ETA: 54s
 29696000/221551911 [===>..........................] - ETA: 54s
 29892608/221551911 [===>..........................] - ETA: 54s
 30089216/221551911 [===>..........................] - ETA: 53s
 30285824/221551911 [===>..........................] - ETA: 53s
 30482432/221551911 [===>..........................] - ETA: 53s
 30679040/221551911 [===>..........................] - ETA: 53s
 30875648/221551911 [===>..........................] - ETA: 53s
 31072256/221551911 [===>..........................] - ETA: 53s
 31268864/221551911 [===>..........................] - ETA: 53s
 31465472/221551911 [===>..........................] - ETA: 53s
 31662080/221551911 [===>..........................] - ETA: 53s
 31858688/221551911 [===>..........................] - ETA: 53s
 32055296/221551911 [===>..........................] - ETA: 53s
 32251904/221551911 [===>..........................] - ETA: 53s
 32448512/221551911 [===>..........................] - ETA: 53s
 32645120/221551911 [===>..........................] - ETA: 53s
 32841728/221551911 [===>..........................] - ETA: 52s
 33038336/221551911 [===>..........................] - ETA: 52s
 33234944/221551911 [===>..........................] - ETA: 52s
 33431552/221551911 [===>..........................] - ETA: 52s
 33628160/221551911 [===>..........................] - ETA: 52s
 33824768/221551911 [===>..........................] - ETA: 52s
 34021376/221551911 [===>..........................] - ETA: 52s
 34217984/221551911 [===>..........................] - ETA: 52s
 34414592/221551911 [===>..........................] - ETA: 52s
 34611200/221551911 [===>..........................] - ETA: 52s
 34807808/221551911 [===>..........................] - ETA: 52s
 35004416/221551911 [===>..........................] - ETA: 52s
 35201024/221551911 [===>..........................] - ETA: 52s
 35397632/221551911 [===>..........................] - ETA: 52s
 35594240/221551911 [===>..........................] - ETA: 51s
 35790848/221551911 [===>..........................] - ETA: 51s
 35987456/221551911 [===>..........................] - ETA: 51s
 36184064/221551911 [===>..........................] - ETA: 51s
 36380672/221551911 [===>..........................] - ETA: 51s
 36577280/221551911 [===>..........................] - ETA: 51s
 36773888/221551911 [===>..........................] - ETA: 51s
 36970496/221551911 [====>.........................] - ETA: 51s
 37167104/221551911 [====>.........................] - ETA: 51s
 37363712/221551911 [====>.........................] - ETA: 51s
 37560320/221551911 [====>.........................] - ETA: 51s
 37756928/221551911 [====>.........................] - ETA: 51s
 37953536/221551911 [====>.........................] - ETA: 51s
 38150144/221551911 [====>.........................] - ETA: 51s
 38346752/221551911 [====>.........................] - ETA: 51s
 38543360/221551911 [====>.........................] - ETA: 50s
 38739968/221551911 [====>.........................] - ETA: 50s
 38936576/221551911 [====>.........................] - ETA: 50s
 39133184/221551911 [====>.........................] - ETA: 50s
 39329792/221551911 [====>.........................] - ETA: 50s
 39378944/221551911 [====>.........................] - ETA: 52s
 39403520/221551911 [====>.........................] - ETA: 52s
 39526400/221551911 [====>.........................] - ETA: 52s
 39723008/221551911 [====>.........................] - ETA: 52s
 39919616/221551911 [====>.........................] - ETA: 52s
 40116224/221551911 [====>.........................] - ETA: 52s
 40312832/221551911 [====>.........................] - ETA: 52s
 40509440/221551911 [====>.........................] - ETA: 52s
 40706048/221551911 [====>.........................] - ETA: 52s
 40902656/221551911 [====>.........................] - ETA: 52s
 41099264/221551911 [====>.........................] - ETA: 51s
 41295872/221551911 [====>.........................] - ETA: 51s
 41492480/221551911 [====>.........................] - ETA: 51s
 41689088/221551911 [====>.........................] - ETA: 51s
 41885696/221551911 [====>.........................] - ETA: 51s
 42082304/221551911 [====>.........................] - ETA: 51s
 42278912/221551911 [====>.........................] - ETA: 51s
 42475520/221551911 [====>.........................] - ETA: 51s
 42672128/221551911 [====>.........................] - ETA: 51s
 42868736/221551911 [====>.........................] - ETA: 51s
 43065344/221551911 [====>.........................] - ETA: 51s
 43261952/221551911 [====>.........................] - ETA: 51s
 43458560/221551911 [====>.........................] - ETA: 51s
 43655168/221551911 [====>.........................] - ETA: 51s
 43851776/221551911 [====>.........................] - ETA: 50s
 44048384/221551911 [====>.........................] - ETA: 50s
 44244992/221551911 [====>.........................] - ETA: 50s
 44441600/221551911 [=====>........................] - ETA: 50s
 44638208/221551911 [=====>........................] - ETA: 50s
 44834816/221551911 [=====>........................] - ETA: 50s
 45031424/221551911 [=====>........................] - ETA: 50s
 45228032/221551911 [=====>........................] - ETA: 50s
 45424640/221551911 [=====>........................] - ETA: 50s
 45621248/221551911 [=====>........................] - ETA: 50s
 45817856/221551911 [=====>........................] - ETA: 50s
 46014464/221551911 [=====>........................] - ETA: 50s
 46211072/221551911 [=====>........................] - ETA: 50s
 46407680/221551911 [=====>........................] - ETA: 49s
 46604288/221551911 [=====>........................] - ETA: 49s
 46800896/221551911 [=====>........................] - ETA: 49s
 46997504/221551911 [=====>........................] - ETA: 49s
 47194112/221551911 [=====>........................] - ETA: 49s
 47390720/221551911 [=====>........................] - ETA: 49s
 47587328/221551911 [=====>........................] - ETA: 49s
 47783936/221551911 [=====>........................] - ETA: 49s
 47980544/221551911 [=====>........................] - ETA: 49s
 48177152/221551911 [=====>........................] - ETA: 49s
 48373760/221551911 [=====>........................] - ETA: 49s
 48570368/221551911 [=====>........................] - ETA: 49s
 48766976/221551911 [=====>........................] - ETA: 49s
 48963584/221551911 [=====>........................] - ETA: 49s
 49160192/221551911 [=====>........................] - ETA: 49s
 49356800/221551911 [=====>........................] - ETA: 48s
 49553408/221551911 [=====>........................] - ETA: 48s
 49750016/221551911 [=====>........................] - ETA: 48s
 49946624/221551911 [=====>........................] - ETA: 48s
 50143232/221551911 [=====>........................] - ETA: 48s
 50339840/221551911 [=====>........................] - ETA: 48s
 50536448/221551911 [=====>........................] - ETA: 48s
 50733056/221551911 [=====>........................] - ETA: 48s
 50929664/221551911 [=====>........................] - ETA: 48s
 51126272/221551911 [=====>........................] - ETA: 48s
 51322880/221551911 [=====>........................] - ETA: 48s
 51519488/221551911 [=====>........................] - ETA: 48s
 51716096/221551911 [======>.......................] - ETA: 48s
 51912704/221551911 [======>.......................] - ETA: 48s
 52109312/221551911 [======>.......................] - ETA: 47s
 52305920/221551911 [======>.......................] - ETA: 47s
 52502528/221551911 [======>.......................] - ETA: 47s
 52699136/221551911 [======>.......................] - ETA: 47s
 52895744/221551911 [======>.......................] - ETA: 47s
 53092352/221551911 [======>.......................] - ETA: 47s
 53288960/221551911 [======>.......................] - ETA: 47s
 53485568/221551911 [======>.......................] - ETA: 47s
 53682176/221551911 [======>.......................] - ETA: 47s
 53878784/221551911 [======>.......................] - ETA: 47s
 54075392/221551911 [======>.......................] - ETA: 47s
 54272000/221551911 [======>.......................] - ETA: 47s
 54468608/221551911 [======>.......................] - ETA: 47s
 54665216/221551911 [======>.......................] - ETA: 47s
 54861824/221551911 [======>.......................] - ETA: 47s
 55058432/221551911 [======>.......................] - ETA: 47s
 55255040/221551911 [======>.......................] - ETA: 46s
 55451648/221551911 [======>.......................] - ETA: 46s
 55648256/221551911 [======>.......................] - ETA: 46s
 55844864/221551911 [======>.......................] - ETA: 46s
 56041472/221551911 [======>.......................] - ETA: 46s
 56238080/221551911 [======>.......................] - ETA: 46s
 56434688/221551911 [======>.......................] - ETA: 46s
 56631296/221551911 [======>.......................] - ETA: 46s
 56827904/221551911 [======>.......................] - ETA: 46s
 57024512/221551911 [======>.......................] - ETA: 46s
 57221120/221551911 [======>.......................] - ETA: 46s
 57417728/221551911 [======>.......................] - ETA: 46s
 57614336/221551911 [======>.......................] - ETA: 46s
 57810944/221551911 [======>.......................] - ETA: 46s
 58007552/221551911 [======>.......................] - ETA: 46s
 58204160/221551911 [======>.......................] - ETA: 45s
 58400768/221551911 [======>.......................] - ETA: 45s
 58597376/221551911 [======>.......................] - ETA: 45s
 58793984/221551911 [======>.......................] - ETA: 45s
 58990592/221551911 [======>.......................] - ETA: 45s
 59187200/221551911 [=======>......................] - ETA: 45s
 59383808/221551911 [=======>......................] - ETA: 45s
 59580416/221551911 [=======>......................] - ETA: 45s
 59777024/221551911 [=======>......................] - ETA: 45s
 59973632/221551911 [=======>......................] - ETA: 45s
 60170240/221551911 [=======>......................] - ETA: 45s
 60366848/221551911 [=======>......................] - ETA: 45s
 60563456/221551911 [=======>......................] - ETA: 45s
 60760064/221551911 [=======>......................] - ETA: 45s
 60956672/221551911 [=======>......................] - ETA: 45s
 61153280/221551911 [=======>......................] - ETA: 45s
 61349888/221551911 [=======>......................] - ETA: 44s
 61546496/221551911 [=======>......................] - ETA: 44s
 61743104/221551911 [=======>......................] - ETA: 44s
 61939712/221551911 [=======>......................] - ETA: 44s
 62136320/221551911 [=======>......................] - ETA: 44s
 62332928/221551911 [=======>......................] - ETA: 44s
 62529536/221551911 [=======>......................] - ETA: 44s
 62726144/221551911 [=======>......................] - ETA: 44s
 62922752/221551911 [=======>......................] - ETA: 44s
 63119360/221551911 [=======>......................] - ETA: 44s
 63315968/221551911 [=======>......................] - ETA: 44s
 63512576/221551911 [=======>......................] - ETA: 44s
 63709184/221551911 [=======>......................] - ETA: 44s
 63905792/221551911 [=======>......................] - ETA: 44s
 64102400/221551911 [=======>......................] - ETA: 44s
 64299008/221551911 [=======>......................] - ETA: 44s
 64495616/221551911 [=======>......................] - ETA: 43s
 64692224/221551911 [=======>......................] - ETA: 43s
 64888832/221551911 [=======>......................] - ETA: 43s
 65085440/221551911 [=======>......................] - ETA: 43s
 65282048/221551911 [=======>......................] - ETA: 43s
 65478656/221551911 [=======>......................] - ETA: 43s
 65675264/221551911 [=======>......................] - ETA: 43s
 65871872/221551911 [=======>......................] - ETA: 43s
 66068480/221551911 [=======>......................] - ETA: 43s
 66265088/221551911 [=======>......................] - ETA: 43s
 66461696/221551911 [=======>......................] - ETA: 43s
 66658304/221551911 [========>.....................] - ETA: 43s
 66854912/221551911 [========>.....................] - ETA: 43s
 67051520/221551911 [========>.....................] - ETA: 43s
 67248128/221551911 [========>.....................] - ETA: 43s
 67444736/221551911 [========>.....................] - ETA: 43s
 67641344/221551911 [========>.....................] - ETA: 42s
 67837952/221551911 [========>.....................] - ETA: 42s
 68034560/221551911 [========>.....................] - ETA: 42s
 68231168/221551911 [========>.....................] - ETA: 42s
 68427776/221551911 [========>.....................] - ETA: 42s
 68624384/221551911 [========>.....................] - ETA: 42s
 68820992/221551911 [========>.....................] - ETA: 42s
 69017600/221551911 [========>.....................] - ETA: 42s
 69214208/221551911 [========>.....................] - ETA: 42s
 69410816/221551911 [========>.....................] - ETA: 42s
 69607424/221551911 [========>.....................] - ETA: 42s
 69804032/221551911 [========>.....................] - ETA: 42s
 70000640/221551911 [========>.....................] - ETA: 42s
 70197248/221551911 [========>.....................] - ETA: 42s
 70393856/221551911 [========>.....................] - ETA: 42s
 70590464/221551911 [========>.....................] - ETA: 42s
 70787072/221551911 [========>.....................] - ETA: 41s
 70983680/221551911 [========>.....................] - ETA: 41s
 71180288/221551911 [========>.....................] - ETA: 41s
 71376896/221551911 [========>.....................] - ETA: 41s
 71573504/221551911 [========>.....................] - ETA: 41s
 71770112/221551911 [========>.....................] - ETA: 41s
 71966720/221551911 [========>.....................] - ETA: 41s
 72163328/221551911 [========>.....................] - ETA: 41s
 72359936/221551911 [========>.....................] - ETA: 41s
 72556544/221551911 [========>.....................] - ETA: 41s
 72753152/221551911 [========>.....................] - ETA: 41s
 72949760/221551911 [========>.....................] - ETA: 41s
 73146368/221551911 [========>.....................] - ETA: 41s
 73342976/221551911 [========>.....................] - ETA: 41s
 73539584/221551911 [========>.....................] - ETA: 41s
 73736192/221551911 [========>.....................] - ETA: 41s
 73932800/221551911 [=========>....................] - ETA: 41s
 74129408/221551911 [=========>....................] - ETA: 40s
 74326016/221551911 [=========>....................] - ETA: 40s
 74522624/221551911 [=========>....................] - ETA: 40s
 74719232/221551911 [=========>....................] - ETA: 40s
 74915840/221551911 [=========>....................] - ETA: 40s
 75112448/221551911 [=========>....................] - ETA: 40s
 75309056/221551911 [=========>....................] - ETA: 40s
 75505664/221551911 [=========>....................] - ETA: 40s
 75702272/221551911 [=========>....................] - ETA: 40s
 75898880/221551911 [=========>....................] - ETA: 40s
 76095488/221551911 [=========>....................] - ETA: 40s
 76292096/221551911 [=========>....................] - ETA: 40s
 76488704/221551911 [=========>....................] - ETA: 40s
 76685312/221551911 [=========>....................] - ETA: 40s
 76881920/221551911 [=========>....................] - ETA: 40s
 77078528/221551911 [=========>....................] - ETA: 40s
 77275136/221551911 [=========>....................] - ETA: 40s
 77471744/221551911 [=========>....................] - ETA: 39s
 77668352/221551911 [=========>....................] - ETA: 39s
 77864960/221551911 [=========>....................] - ETA: 39s
 78061568/221551911 [=========>....................] - ETA: 39s
 78258176/221551911 [=========>....................] - ETA: 39s
 78454784/221551911 [=========>....................] - ETA: 39s
 78651392/221551911 [=========>....................] - ETA: 39s
 78848000/221551911 [=========>....................] - ETA: 39s
 79044608/221551911 [=========>....................] - ETA: 39s
 79241216/221551911 [=========>....................] - ETA: 39s
 79437824/221551911 [=========>....................] - ETA: 39s
 79634432/221551911 [=========>....................] - ETA: 39s
 79831040/221551911 [=========>....................] - ETA: 39s
 80027648/221551911 [=========>....................] - ETA: 39s
 80224256/221551911 [=========>....................] - ETA: 39s
 80420864/221551911 [=========>....................] - ETA: 39s
 80617472/221551911 [=========>....................] - ETA: 39s
 80814080/221551911 [=========>....................] - ETA: 38s
 81010688/221551911 [=========>....................] - ETA: 38s
 81207296/221551911 [=========>....................] - ETA: 38s
 81403904/221551911 [==========>...................] - ETA: 38s
 81600512/221551911 [==========>...................] - ETA: 38s
 81797120/221551911 [==========>...................] - ETA: 38s
 81993728/221551911 [==========>...................] - ETA: 38s
 82190336/221551911 [==========>...................] - ETA: 38s
 82386944/221551911 [==========>...................] - ETA: 38s
 82583552/221551911 [==========>...................] - ETA: 38s
 82780160/221551911 [==========>...................] - ETA: 38s
 82976768/221551911 [==========>...................] - ETA: 38s
 83173376/221551911 [==========>...................] - ETA: 38s
 83369984/221551911 [==========>...................] - ETA: 38s
 83566592/221551911 [==========>...................] - ETA: 38s
 83763200/221551911 [==========>...................] - ETA: 38s
 83959808/221551911 [==========>...................] - ETA: 38s
 84156416/221551911 [==========>...................] - ETA: 37s
 84353024/221551911 [==========>...................] - ETA: 37s
 84549632/221551911 [==========>...................] - ETA: 37s
 84746240/221551911 [==========>...................] - ETA: 37s
 84942848/221551911 [==========>...................] - ETA: 37s
 85139456/221551911 [==========>...................] - ETA: 37s
 85336064/221551911 [==========>...................] - ETA: 37s
 85532672/221551911 [==========>...................] - ETA: 37s
 85729280/221551911 [==========>...................] - ETA: 37s
 85925888/221551911 [==========>...................] - ETA: 37s
 86122496/221551911 [==========>...................] - ETA: 37s
 86319104/221551911 [==========>...................] - ETA: 37s
 86515712/221551911 [==========>...................] - ETA: 37s
 86712320/221551911 [==========>...................] - ETA: 37s
 86908928/221551911 [==========>...................] - ETA: 37s
 87105536/221551911 [==========>...................] - ETA: 37s
 87302144/221551911 [==========>...................] - ETA: 37s
 87498752/221551911 [==========>...................] - ETA: 37s
 87695360/221551911 [==========>...................] - ETA: 36s
 87891968/221551911 [==========>...................] - ETA: 36s
 88088576/221551911 [==========>...................] - ETA: 36s
 88285184/221551911 [==========>...................] - ETA: 36s
 88481792/221551911 [==========>...................] - ETA: 36s
 88678400/221551911 [===========>..................] - ETA: 36s
 88875008/221551911 [===========>..................] - ETA: 36s
 89071616/221551911 [===========>..................] - ETA: 36s
 89268224/221551911 [===========>..................] - ETA: 36s
 89464832/221551911 [===========>..................] - ETA: 36s
 89661440/221551911 [===========>..................] - ETA: 36s
 89858048/221551911 [===========>..................] - ETA: 36s
 90054656/221551911 [===========>..................] - ETA: 36s
 90251264/221551911 [===========>..................] - ETA: 36s
 90447872/221551911 [===========>..................] - ETA: 36s
 90513408/221551911 [===========>..................] - ETA: 36s
 90710016/221551911 [===========>..................] - ETA: 36s
 90906624/221551911 [===========>..................] - ETA: 36s
 91103232/221551911 [===========>..................] - ETA: 36s
 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: 35s
 93462528/221551911 [===========>..................] - ETA: 35s
 93659136/221551911 [===========>..................] - ETA: 35s
 93855744/221551911 [===========>..................] - ETA: 35s
 94052352/221551911 [===========>..................] - ETA: 35s
 94248960/221551911 [===========>..................] - ETA: 35s
 94445568/221551911 [===========>..................] - ETA: 35s
 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: 34s
 97001472/221551911 [============>.................] - ETA: 34s
 97198080/221551911 [============>.................] - ETA: 34s
 97394688/221551911 [============>.................] - ETA: 34s
 97591296/221551911 [============>.................] - ETA: 34s
 97787904/221551911 [============>.................] - ETA: 34s
 97984512/221551911 [============>.................] - ETA: 34s
 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: 33s
100737024/221551911 [============>.................] - ETA: 33s
100933632/221551911 [============>.................] - ETA: 33s
101130240/221551911 [============>.................] - ETA: 33s
101326848/221551911 [============>.................] - ETA: 33s
101523456/221551911 [============>.................] - ETA: 33s
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: 32s
104472576/221551911 [=============>................] - ETA: 32s
104669184/221551911 [=============>................] - ETA: 32s
104865792/221551911 [=============>................] - ETA: 32s
105062400/221551911 [=============>................] - ETA: 32s
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: 31s
108011520/221551911 [=============>................] - ETA: 31s
108208128/221551911 [=============>................] - ETA: 31s
108404736/221551911 [=============>................] - ETA: 31s
108601344/221551911 [=============>................] - ETA: 31s
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: 30s
111747072/221551911 [==============>...............] - ETA: 30s
111943680/221551911 [==============>...............] - ETA: 30s
112140288/221551911 [==============>...............] - ETA: 30s
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: 29s
115286016/221551911 [==============>...............] - ETA: 29s
115482624/221551911 [==============>...............] - ETA: 29s
115679232/221551911 [==============>...............] - ETA: 29s
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: 28s
119021568/221551911 [===============>..............] - ETA: 28s
119218176/221551911 [===============>..............] - ETA: 28s
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: 27s
122757120/221551911 [===============>..............] - ETA: 27s
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: 26s
126296064/221551911 [================>.............] - ETA: 26s
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: 25s
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: 24s
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: 23s
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: 17s
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: 15s
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: 14s
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: 12s
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: 11s
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: 9s 
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: 8s
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: 6s
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: 5s
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: 4s
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: 1s
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.6379, 1.13856], [1.26484, 2.81525], [2.29128, 2.95803], [3.64484, 5.03773], [5.22435, 5.7386]]

3. Model architecture

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

from akida_models import yolo_base

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

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

Out:

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

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

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

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

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

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

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

Out:

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

4. Training

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

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

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

  • freeze the MobileNet layers and perform training,

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

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

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

5. Performance

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

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

Note

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

Reported performanced for all training steps are as follows:

Float

8-bit/8-bit

4-bit/4-bit

Global mAP

42.07 %

41.45 %

30.23 %

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

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

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

# Create the mAP evaluator object
num_images = 100

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

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

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

Out:

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

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

    8192/14126472 [..............................] - ETA: 27s
   65536/14126472 [..............................] - ETA: 14s
  139264/14126472 [..............................] - ETA: 11s
  335872/14126472 [..............................] - ETA: 6s 
  532480/14126472 [>.............................] - ETA: 5s
  729088/14126472 [>.............................] - ETA: 5s
  925696/14126472 [>.............................] - ETA: 4s
 1122304/14126472 [=>............................] - ETA: 4s
 1318912/14126472 [=>............................] - ETA: 4s
 1515520/14126472 [==>...........................] - ETA: 4s
 1712128/14126472 [==>...........................] - ETA: 3s
 1908736/14126472 [===>..........................] - ETA: 3s
 2105344/14126472 [===>..........................] - ETA: 3s
 2301952/14126472 [===>..........................] - ETA: 3s
 2498560/14126472 [====>.........................] - ETA: 3s
 2695168/14126472 [====>.........................] - ETA: 3s
 2891776/14126472 [=====>........................] - ETA: 3s
 3088384/14126472 [=====>........................] - ETA: 3s
 3284992/14126472 [=====>........................] - ETA: 3s
 3481600/14126472 [======>.......................] - ETA: 3s
 3678208/14126472 [======>.......................] - ETA: 3s
 3874816/14126472 [=======>......................] - ETA: 2s
 4071424/14126472 [=======>......................] - ETA: 2s
 4268032/14126472 [========>.....................] - ETA: 2s
 4464640/14126472 [========>.....................] - ETA: 2s
 4661248/14126472 [========>.....................] - ETA: 2s
 4857856/14126472 [=========>....................] - ETA: 2s
 5054464/14126472 [=========>....................] - ETA: 2s
 5251072/14126472 [==========>...................] - ETA: 2s
 5447680/14126472 [==========>...................] - ETA: 2s
 5644288/14126472 [==========>...................] - ETA: 2s
 5840896/14126472 [===========>..................] - ETA: 2s
 6037504/14126472 [===========>..................] - ETA: 2s
 6234112/14126472 [============>.................] - ETA: 2s
 6430720/14126472 [============>.................] - ETA: 2s
 6627328/14126472 [=============>................] - ETA: 2s
 6823936/14126472 [=============>................] - ETA: 2s
 7020544/14126472 [=============>................] - ETA: 1s
 7217152/14126472 [==============>...............] - ETA: 1s
 7413760/14126472 [==============>...............] - ETA: 1s
 7610368/14126472 [===============>..............] - ETA: 1s
 7806976/14126472 [===============>..............] - ETA: 1s
 8003584/14126472 [===============>..............] - ETA: 1s
 8200192/14126472 [================>.............] - ETA: 1s
 8396800/14126472 [================>.............] - ETA: 1s
 8593408/14126472 [=================>............] - ETA: 1s
 8790016/14126472 [=================>............] - ETA: 1s
 8986624/14126472 [==================>...........] - ETA: 1s
 9183232/14126472 [==================>...........] - ETA: 1s
 9379840/14126472 [==================>...........] - ETA: 1s
 9576448/14126472 [===================>..........] - ETA: 1s
 9773056/14126472 [===================>..........] - ETA: 1s
 9969664/14126472 [====================>.........] - ETA: 1s
10166272/14126472 [====================>.........] - ETA: 1s
10362880/14126472 [=====================>........] - ETA: 1s
10559488/14126472 [=====================>........] - ETA: 0s
10756096/14126472 [=====================>........] - ETA: 0s
10952704/14126472 [======================>.......] - ETA: 0s
11149312/14126472 [======================>.......] - ETA: 0s
11345920/14126472 [=======================>......] - ETA: 0s
11542528/14126472 [=======================>......] - ETA: 0s
11739136/14126472 [=======================>......] - ETA: 0s
11935744/14126472 [========================>.....] - ETA: 0s
12132352/14126472 [========================>.....] - ETA: 0s
12328960/14126472 [=========================>....] - ETA: 0s
12525568/14126472 [=========================>....] - ETA: 0s
12722176/14126472 [==========================>...] - ETA: 0s
12918784/14126472 [==========================>...] - ETA: 0s
13115392/14126472 [==========================>...] - ETA: 0s
13312000/14126472 [===========================>..] - ETA: 0s
13508608/14126472 [===========================>..] - ETA: 0s
13705216/14126472 [============================>.] - ETA: 0s
13901824/14126472 [============================>.] - ETA: 0s
14098432/14126472 [============================>.] - ETA: 0s
14131200/14126472 [==============================] - 4s 0us/step
car 0.2669
person 0.2876
mAP: 0.2773
Keras inference on 100 images took 4.11 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
________________________________________________
Input shape    Output shape  Sequences  Layers
================================================
[224, 224, 3]  [7, 7, 35]    1          18
________________________________________________

/usr/local/lib/python3.6/dist-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  return array(a, dtype, copy=False, order=order)
              SW/conv_0-detection_layer (Software)
_________________________________________________________________
Layer (type)                 Output shape    Kernel shape
=================================================================
conv_0 (InputConv.)          [112, 112, 16]  (3, 3, 3, 16)
_________________________________________________________________
separable_1 (Sep.Conv.)      [112, 112, 32]  (3, 3, 16, 1)
_________________________________________________________________
                                             (1, 1, 16, 32)
_________________________________________________________________
separable_2 (Sep.Conv.)      [56, 56, 64]    (3, 3, 32, 1)
_________________________________________________________________
                                             (1, 1, 32, 64)
_________________________________________________________________
separable_3 (Sep.Conv.)      [56, 56, 64]    (3, 3, 64, 1)
_________________________________________________________________
                                             (1, 1, 64, 64)
_________________________________________________________________
separable_4 (Sep.Conv.)      [28, 28, 128]   (3, 3, 64, 1)
_________________________________________________________________
                                             (1, 1, 64, 128)
_________________________________________________________________
separable_5 (Sep.Conv.)      [28, 28, 128]   (3, 3, 128, 1)
_________________________________________________________________
                                             (1, 1, 128, 128)
_________________________________________________________________
separable_6 (Sep.Conv.)      [14, 14, 256]   (3, 3, 128, 1)
_________________________________________________________________
                                             (1, 1, 128, 256)
_________________________________________________________________
separable_7 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_8 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_9 (Sep.Conv.)      [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_10 (Sep.Conv.)     [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_11 (Sep.Conv.)     [14, 14, 256]   (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 256)
_________________________________________________________________
separable_12 (Sep.Conv.)     [7, 7, 512]     (3, 3, 256, 1)
_________________________________________________________________
                                             (1, 1, 256, 512)
_________________________________________________________________
separable_13 (Sep.Conv.)     [7, 7, 512]     (3, 3, 512, 1)
_________________________________________________________________
                                             (1, 1, 512, 512)
_________________________________________________________________
1conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 512, 1)
_________________________________________________________________
                                             (1, 1, 512, 1024)
_________________________________________________________________
2conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 1024)
_________________________________________________________________
3conv (Sep.Conv.)            [7, 7, 1024]    (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 1024)
_________________________________________________________________
detection_layer (Sep.Conv.)  [7, 7, 35]      (3, 3, 1024, 1)
_________________________________________________________________
                                             (1, 1, 1024, 35)
_________________________________________________________________

6.1 Check performance

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

The table below summarizes the expected results:

#Images

Keras mAP

Akida mAP

100

27.82 %

27.18 %

1000

30.65 %

30.83 %

2500

30.23 %

29.39 %

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

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

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

Out:

car 0.2552
person 0.2852
mAP: 0.2702
Akida inference on 100 images took 22.69 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 6 voc yolo detection

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

Gallery generated by Sphinx-Gallery