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 AkidaNet/ImageNet inference example

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

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

1.2 YOLO key concepts

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

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

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

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

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

2. Preprocessing tools

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

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

import os

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

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

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

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

Out:

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

    16384/221551911 [..............................] - ETA: 10s
   139264/221551911 [..............................] - ETA: 1:43
   335872/221551911 [..............................] - ETA: 1:22
   532480/221551911 [..............................] - ETA: 1:16
   729088/221551911 [..............................] - ETA: 1:14
   860160/221551911 [..............................] - ETA: 1:17
  1056768/221551911 [..............................] - ETA: 1:15
  1253376/221551911 [..............................] - ETA: 1:14
  1449984/221551911 [..............................] - ETA: 1:13
  1646592/221551911 [..............................] - ETA: 1:12
  1843200/221551911 [..............................] - ETA: 1:11
  2039808/221551911 [..............................] - ETA: 1:11
  2236416/221551911 [..............................] - ETA: 1:11
  2433024/221551911 [..............................] - ETA: 1:10
  2629632/221551911 [..............................] - ETA: 1:10
  2826240/221551911 [..............................] - ETA: 1:10
  3022848/221551911 [..............................] - ETA: 1:09
  3219456/221551911 [..............................] - ETA: 1:09
  3416064/221551911 [..............................] - ETA: 1:09
  3612672/221551911 [..............................] - ETA: 1:09
  3809280/221551911 [..............................] - ETA: 1:09
  4005888/221551911 [..............................] - ETA: 1:08
  4202496/221551911 [..............................] - ETA: 1:08
  4399104/221551911 [..............................] - ETA: 1:08
  4595712/221551911 [..............................] - ETA: 1:08
  4792320/221551911 [..............................] - ETA: 1:08
  4988928/221551911 [..............................] - ETA: 1:08
  5185536/221551911 [..............................] - ETA: 1:07
  5382144/221551911 [..............................] - ETA: 1:07
  5578752/221551911 [..............................] - ETA: 1:07
  5775360/221551911 [..............................] - ETA: 1:07
  5971968/221551911 [..............................] - ETA: 1:07
  6168576/221551911 [..............................] - ETA: 1:07
  6365184/221551911 [..............................] - ETA: 1:07
  6561792/221551911 [..............................] - ETA: 1:07
  6692864/221551911 [..............................] - ETA: 1:07
  6889472/221551911 [..............................] - ETA: 1:07
  7086080/221551911 [..............................] - ETA: 1:07
  7282688/221551911 [..............................] - ETA: 1:07
  7479296/221551911 [>.............................] - ETA: 1:07
  7675904/221551911 [>.............................] - ETA: 1:07
  7872512/221551911 [>.............................] - ETA: 1:07
  8069120/221551911 [>.............................] - ETA: 1:07
  8265728/221551911 [>.............................] - ETA: 1:07
  8462336/221551911 [>.............................] - ETA: 1:06
  8658944/221551911 [>.............................] - ETA: 1:06
  8855552/221551911 [>.............................] - ETA: 1:06
  9052160/221551911 [>.............................] - ETA: 1:06
  9248768/221551911 [>.............................] - ETA: 1:06
  9445376/221551911 [>.............................] - ETA: 1:06
  9641984/221551911 [>.............................] - ETA: 1:06
  9838592/221551911 [>.............................] - ETA: 1:06
 10035200/221551911 [>.............................] - ETA: 1:06
 10231808/221551911 [>.............................] - ETA: 1:06
 10428416/221551911 [>.............................] - ETA: 1:06
 10625024/221551911 [>.............................] - ETA: 1:05
 10821632/221551911 [>.............................] - ETA: 1:05
 11018240/221551911 [>.............................] - ETA: 1:05
 11214848/221551911 [>.............................] - ETA: 1:05
 11411456/221551911 [>.............................] - ETA: 1:05
 11542528/221551911 [>.............................] - ETA: 1:05
 11739136/221551911 [>.............................] - ETA: 1:05
 11935744/221551911 [>.............................] - ETA: 1:05
 12132352/221551911 [>.............................] - ETA: 1:05
 12328960/221551911 [>.............................] - ETA: 1:05
 12525568/221551911 [>.............................] - ETA: 1:05
 12722176/221551911 [>.............................] - ETA: 1:05
 12779520/221551911 [>.............................] - ETA: 1:10
 12828672/221551911 [>.............................] - ETA: 1:11
 12984320/221551911 [>.............................] - ETA: 1:11
 13180928/221551911 [>.............................] - ETA: 1:11
 13377536/221551911 [>.............................] - ETA: 1:10
 13574144/221551911 [>.............................] - ETA: 1:10
 13770752/221551911 [>.............................] - ETA: 1:10
 13967360/221551911 [>.............................] - ETA: 1:10
 14163968/221551911 [>.............................] - ETA: 1:10
 14360576/221551911 [>.............................] - ETA: 1:10
 14557184/221551911 [>.............................] - ETA: 1:09
 14753792/221551911 [>.............................] - ETA: 1:09
 14950400/221551911 [=>............................] - ETA: 1:09
 15147008/221551911 [=>............................] - ETA: 1:09
 15343616/221551911 [=>............................] - ETA: 1:09
 15540224/221551911 [=>............................] - ETA: 1:09
 15736832/221551911 [=>............................] - ETA: 1:09
 15933440/221551911 [=>............................] - ETA: 1:09
 16130048/221551911 [=>............................] - ETA: 1:08
 16326656/221551911 [=>............................] - ETA: 1:08
 16523264/221551911 [=>............................] - ETA: 1:08
 16719872/221551911 [=>............................] - ETA: 1:08
 16916480/221551911 [=>............................] - ETA: 1:08
 17113088/221551911 [=>............................] - ETA: 1:08
 17309696/221551911 [=>............................] - ETA: 1:08
 17506304/221551911 [=>............................] - ETA: 1:07
 17702912/221551911 [=>............................] - ETA: 1:07
 17899520/221551911 [=>............................] - ETA: 1:07
 18096128/221551911 [=>............................] - ETA: 1:07
 18292736/221551911 [=>............................] - ETA: 1:07
 18489344/221551911 [=>............................] - ETA: 1:07
 18685952/221551911 [=>............................] - ETA: 1:07
 18882560/221551911 [=>............................] - ETA: 1:07
 19079168/221551911 [=>............................] - ETA: 1:07
 19275776/221551911 [=>............................] - ETA: 1:06
 19472384/221551911 [=>............................] - ETA: 1:06
 19668992/221551911 [=>............................] - ETA: 1:06
 19865600/221551911 [=>............................] - ETA: 1:06
 20062208/221551911 [=>............................] - ETA: 1:06
 20258816/221551911 [=>............................] - ETA: 1:06
 20455424/221551911 [=>............................] - ETA: 1:06
 20652032/221551911 [=>............................] - ETA: 1:06
 20848640/221551911 [=>............................] - ETA: 1:05
 21037056/221551911 [=>............................] - ETA: 1:06
 21176320/221551911 [=>............................] - ETA: 1:06
 21372928/221551911 [=>............................] - ETA: 1:06
 21569536/221551911 [=>............................] - ETA: 1:06
 21766144/221551911 [=>............................] - ETA: 1:05
 21962752/221551911 [=>............................] - ETA: 1:05
 22159360/221551911 [==>...........................] - ETA: 1:05
 22355968/221551911 [==>...........................] - ETA: 1:05
 22552576/221551911 [==>...........................] - ETA: 1:05
 22749184/221551911 [==>...........................] - ETA: 1:05
 22945792/221551911 [==>...........................] - ETA: 1:05
 23142400/221551911 [==>...........................] - ETA: 1:05
 23339008/221551911 [==>...........................] - ETA: 1:05
 23535616/221551911 [==>...........................] - ETA: 1:05
 23732224/221551911 [==>...........................] - ETA: 1:04
 23928832/221551911 [==>...........................] - ETA: 1:04
 24125440/221551911 [==>...........................] - ETA: 1:04
 24322048/221551911 [==>...........................] - ETA: 1:04
 24518656/221551911 [==>...........................] - ETA: 1:04
 24715264/221551911 [==>...........................] - ETA: 1:04
 24911872/221551911 [==>...........................] - ETA: 1:04
 25108480/221551911 [==>...........................] - ETA: 1:04
 25305088/221551911 [==>...........................] - ETA: 1:04
 25501696/221551911 [==>...........................] - ETA: 1:04
 25698304/221551911 [==>...........................] - ETA: 1:04
 25894912/221551911 [==>...........................] - ETA: 1:03
 26091520/221551911 [==>...........................] - ETA: 1:03
 26288128/221551911 [==>...........................] - ETA: 1:03
 26476544/221551911 [==>...........................] - ETA: 1:03
 26615808/221551911 [==>...........................] - ETA: 1:03
 26812416/221551911 [==>...........................] - ETA: 1:03
 27009024/221551911 [==>...........................] - ETA: 1:03
 27205632/221551911 [==>...........................] - ETA: 1:03
 27262976/221551911 [==>...........................] - ETA: 1:05
 27303936/221551911 [==>...........................] - ETA: 1:06
 27467776/221551911 [==>...........................] - ETA: 1:06
 27598848/221551911 [==>...........................] - ETA: 1:06
 27795456/221551911 [==>...........................] - ETA: 1:05
 27992064/221551911 [==>...........................] - ETA: 1:05
 28188672/221551911 [==>...........................] - ETA: 1:05
 28385280/221551911 [==>...........................] - ETA: 1:05
 28581888/221551911 [==>...........................] - ETA: 1:05
 28778496/221551911 [==>...........................] - ETA: 1:05
 28975104/221551911 [==>...........................] - ETA: 1:05
 29171712/221551911 [==>...........................] - ETA: 1:05
 29368320/221551911 [==>...........................] - ETA: 1:05
 29564928/221551911 [===>..........................] - ETA: 1:04
 29761536/221551911 [===>..........................] - ETA: 1:04
 29958144/221551911 [===>..........................] - ETA: 1:04
 30154752/221551911 [===>..........................] - ETA: 1:04
 30351360/221551911 [===>..........................] - ETA: 1:04
 30547968/221551911 [===>..........................] - ETA: 1:04
 30744576/221551911 [===>..........................] - ETA: 1:04
 30941184/221551911 [===>..........................] - ETA: 1:04
 31137792/221551911 [===>..........................] - ETA: 1:04
 31334400/221551911 [===>..........................] - ETA: 1:03
 31531008/221551911 [===>..........................] - ETA: 1:03
 31727616/221551911 [===>..........................] - ETA: 1:03
 31924224/221551911 [===>..........................] - ETA: 1:03
 32120832/221551911 [===>..........................] - ETA: 1:03
 32235520/221551911 [===>..........................] - ETA: 1:03
 32382976/221551911 [===>..........................] - ETA: 1:03
 32579584/221551911 [===>..........................] - ETA: 1:03
 32776192/221551911 [===>..........................] - ETA: 1:03
 32972800/221551911 [===>..........................] - ETA: 1:03
 33169408/221551911 [===>..........................] - ETA: 1:03
 33366016/221551911 [===>..........................] - ETA: 1:03
 33562624/221551911 [===>..........................] - ETA: 1:03
 33759232/221551911 [===>..........................] - ETA: 1:03
 33955840/221551911 [===>..........................] - ETA: 1:02
 34152448/221551911 [===>..........................] - ETA: 1:02
 34349056/221551911 [===>..........................] - ETA: 1:02
 34545664/221551911 [===>..........................] - ETA: 1:02
 34603008/221551911 [===>..........................] - ETA: 1:04
 34627584/221551911 [===>..........................] - ETA: 1:04
 34742272/221551911 [===>..........................] - ETA: 1:04
 34938880/221551911 [===>..........................] - ETA: 1:04
 35135488/221551911 [===>..........................] - ETA: 1:04
 35332096/221551911 [===>..........................] - ETA: 1:04
 35528704/221551911 [===>..........................] - ETA: 1:04
 35725312/221551911 [===>..........................] - ETA: 1:04
 35921920/221551911 [===>..........................] - ETA: 1:04
 36118528/221551911 [===>..........................] - ETA: 1:03
 36315136/221551911 [===>..........................] - ETA: 1:03
 36503552/221551911 [===>..........................] - ETA: 1:05
 36544512/221551911 [===>..........................] - ETA: 1:05
 36708352/221551911 [===>..........................] - ETA: 1:05
 36904960/221551911 [===>..........................] - ETA: 1:05
 37101568/221551911 [====>.........................] - ETA: 1:05
 37298176/221551911 [====>.........................] - ETA: 1:05
 37494784/221551911 [====>.........................] - ETA: 1:04
 37552128/221551911 [====>.........................] - ETA: 1:06
 37568512/221551911 [====>.........................] - ETA: 1:06
 37675008/221551911 [====>.........................] - ETA: 1:06
 37797888/221551911 [====>.........................] - ETA: 1:06
 37888000/221551911 [====>.........................] - ETA: 1:07
 38019072/221551911 [====>.........................] - ETA: 1:07
 38174720/221551911 [====>.........................] - ETA: 1:06
 38346752/221551911 [====>.........................] - ETA: 1:06
 38543360/221551911 [====>.........................] - ETA: 1:06
 38739968/221551911 [====>.........................] - ETA: 1:06
 38936576/221551911 [====>.........................] - ETA: 1:06
 39133184/221551911 [====>.........................] - ETA: 1:06
 39329792/221551911 [====>.........................] - ETA: 1:06
 39526400/221551911 [====>.........................] - ETA: 1:06
 39723008/221551911 [====>.........................] - ETA: 1:05
 39919616/221551911 [====>.........................] - ETA: 1:05
 40042496/221551911 [====>.........................] - ETA: 1:05
 40181760/221551911 [====>.........................] - ETA: 1:05
 40378368/221551911 [====>.........................] - ETA: 1:05
 40574976/221551911 [====>.........................] - ETA: 1:05
 40771584/221551911 [====>.........................] - ETA: 1:05
 40837120/221551911 [====>.........................] - ETA: 1:05
 41033728/221551911 [====>.........................] - ETA: 1:05
 41230336/221551911 [====>.........................] - ETA: 1:05
 41426944/221551911 [====>.........................] - ETA: 1:05
 41623552/221551911 [====>.........................] - ETA: 1:05
 41820160/221551911 [====>.........................] - ETA: 1:05
 42016768/221551911 [====>.........................] - ETA: 1:04
 42213376/221551911 [====>.........................] - ETA: 1:04
 42409984/221551911 [====>.........................] - ETA: 1:04
 42606592/221551911 [====>.........................] - ETA: 1:04
 42803200/221551911 [====>.........................] - ETA: 1:04
 42999808/221551911 [====>.........................] - ETA: 1:04
 43196416/221551911 [====>.........................] - ETA: 1:04
 43393024/221551911 [====>.........................] - ETA: 1:04
 43589632/221551911 [====>.........................] - ETA: 1:04
 43786240/221551911 [====>.........................] - ETA: 1:03
 43982848/221551911 [====>.........................] - ETA: 1:03
 44179456/221551911 [====>.........................] - ETA: 1:03
 44376064/221551911 [=====>........................] - ETA: 1:03
 44572672/221551911 [=====>........................] - ETA: 1:03
 44769280/221551911 [=====>........................] - ETA: 1:03
 44965888/221551911 [=====>........................] - ETA: 1:03
 45162496/221551911 [=====>........................] - ETA: 1:03
 45359104/221551911 [=====>........................] - ETA: 1:03
 45555712/221551911 [=====>........................] - ETA: 1:02
 45752320/221551911 [=====>........................] - ETA: 1:02
 45948928/221551911 [=====>........................] - ETA: 1:02
 46145536/221551911 [=====>........................] - ETA: 1:02
 46342144/221551911 [=====>........................] - ETA: 1:02
 46538752/221551911 [=====>........................] - ETA: 1:02
 46735360/221551911 [=====>........................] - ETA: 1:02
 46931968/221551911 [=====>........................] - ETA: 1:02
 47128576/221551911 [=====>........................] - ETA: 1:02
 47325184/221551911 [=====>........................] - ETA: 1:01
 47521792/221551911 [=====>........................] - ETA: 1:01
 47718400/221551911 [=====>........................] - ETA: 1:01
 47915008/221551911 [=====>........................] - ETA: 1:01
 48111616/221551911 [=====>........................] - ETA: 1:01
 48308224/221551911 [=====>........................] - ETA: 1:01
 48504832/221551911 [=====>........................] - ETA: 1:01
 48701440/221551911 [=====>........................] - ETA: 1:01
 48898048/221551911 [=====>........................] - ETA: 1:01
 49094656/221551911 [=====>........................] - ETA: 1:00
 49291264/221551911 [=====>........................] - ETA: 1:00
 49487872/221551911 [=====>........................] - ETA: 1:00
 49684480/221551911 [=====>........................] - ETA: 1:00
 49881088/221551911 [=====>........................] - ETA: 1:00
 50077696/221551911 [=====>........................] - ETA: 1:00
 50274304/221551911 [=====>........................] - ETA: 1:00
 50470912/221551911 [=====>........................] - ETA: 1:00
 50667520/221551911 [=====>........................] - ETA: 1:00
 50864128/221551911 [=====>........................] - ETA: 1:00
 51060736/221551911 [=====>........................] - ETA: 59s 
 51257344/221551911 [=====>........................] - ETA: 59s
 51453952/221551911 [=====>........................] - ETA: 59s
 51650560/221551911 [=====>........................] - ETA: 59s
 51847168/221551911 [======>.......................] - ETA: 59s
 52043776/221551911 [======>.......................] - ETA: 59s
 52240384/221551911 [======>.......................] - ETA: 59s
 52436992/221551911 [======>.......................] - ETA: 59s
 52633600/221551911 [======>.......................] - ETA: 59s
 52830208/221551911 [======>.......................] - ETA: 59s
 53026816/221551911 [======>.......................] - ETA: 58s
 53223424/221551911 [======>.......................] - ETA: 58s
 53420032/221551911 [======>.......................] - ETA: 58s
 53616640/221551911 [======>.......................] - ETA: 58s
 53813248/221551911 [======>.......................] - ETA: 58s
 54009856/221551911 [======>.......................] - ETA: 58s
 54206464/221551911 [======>.......................] - ETA: 58s
 54403072/221551911 [======>.......................] - ETA: 58s
 54599680/221551911 [======>.......................] - ETA: 58s
 54796288/221551911 [======>.......................] - ETA: 58s
 54992896/221551911 [======>.......................] - ETA: 58s
 55189504/221551911 [======>.......................] - ETA: 57s
 55386112/221551911 [======>.......................] - ETA: 57s
 55582720/221551911 [======>.......................] - ETA: 57s
 55779328/221551911 [======>.......................] - ETA: 57s
 55975936/221551911 [======>.......................] - ETA: 57s
 56172544/221551911 [======>.......................] - ETA: 57s
 56295424/221551911 [======>.......................] - ETA: 57s
 56434688/221551911 [======>.......................] - ETA: 57s
 56631296/221551911 [======>.......................] - ETA: 57s
 56827904/221551911 [======>.......................] - ETA: 57s
 57024512/221551911 [======>.......................] - ETA: 57s
 57221120/221551911 [======>.......................] - ETA: 57s
 57417728/221551911 [======>.......................] - ETA: 57s
 57614336/221551911 [======>.......................] - ETA: 56s
 57810944/221551911 [======>.......................] - ETA: 56s
 58007552/221551911 [======>.......................] - ETA: 56s
 58204160/221551911 [======>.......................] - ETA: 56s
 58400768/221551911 [======>.......................] - ETA: 56s
 58597376/221551911 [======>.......................] - ETA: 56s
 58793984/221551911 [======>.......................] - ETA: 56s
 58990592/221551911 [======>.......................] - ETA: 56s
 59187200/221551911 [=======>......................] - ETA: 56s
 59383808/221551911 [=======>......................] - ETA: 56s
 59580416/221551911 [=======>......................] - ETA: 56s
 59777024/221551911 [=======>......................] - ETA: 55s
 59973632/221551911 [=======>......................] - ETA: 55s
 60170240/221551911 [=======>......................] - ETA: 55s
 60366848/221551911 [=======>......................] - ETA: 55s
 60563456/221551911 [=======>......................] - ETA: 55s
 60760064/221551911 [=======>......................] - ETA: 55s
 60915712/221551911 [=======>......................] - ETA: 55s
 61087744/221551911 [=======>......................] - ETA: 55s
 61284352/221551911 [=======>......................] - ETA: 55s
 61472768/221551911 [=======>......................] - ETA: 55s
 61612032/221551911 [=======>......................] - ETA: 55s
 61808640/221551911 [=======>......................] - ETA: 55s
 62005248/221551911 [=======>......................] - ETA: 54s
 62201856/221551911 [=======>......................] - ETA: 54s
 62398464/221551911 [=======>......................] - ETA: 54s
 62595072/221551911 [=======>......................] - ETA: 54s
 62791680/221551911 [=======>......................] - ETA: 54s
 62988288/221551911 [=======>......................] - ETA: 54s
 63184896/221551911 [=======>......................] - ETA: 54s
 63381504/221551911 [=======>......................] - ETA: 54s
 63578112/221551911 [=======>......................] - ETA: 54s
 63774720/221551911 [=======>......................] - ETA: 54s
 63971328/221551911 [=======>......................] - ETA: 54s
 64167936/221551911 [=======>......................] - ETA: 54s
 64364544/221551911 [=======>......................] - ETA: 53s
 64561152/221551911 [=======>......................] - ETA: 53s
 64757760/221551911 [=======>......................] - ETA: 53s
 64954368/221551911 [=======>......................] - ETA: 53s
 65150976/221551911 [=======>......................] - ETA: 53s
 65347584/221551911 [=======>......................] - ETA: 53s
 65544192/221551911 [=======>......................] - ETA: 53s
 65740800/221551911 [=======>......................] - ETA: 53s
 65937408/221551911 [=======>......................] - ETA: 53s
 66134016/221551911 [=======>......................] - ETA: 53s
 66330624/221551911 [=======>......................] - ETA: 53s
 66527232/221551911 [========>.....................] - ETA: 53s
 66723840/221551911 [========>.....................] - ETA: 52s
 66920448/221551911 [========>.....................] - ETA: 52s
 67117056/221551911 [========>.....................] - ETA: 52s
 67313664/221551911 [========>.....................] - ETA: 52s
 67510272/221551911 [========>.....................] - ETA: 52s
 67706880/221551911 [========>.....................] - ETA: 52s
 67903488/221551911 [========>.....................] - ETA: 52s
 68100096/221551911 [========>.....................] - ETA: 52s
 68296704/221551911 [========>.....................] - ETA: 52s
 68493312/221551911 [========>.....................] - ETA: 52s
 68689920/221551911 [========>.....................] - ETA: 52s
 68886528/221551911 [========>.....................] - ETA: 52s
 69083136/221551911 [========>.....................] - ETA: 51s
 69279744/221551911 [========>.....................] - ETA: 51s
 69476352/221551911 [========>.....................] - ETA: 51s
 69672960/221551911 [========>.....................] - ETA: 51s
 69869568/221551911 [========>.....................] - ETA: 51s
 70066176/221551911 [========>.....................] - ETA: 51s
 70262784/221551911 [========>.....................] - ETA: 51s
 70459392/221551911 [========>.....................] - ETA: 51s
 70656000/221551911 [========>.....................] - ETA: 51s
 70852608/221551911 [========>.....................] - ETA: 51s
 71049216/221551911 [========>.....................] - ETA: 51s
 71245824/221551911 [========>.....................] - ETA: 51s
 71442432/221551911 [========>.....................] - ETA: 50s
 71639040/221551911 [========>.....................] - ETA: 50s
 71835648/221551911 [========>.....................] - ETA: 50s
 72032256/221551911 [========>.....................] - ETA: 50s
 72228864/221551911 [========>.....................] - ETA: 50s
 72425472/221551911 [========>.....................] - ETA: 50s
 72622080/221551911 [========>.....................] - ETA: 50s
 72818688/221551911 [========>.....................] - ETA: 50s
 73015296/221551911 [========>.....................] - ETA: 50s
 73211904/221551911 [========>.....................] - ETA: 50s
 73408512/221551911 [========>.....................] - ETA: 50s
 73605120/221551911 [========>.....................] - ETA: 50s
 73801728/221551911 [========>.....................] - ETA: 49s
 73998336/221551911 [=========>....................] - ETA: 49s
 74194944/221551911 [=========>....................] - ETA: 49s
 74391552/221551911 [=========>....................] - ETA: 49s
 74547200/221551911 [=========>....................] - ETA: 49s
 74719232/221551911 [=========>....................] - ETA: 49s
 74915840/221551911 [=========>....................] - ETA: 49s
 75112448/221551911 [=========>....................] - ETA: 49s
 75309056/221551911 [=========>....................] - ETA: 49s
 75505664/221551911 [=========>....................] - ETA: 49s
 75702272/221551911 [=========>....................] - ETA: 49s
 75898880/221551911 [=========>....................] - ETA: 49s
 76095488/221551911 [=========>....................] - ETA: 49s
 76218368/221551911 [=========>....................] - ETA: 49s
 76357632/221551911 [=========>....................] - ETA: 49s
 76554240/221551911 [=========>....................] - ETA: 48s
 76750848/221551911 [=========>....................] - ETA: 48s
 76947456/221551911 [=========>....................] - ETA: 48s
 77144064/221551911 [=========>....................] - ETA: 48s
 77340672/221551911 [=========>....................] - ETA: 48s
 77537280/221551911 [=========>....................] - ETA: 48s
 77733888/221551911 [=========>....................] - ETA: 48s
 77930496/221551911 [=========>....................] - ETA: 48s
 78127104/221551911 [=========>....................] - ETA: 48s
 78323712/221551911 [=========>....................] - ETA: 48s
 78520320/221551911 [=========>....................] - ETA: 48s
 78716928/221551911 [=========>....................] - ETA: 48s
 78913536/221551911 [=========>....................] - ETA: 48s
 79110144/221551911 [=========>....................] - ETA: 47s
 79306752/221551911 [=========>....................] - ETA: 47s
 79503360/221551911 [=========>....................] - ETA: 47s
 79699968/221551911 [=========>....................] - ETA: 47s
 79896576/221551911 [=========>....................] - ETA: 47s
 80093184/221551911 [=========>....................] - ETA: 47s
 80289792/221551911 [=========>....................] - ETA: 47s
 80486400/221551911 [=========>....................] - ETA: 47s
 80683008/221551911 [=========>....................] - ETA: 47s
 80879616/221551911 [=========>....................] - ETA: 47s
 81076224/221551911 [=========>....................] - ETA: 47s
 81272832/221551911 [==========>...................] - ETA: 47s
 81469440/221551911 [==========>...................] - ETA: 47s
 81666048/221551911 [==========>...................] - ETA: 46s
 81862656/221551911 [==========>...................] - ETA: 46s
 82059264/221551911 [==========>...................] - ETA: 46s
 82255872/221551911 [==========>...................] - ETA: 46s
 82452480/221551911 [==========>...................] - ETA: 46s
 82649088/221551911 [==========>...................] - ETA: 46s
 82845696/221551911 [==========>...................] - ETA: 46s
 83042304/221551911 [==========>...................] - ETA: 46s
 83238912/221551911 [==========>...................] - ETA: 46s
 83435520/221551911 [==========>...................] - ETA: 46s
 83632128/221551911 [==========>...................] - ETA: 46s
 83828736/221551911 [==========>...................] - ETA: 46s
 84025344/221551911 [==========>...................] - ETA: 46s
 84221952/221551911 [==========>...................] - ETA: 46s
 84418560/221551911 [==========>...................] - ETA: 45s
 84615168/221551911 [==========>...................] - ETA: 45s
 84811776/221551911 [==========>...................] - ETA: 45s
 85008384/221551911 [==========>...................] - ETA: 45s
 85204992/221551911 [==========>...................] - ETA: 45s
 85401600/221551911 [==========>...................] - ETA: 45s
 85598208/221551911 [==========>...................] - ETA: 45s
 85794816/221551911 [==========>...................] - ETA: 45s
 85991424/221551911 [==========>...................] - ETA: 45s
 86188032/221551911 [==========>...................] - ETA: 45s
 86384640/221551911 [==========>...................] - ETA: 45s
 86581248/221551911 [==========>...................] - ETA: 45s
 86777856/221551911 [==========>...................] - ETA: 45s
 86974464/221551911 [==========>...................] - ETA: 44s
 87171072/221551911 [==========>...................] - ETA: 44s
 87367680/221551911 [==========>...................] - ETA: 44s
 87564288/221551911 [==========>...................] - ETA: 44s
 87760896/221551911 [==========>...................] - ETA: 44s
 87957504/221551911 [==========>...................] - ETA: 44s
 88154112/221551911 [==========>...................] - ETA: 44s
 88350720/221551911 [==========>...................] - ETA: 44s
 88547328/221551911 [==========>...................] - ETA: 44s
 88743936/221551911 [===========>..................] - ETA: 44s
 88940544/221551911 [===========>..................] - ETA: 44s
 89137152/221551911 [===========>..................] - ETA: 44s
 89333760/221551911 [===========>..................] - ETA: 44s
 89530368/221551911 [===========>..................] - ETA: 43s
 89726976/221551911 [===========>..................] - ETA: 43s
 89923584/221551911 [===========>..................] - ETA: 43s
 90120192/221551911 [===========>..................] - ETA: 43s
 90316800/221551911 [===========>..................] - ETA: 43s
 90513408/221551911 [===========>..................] - ETA: 43s
 90710016/221551911 [===========>..................] - ETA: 43s
 90898432/221551911 [===========>..................] - ETA: 43s
 91037696/221551911 [===========>..................] - ETA: 43s
 91234304/221551911 [===========>..................] - ETA: 43s
 91430912/221551911 [===========>..................] - ETA: 43s
 91627520/221551911 [===========>..................] - ETA: 43s
 91824128/221551911 [===========>..................] - ETA: 43s
 92020736/221551911 [===========>..................] - ETA: 43s
 92217344/221551911 [===========>..................] - ETA: 43s
 92413952/221551911 [===========>..................] - ETA: 42s
 92610560/221551911 [===========>..................] - ETA: 42s
 92807168/221551911 [===========>..................] - ETA: 42s
 93003776/221551911 [===========>..................] - ETA: 42s
 93200384/221551911 [===========>..................] - ETA: 42s
 93396992/221551911 [===========>..................] - ETA: 42s
 93593600/221551911 [===========>..................] - ETA: 42s
 93790208/221551911 [===========>..................] - ETA: 42s
 93986816/221551911 [===========>..................] - ETA: 42s
 94183424/221551911 [===========>..................] - ETA: 42s
 94380032/221551911 [===========>..................] - ETA: 42s
 94576640/221551911 [===========>..................] - ETA: 42s
 94773248/221551911 [===========>..................] - ETA: 42s
 94969856/221551911 [===========>..................] - ETA: 42s
 95166464/221551911 [===========>..................] - ETA: 41s
 95363072/221551911 [===========>..................] - ETA: 41s
 95559680/221551911 [===========>..................] - ETA: 41s
 95756288/221551911 [===========>..................] - ETA: 41s
 95952896/221551911 [===========>..................] - ETA: 41s
 96149504/221551911 [============>.................] - ETA: 41s
 96346112/221551911 [============>.................] - ETA: 41s
 96542720/221551911 [============>.................] - ETA: 41s
 96739328/221551911 [============>.................] - ETA: 41s
 96935936/221551911 [============>.................] - ETA: 41s
 97132544/221551911 [============>.................] - ETA: 41s
 97329152/221551911 [============>.................] - ETA: 41s
 97525760/221551911 [============>.................] - ETA: 41s
 97722368/221551911 [============>.................] - ETA: 41s
 97918976/221551911 [============>.................] - ETA: 40s
 98115584/221551911 [============>.................] - ETA: 40s
 98312192/221551911 [============>.................] - ETA: 40s
 98508800/221551911 [============>.................] - ETA: 40s
 98705408/221551911 [============>.................] - ETA: 40s
 98902016/221551911 [============>.................] - ETA: 40s
 99090432/221551911 [============>.................] - ETA: 40s
 99229696/221551911 [============>.................] - ETA: 40s
 99393536/221551911 [============>.................] - ETA: 40s
 99557376/221551911 [============>.................] - ETA: 40s
 99753984/221551911 [============>.................] - ETA: 40s
 99950592/221551911 [============>.................] - ETA: 40s
100147200/221551911 [============>.................] - ETA: 40s
100343808/221551911 [============>.................] - ETA: 40s
100540416/221551911 [============>.................] - ETA: 40s
100737024/221551911 [============>.................] - ETA: 39s
100933632/221551911 [============>.................] - ETA: 39s
101130240/221551911 [============>.................] - ETA: 39s
101326848/221551911 [============>.................] - ETA: 39s
101523456/221551911 [============>.................] - ETA: 39s
101720064/221551911 [============>.................] - ETA: 39s
101916672/221551911 [============>.................] - ETA: 39s
102113280/221551911 [============>.................] - ETA: 39s
102309888/221551911 [============>.................] - ETA: 39s
102506496/221551911 [============>.................] - ETA: 39s
102703104/221551911 [============>.................] - ETA: 39s
102899712/221551911 [============>.................] - ETA: 39s
103096320/221551911 [============>.................] - ETA: 39s
103292928/221551911 [============>.................] - ETA: 39s
103489536/221551911 [=============>................] - ETA: 39s
103686144/221551911 [=============>................] - ETA: 38s
103882752/221551911 [=============>................] - ETA: 38s
104079360/221551911 [=============>................] - ETA: 38s
104251392/221551911 [=============>................] - ETA: 38s
104407040/221551911 [=============>................] - ETA: 38s
104603648/221551911 [=============>................] - ETA: 38s
104800256/221551911 [=============>................] - ETA: 38s
104996864/221551911 [=============>................] - ETA: 38s
105193472/221551911 [=============>................] - ETA: 38s
105390080/221551911 [=============>................] - ETA: 38s
105586688/221551911 [=============>................] - ETA: 38s
105783296/221551911 [=============>................] - ETA: 38s
105979904/221551911 [=============>................] - ETA: 38s
106176512/221551911 [=============>................] - ETA: 38s
106373120/221551911 [=============>................] - ETA: 38s
106569728/221551911 [=============>................] - ETA: 37s
106766336/221551911 [=============>................] - ETA: 37s
106962944/221551911 [=============>................] - ETA: 37s
107159552/221551911 [=============>................] - ETA: 37s
107356160/221551911 [=============>................] - ETA: 37s
107520000/221551911 [=============>................] - ETA: 37s
107683840/221551911 [=============>................] - ETA: 37s
107880448/221551911 [=============>................] - ETA: 37s
108077056/221551911 [=============>................] - ETA: 37s
108273664/221551911 [=============>................] - ETA: 37s
108470272/221551911 [=============>................] - ETA: 37s
108666880/221551911 [=============>................] - ETA: 37s
108863488/221551911 [=============>................] - ETA: 37s
109060096/221551911 [=============>................] - ETA: 37s
109256704/221551911 [=============>................] - ETA: 36s
109453312/221551911 [=============>................] - ETA: 36s
109649920/221551911 [=============>................] - ETA: 36s
109846528/221551911 [=============>................] - ETA: 36s
110043136/221551911 [=============>................] - ETA: 36s
110239744/221551911 [=============>................] - ETA: 36s
110436352/221551911 [=============>................] - ETA: 36s
110632960/221551911 [=============>................] - ETA: 36s
110829568/221551911 [==============>...............] - ETA: 36s
111026176/221551911 [==============>...............] - ETA: 36s
111222784/221551911 [==============>...............] - ETA: 36s
111419392/221551911 [==============>...............] - ETA: 36s
111616000/221551911 [==============>...............] - ETA: 36s
111812608/221551911 [==============>...............] - ETA: 36s
112009216/221551911 [==============>...............] - ETA: 36s
112205824/221551911 [==============>...............] - ETA: 35s
112402432/221551911 [==============>...............] - ETA: 35s
112599040/221551911 [==============>...............] - ETA: 35s
112795648/221551911 [==============>...............] - ETA: 35s
112992256/221551911 [==============>...............] - ETA: 35s
113188864/221551911 [==============>...............] - ETA: 35s
113311744/221551911 [==============>...............] - ETA: 35s
113451008/221551911 [==============>...............] - ETA: 35s
113647616/221551911 [==============>...............] - ETA: 35s
113844224/221551911 [==============>...............] - ETA: 35s
114040832/221551911 [==============>...............] - ETA: 35s
114237440/221551911 [==============>...............] - ETA: 35s
114434048/221551911 [==============>...............] - ETA: 35s
114630656/221551911 [==============>...............] - ETA: 35s
114827264/221551911 [==============>...............] - ETA: 35s
115023872/221551911 [==============>...............] - ETA: 35s
115220480/221551911 [==============>...............] - ETA: 34s
115417088/221551911 [==============>...............] - ETA: 34s
115613696/221551911 [==============>...............] - ETA: 34s
115810304/221551911 [==============>...............] - ETA: 34s
116006912/221551911 [==============>...............] - ETA: 34s
116203520/221551911 [==============>...............] - ETA: 34s
116400128/221551911 [==============>...............] - ETA: 34s
116596736/221551911 [==============>...............] - ETA: 34s
116793344/221551911 [==============>...............] - ETA: 34s
116989952/221551911 [==============>...............] - ETA: 34s
117186560/221551911 [==============>...............] - ETA: 34s
117383168/221551911 [==============>...............] - ETA: 34s
117579776/221551911 [==============>...............] - ETA: 34s
117776384/221551911 [==============>...............] - ETA: 34s
117972992/221551911 [==============>...............] - ETA: 33s
118169600/221551911 [===============>..............] - ETA: 33s
118366208/221551911 [===============>..............] - ETA: 33s
118562816/221551911 [===============>..............] - ETA: 33s
118759424/221551911 [===============>..............] - ETA: 33s
118956032/221551911 [===============>..............] - ETA: 33s
119152640/221551911 [===============>..............] - ETA: 33s
119349248/221551911 [===============>..............] - ETA: 33s
119414784/221551911 [===============>..............] - ETA: 33s
119611392/221551911 [===============>..............] - ETA: 33s
119808000/221551911 [===============>..............] - ETA: 33s
120004608/221551911 [===============>..............] - ETA: 33s
120201216/221551911 [===============>..............] - ETA: 33s
120397824/221551911 [===============>..............] - ETA: 33s
120594432/221551911 [===============>..............] - ETA: 33s
120791040/221551911 [===============>..............] - ETA: 33s
120987648/221551911 [===============>..............] - ETA: 32s
121184256/221551911 [===============>..............] - ETA: 32s
121380864/221551911 [===============>..............] - ETA: 32s
121577472/221551911 [===============>..............] - ETA: 32s
121774080/221551911 [===============>..............] - ETA: 32s
121970688/221551911 [===============>..............] - ETA: 32s
122167296/221551911 [===============>..............] - ETA: 32s
122363904/221551911 [===============>..............] - ETA: 32s
122560512/221551911 [===============>..............] - ETA: 32s
122757120/221551911 [===============>..............] - ETA: 32s
122953728/221551911 [===============>..............] - ETA: 32s
123150336/221551911 [===============>..............] - ETA: 32s
123346944/221551911 [===============>..............] - ETA: 32s
123543552/221551911 [===============>..............] - ETA: 32s
123740160/221551911 [===============>..............] - ETA: 32s
123936768/221551911 [===============>..............] - ETA: 31s
124133376/221551911 [===============>..............] - ETA: 31s
124329984/221551911 [===============>..............] - ETA: 31s
124526592/221551911 [===============>..............] - ETA: 31s
124723200/221551911 [===============>..............] - ETA: 31s
124919808/221551911 [===============>..............] - ETA: 31s
125116416/221551911 [===============>..............] - ETA: 31s
125313024/221551911 [===============>..............] - ETA: 31s
125509632/221551911 [===============>..............] - ETA: 31s
125706240/221551911 [================>.............] - ETA: 31s
125902848/221551911 [================>.............] - ETA: 31s
126099456/221551911 [================>.............] - ETA: 31s
126296064/221551911 [================>.............] - ETA: 31s
126492672/221551911 [================>.............] - ETA: 31s
126689280/221551911 [================>.............] - ETA: 31s
126885888/221551911 [================>.............] - ETA: 30s
127082496/221551911 [================>.............] - ETA: 30s
127279104/221551911 [================>.............] - ETA: 30s
127475712/221551911 [================>.............] - ETA: 30s
127672320/221551911 [================>.............] - ETA: 30s
127868928/221551911 [================>.............] - ETA: 30s
128065536/221551911 [================>.............] - ETA: 30s
128262144/221551911 [================>.............] - ETA: 30s
128458752/221551911 [================>.............] - ETA: 30s
128655360/221551911 [================>.............] - ETA: 30s
128786432/221551911 [================>.............] - ETA: 30s
128983040/221551911 [================>.............] - ETA: 30s
129179648/221551911 [================>.............] - ETA: 30s
129376256/221551911 [================>.............] - ETA: 30s
129572864/221551911 [================>.............] - ETA: 30s
129769472/221551911 [================>.............] - ETA: 30s
129966080/221551911 [================>.............] - ETA: 29s
130162688/221551911 [================>.............] - ETA: 29s
130359296/221551911 [================>.............] - ETA: 29s
130555904/221551911 [================>.............] - ETA: 29s
130752512/221551911 [================>.............] - ETA: 29s
130949120/221551911 [================>.............] - ETA: 29s
131145728/221551911 [================>.............] - ETA: 29s
131342336/221551911 [================>.............] - ETA: 29s
131538944/221551911 [================>.............] - ETA: 29s
131735552/221551911 [================>.............] - ETA: 29s
131932160/221551911 [================>.............] - ETA: 29s
132128768/221551911 [================>.............] - ETA: 29s
132325376/221551911 [================>.............] - ETA: 29s
132521984/221551911 [================>.............] - ETA: 29s
132718592/221551911 [================>.............] - ETA: 29s
132915200/221551911 [================>.............] - ETA: 28s
133111808/221551911 [=================>............] - ETA: 28s
133308416/221551911 [=================>............] - ETA: 28s
133505024/221551911 [=================>............] - ETA: 28s
133701632/221551911 [=================>............] - ETA: 28s
133898240/221551911 [=================>............] - ETA: 28s
134021120/221551911 [=================>............] - ETA: 28s
134160384/221551911 [=================>............] - ETA: 28s
134316032/221551911 [=================>............] - ETA: 28s
134488064/221551911 [=================>............] - ETA: 28s
134684672/221551911 [=================>............] - ETA: 28s
134881280/221551911 [=================>............] - ETA: 28s
135077888/221551911 [=================>............] - ETA: 28s
135274496/221551911 [=================>............] - ETA: 28s
135471104/221551911 [=================>............] - ETA: 28s
135667712/221551911 [=================>............] - ETA: 28s
135864320/221551911 [=================>............] - ETA: 28s
136060928/221551911 [=================>............] - ETA: 27s
136257536/221551911 [=================>............] - ETA: 27s
136454144/221551911 [=================>............] - ETA: 27s
136650752/221551911 [=================>............] - ETA: 27s
136847360/221551911 [=================>............] - ETA: 27s
137043968/221551911 [=================>............] - ETA: 27s
137240576/221551911 [=================>............] - ETA: 27s
137437184/221551911 [=================>............] - ETA: 27s
137633792/221551911 [=================>............] - ETA: 27s
137830400/221551911 [=================>............] - ETA: 27s
138027008/221551911 [=================>............] - ETA: 27s
138223616/221551911 [=================>............] - ETA: 27s
138420224/221551911 [=================>............] - ETA: 27s
138616832/221551911 [=================>............] - ETA: 27s
138813440/221551911 [=================>............] - ETA: 27s
139010048/221551911 [=================>............] - ETA: 26s
139206656/221551911 [=================>............] - ETA: 26s
139403264/221551911 [=================>............] - ETA: 26s
139599872/221551911 [=================>............] - ETA: 26s
139796480/221551911 [=================>............] - ETA: 26s
139993088/221551911 [=================>............] - ETA: 26s
140189696/221551911 [=================>............] - ETA: 26s
140386304/221551911 [==================>...........] - ETA: 26s
140582912/221551911 [==================>...........] - ETA: 26s
140779520/221551911 [==================>...........] - ETA: 26s
140976128/221551911 [==================>...........] - ETA: 26s
141172736/221551911 [==================>...........] - ETA: 26s
141369344/221551911 [==================>...........] - ETA: 26s
141565952/221551911 [==================>...........] - ETA: 26s
141762560/221551911 [==================>...........] - ETA: 26s
141959168/221551911 [==================>...........] - ETA: 25s
142155776/221551911 [==================>...........] - ETA: 25s
142352384/221551911 [==================>...........] - ETA: 25s
142548992/221551911 [==================>...........] - ETA: 25s
142745600/221551911 [==================>...........] - ETA: 25s
142942208/221551911 [==================>...........] - ETA: 25s
143138816/221551911 [==================>...........] - ETA: 25s
143335424/221551911 [==================>...........] - ETA: 25s
143532032/221551911 [==================>...........] - ETA: 25s
143728640/221551911 [==================>...........] - ETA: 25s
143925248/221551911 [==================>...........] - ETA: 25s
144121856/221551911 [==================>...........] - ETA: 25s
144318464/221551911 [==================>...........] - ETA: 25s
144515072/221551911 [==================>...........] - ETA: 25s
144711680/221551911 [==================>...........] - ETA: 25s
144908288/221551911 [==================>...........] - ETA: 24s
145104896/221551911 [==================>...........] - ETA: 24s
145301504/221551911 [==================>...........] - ETA: 24s
145498112/221551911 [==================>...........] - ETA: 24s
145694720/221551911 [==================>...........] - ETA: 24s
145891328/221551911 [==================>...........] - ETA: 24s
146087936/221551911 [==================>...........] - ETA: 24s
146284544/221551911 [==================>...........] - ETA: 24s
146481152/221551911 [==================>...........] - ETA: 24s
146677760/221551911 [==================>...........] - ETA: 24s
146874368/221551911 [==================>...........] - ETA: 24s
147070976/221551911 [==================>...........] - ETA: 24s
147267584/221551911 [==================>...........] - ETA: 24s
147464192/221551911 [==================>...........] - ETA: 24s
147636224/221551911 [==================>...........] - ETA: 24s
147791872/221551911 [===================>..........] - ETA: 23s
147988480/221551911 [===================>..........] - ETA: 23s
148185088/221551911 [===================>..........] - ETA: 23s
148381696/221551911 [===================>..........] - ETA: 23s
148578304/221551911 [===================>..........] - ETA: 23s
148774912/221551911 [===================>..........] - ETA: 23s
148971520/221551911 [===================>..........] - ETA: 23s
149168128/221551911 [===================>..........] - ETA: 23s
149364736/221551911 [===================>..........] - ETA: 23s
149561344/221551911 [===================>..........] - ETA: 23s
149757952/221551911 [===================>..........] - ETA: 23s
149954560/221551911 [===================>..........] - ETA: 23s
150151168/221551911 [===================>..........] - ETA: 23s
150347776/221551911 [===================>..........] - ETA: 23s
150544384/221551911 [===================>..........] - ETA: 23s
150740992/221551911 [===================>..........] - ETA: 23s
150937600/221551911 [===================>..........] - ETA: 22s
151134208/221551911 [===================>..........] - ETA: 22s
151330816/221551911 [===================>..........] - ETA: 22s
151527424/221551911 [===================>..........] - ETA: 22s
151724032/221551911 [===================>..........] - ETA: 22s
151920640/221551911 [===================>..........] - ETA: 22s
152117248/221551911 [===================>..........] - ETA: 22s
152313856/221551911 [===================>..........] - ETA: 22s
152510464/221551911 [===================>..........] - ETA: 22s
152707072/221551911 [===================>..........] - ETA: 22s
152903680/221551911 [===================>..........] - ETA: 22s
153100288/221551911 [===================>..........] - ETA: 22s
153296896/221551911 [===================>..........] - ETA: 22s
153493504/221551911 [===================>..........] - ETA: 22s
153690112/221551911 [===================>..........] - ETA: 22s
153886720/221551911 [===================>..........] - ETA: 21s
154083328/221551911 [===================>..........] - ETA: 21s
154279936/221551911 [===================>..........] - ETA: 21s
154476544/221551911 [===================>..........] - ETA: 21s
154673152/221551911 [===================>..........] - ETA: 21s
154869760/221551911 [===================>..........] - ETA: 21s
155066368/221551911 [===================>..........] - ETA: 21s
155262976/221551911 [====================>.........] - ETA: 21s
155459584/221551911 [====================>.........] - ETA: 21s
155656192/221551911 [====================>.........] - ETA: 21s
155852800/221551911 [====================>.........] - ETA: 21s
156049408/221551911 [====================>.........] - ETA: 21s
156246016/221551911 [====================>.........] - ETA: 21s
156442624/221551911 [====================>.........] - ETA: 21s
156639232/221551911 [====================>.........] - ETA: 21s
156835840/221551911 [====================>.........] - ETA: 20s
157032448/221551911 [====================>.........] - ETA: 20s
157229056/221551911 [====================>.........] - ETA: 20s
157425664/221551911 [====================>.........] - ETA: 20s
157622272/221551911 [====================>.........] - ETA: 20s
157818880/221551911 [====================>.........] - ETA: 20s
158015488/221551911 [====================>.........] - ETA: 20s
158212096/221551911 [====================>.........] - ETA: 20s
158408704/221551911 [====================>.........] - ETA: 20s
158605312/221551911 [====================>.........] - ETA: 20s
158801920/221551911 [====================>.........] - ETA: 20s
158998528/221551911 [====================>.........] - ETA: 20s
159195136/221551911 [====================>.........] - ETA: 20s
159391744/221551911 [====================>.........] - ETA: 20s
159588352/221551911 [====================>.........] - ETA: 20s
159784960/221551911 [====================>.........] - ETA: 19s
159981568/221551911 [====================>.........] - ETA: 19s
160161792/221551911 [====================>.........] - ETA: 19s
160309248/221551911 [====================>.........] - ETA: 19s
160505856/221551911 [====================>.........] - ETA: 19s
160702464/221551911 [====================>.........] - ETA: 19s
160899072/221551911 [====================>.........] - ETA: 19s
161095680/221551911 [====================>.........] - ETA: 19s
161292288/221551911 [====================>.........] - ETA: 19s
161488896/221551911 [====================>.........] - ETA: 19s
161685504/221551911 [====================>.........] - ETA: 19s
161882112/221551911 [====================>.........] - ETA: 19s
162078720/221551911 [====================>.........] - ETA: 19s
162275328/221551911 [====================>.........] - ETA: 19s
162471936/221551911 [=====================>........] - ETA: 19s
162668544/221551911 [=====================>........] - ETA: 19s
162865152/221551911 [=====================>........] - ETA: 18s
163061760/221551911 [=====================>........] - ETA: 18s
163258368/221551911 [=====================>........] - ETA: 18s
163454976/221551911 [=====================>........] - ETA: 18s
163651584/221551911 [=====================>........] - ETA: 18s
163848192/221551911 [=====================>........] - ETA: 18s
164044800/221551911 [=====================>........] - ETA: 18s
164241408/221551911 [=====================>........] - ETA: 18s
164438016/221551911 [=====================>........] - ETA: 18s
164634624/221551911 [=====================>........] - ETA: 18s
164831232/221551911 [=====================>........] - ETA: 18s
165027840/221551911 [=====================>........] - ETA: 18s
165224448/221551911 [=====================>........] - ETA: 18s
165421056/221551911 [=====================>........] - ETA: 18s
165617664/221551911 [=====================>........] - ETA: 18s
165814272/221551911 [=====================>........] - ETA: 18s
166010880/221551911 [=====================>........] - ETA: 17s
166207488/221551911 [=====================>........] - ETA: 17s
166404096/221551911 [=====================>........] - ETA: 17s
166600704/221551911 [=====================>........] - ETA: 17s
166797312/221551911 [=====================>........] - ETA: 17s
166993920/221551911 [=====================>........] - ETA: 17s
167157760/221551911 [=====================>........] - ETA: 17s
167321600/221551911 [=====================>........] - ETA: 17s
167518208/221551911 [=====================>........] - ETA: 17s
167714816/221551911 [=====================>........] - ETA: 17s
167911424/221551911 [=====================>........] - ETA: 17s
168108032/221551911 [=====================>........] - ETA: 17s
168304640/221551911 [=====================>........] - ETA: 17s
168501248/221551911 [=====================>........] - ETA: 17s
168697856/221551911 [=====================>........] - ETA: 17s
168894464/221551911 [=====================>........] - ETA: 17s
169091072/221551911 [=====================>........] - ETA: 16s
169287680/221551911 [=====================>........] - ETA: 16s
169484288/221551911 [=====================>........] - ETA: 16s
169680896/221551911 [=====================>........] - ETA: 16s
169877504/221551911 [======================>.......] - ETA: 16s
170074112/221551911 [======================>.......] - ETA: 16s
170270720/221551911 [======================>.......] - ETA: 16s
170467328/221551911 [======================>.......] - ETA: 16s
170663936/221551911 [======================>.......] - ETA: 16s
170860544/221551911 [======================>.......] - ETA: 16s
171057152/221551911 [======================>.......] - ETA: 16s
171253760/221551911 [======================>.......] - ETA: 16s
171450368/221551911 [======================>.......] - ETA: 16s
171646976/221551911 [======================>.......] - ETA: 16s
171843584/221551911 [======================>.......] - ETA: 16s
172040192/221551911 [======================>.......] - ETA: 15s
172171264/221551911 [======================>.......] - ETA: 15s
172367872/221551911 [======================>.......] - ETA: 15s
172564480/221551911 [======================>.......] - ETA: 15s
172761088/221551911 [======================>.......] - ETA: 15s
172957696/221551911 [======================>.......] - ETA: 15s
173154304/221551911 [======================>.......] - ETA: 15s
173350912/221551911 [======================>.......] - ETA: 15s
173547520/221551911 [======================>.......] - ETA: 15s
173744128/221551911 [======================>.......] - ETA: 15s
173940736/221551911 [======================>.......] - ETA: 15s
174137344/221551911 [======================>.......] - ETA: 15s
174333952/221551911 [======================>.......] - ETA: 15s
174530560/221551911 [======================>.......] - ETA: 15s
174727168/221551911 [======================>.......] - ETA: 15s
174923776/221551911 [======================>.......] - ETA: 15s
175120384/221551911 [======================>.......] - ETA: 14s
175316992/221551911 [======================>.......] - ETA: 14s
175513600/221551911 [======================>.......] - ETA: 14s
175710208/221551911 [======================>.......] - ETA: 14s
175906816/221551911 [======================>.......] - ETA: 14s
176103424/221551911 [======================>.......] - ETA: 14s
176300032/221551911 [======================>.......] - ETA: 14s
176496640/221551911 [======================>.......] - ETA: 14s
176693248/221551911 [======================>.......] - ETA: 14s
176889856/221551911 [======================>.......] - ETA: 14s
177086464/221551911 [======================>.......] - ETA: 14s
177283072/221551911 [=======================>......] - ETA: 14s
177479680/221551911 [=======================>......] - ETA: 14s
177676288/221551911 [=======================>......] - ETA: 14s
177872896/221551911 [=======================>......] - ETA: 14s
178069504/221551911 [=======================>......] - ETA: 14s
178266112/221551911 [=======================>......] - ETA: 13s
178462720/221551911 [=======================>......] - ETA: 13s
178659328/221551911 [=======================>......] - ETA: 13s
178855936/221551911 [=======================>......] - ETA: 13s
179052544/221551911 [=======================>......] - ETA: 13s
179249152/221551911 [=======================>......] - ETA: 13s
179445760/221551911 [=======================>......] - ETA: 13s
179576832/221551911 [=======================>......] - ETA: 13s
179773440/221551911 [=======================>......] - ETA: 13s
179970048/221551911 [=======================>......] - ETA: 13s
180166656/221551911 [=======================>......] - ETA: 13s
180363264/221551911 [=======================>......] - ETA: 13s
180559872/221551911 [=======================>......] - ETA: 13s
180756480/221551911 [=======================>......] - ETA: 13s
180953088/221551911 [=======================>......] - ETA: 13s
181149696/221551911 [=======================>......] - ETA: 13s
181346304/221551911 [=======================>......] - ETA: 12s
181542912/221551911 [=======================>......] - ETA: 12s
181739520/221551911 [=======================>......] - ETA: 12s
181936128/221551911 [=======================>......] - ETA: 12s
182132736/221551911 [=======================>......] - ETA: 12s
182329344/221551911 [=======================>......] - ETA: 12s
182525952/221551911 [=======================>......] - ETA: 12s
182722560/221551911 [=======================>......] - ETA: 12s
182919168/221551911 [=======================>......] - ETA: 12s
183115776/221551911 [=======================>......] - ETA: 12s
183312384/221551911 [=======================>......] - ETA: 12s
183508992/221551911 [=======================>......] - ETA: 12s
183705600/221551911 [=======================>......] - ETA: 12s
183902208/221551911 [=======================>......] - ETA: 12s
184098816/221551911 [=======================>......] - ETA: 12s
184295424/221551911 [=======================>......] - ETA: 11s
184492032/221551911 [=======================>......] - ETA: 11s
184688640/221551911 [========================>.....] - ETA: 11s
184885248/221551911 [========================>.....] - ETA: 11s
185081856/221551911 [========================>.....] - ETA: 11s
185278464/221551911 [========================>.....] - ETA: 11s
185475072/221551911 [========================>.....] - ETA: 11s
185671680/221551911 [========================>.....] - ETA: 11s
185868288/221551911 [========================>.....] - ETA: 11s
186064896/221551911 [========================>.....] - ETA: 11s
186261504/221551911 [========================>.....] - ETA: 11s
186458112/221551911 [========================>.....] - ETA: 11s
186654720/221551911 [========================>.....] - ETA: 11s
186851328/221551911 [========================>.....] - ETA: 11s
187047936/221551911 [========================>.....] - ETA: 11s
187244544/221551911 [========================>.....] - ETA: 11s
187441152/221551911 [========================>.....] - ETA: 10s
187637760/221551911 [========================>.....] - ETA: 10s
187834368/221551911 [========================>.....] - ETA: 10s
188030976/221551911 [========================>.....] - ETA: 10s
188227584/221551911 [========================>.....] - ETA: 10s
188424192/221551911 [========================>.....] - ETA: 10s
188620800/221551911 [========================>.....] - ETA: 10s
188817408/221551911 [========================>.....] - ETA: 10s
189014016/221551911 [========================>.....] - ETA: 10s
189210624/221551911 [========================>.....] - ETA: 10s
189407232/221551911 [========================>.....] - ETA: 10s
189603840/221551911 [========================>.....] - ETA: 10s
189800448/221551911 [========================>.....] - ETA: 10s
189997056/221551911 [========================>.....] - ETA: 10s
190193664/221551911 [========================>.....] - ETA: 10s
190390272/221551911 [========================>.....] - ETA: 10s
190586880/221551911 [========================>.....] - ETA: 9s 
190783488/221551911 [========================>.....] - ETA: 9s
190980096/221551911 [========================>.....] - ETA: 9s
191176704/221551911 [========================>.....] - ETA: 9s
191373312/221551911 [========================>.....] - ETA: 9s
191569920/221551911 [========================>.....] - ETA: 9s
191766528/221551911 [========================>.....] - ETA: 9s
191963136/221551911 [========================>.....] - ETA: 9s
192028672/221551911 [=========================>....] - ETA: 9s
192225280/221551911 [=========================>....] - ETA: 9s
192421888/221551911 [=========================>....] - ETA: 9s
192618496/221551911 [=========================>....] - ETA: 9s
192815104/221551911 [=========================>....] - ETA: 9s
193011712/221551911 [=========================>....] - ETA: 9s
193208320/221551911 [=========================>....] - ETA: 9s
193404928/221551911 [=========================>....] - ETA: 9s
193601536/221551911 [=========================>....] - ETA: 8s
193798144/221551911 [=========================>....] - ETA: 8s
193994752/221551911 [=========================>....] - ETA: 8s
194191360/221551911 [=========================>....] - ETA: 8s
194387968/221551911 [=========================>....] - ETA: 8s
194584576/221551911 [=========================>....] - ETA: 8s
194781184/221551911 [=========================>....] - ETA: 8s
194977792/221551911 [=========================>....] - ETA: 8s
195174400/221551911 [=========================>....] - ETA: 8s
195371008/221551911 [=========================>....] - ETA: 8s
195567616/221551911 [=========================>....] - ETA: 8s
195764224/221551911 [=========================>....] - ETA: 8s
195960832/221551911 [=========================>....] - ETA: 8s
196157440/221551911 [=========================>....] - ETA: 8s
196354048/221551911 [=========================>....] - ETA: 8s
196550656/221551911 [=========================>....] - ETA: 8s
196747264/221551911 [=========================>....] - ETA: 7s
196943872/221551911 [=========================>....] - ETA: 7s
197140480/221551911 [=========================>....] - ETA: 7s
197337088/221551911 [=========================>....] - ETA: 7s
197533696/221551911 [=========================>....] - ETA: 7s
197730304/221551911 [=========================>....] - ETA: 7s
197926912/221551911 [=========================>....] - ETA: 7s
198123520/221551911 [=========================>....] - ETA: 7s
198320128/221551911 [=========================>....] - ETA: 7s
198516736/221551911 [=========================>....] - ETA: 7s
198713344/221551911 [=========================>....] - ETA: 7s
198909952/221551911 [=========================>....] - ETA: 7s
199106560/221551911 [=========================>....] - ETA: 7s
199303168/221551911 [=========================>....] - ETA: 7s
199499776/221551911 [==========================>...] - ETA: 7s
199696384/221551911 [==========================>...] - ETA: 7s
199892992/221551911 [==========================>...] - ETA: 6s
200089600/221551911 [==========================>...] - ETA: 6s
200286208/221551911 [==========================>...] - ETA: 6s
200482816/221551911 [==========================>...] - ETA: 6s
200679424/221551911 [==========================>...] - ETA: 6s
200876032/221551911 [==========================>...] - ETA: 6s
201072640/221551911 [==========================>...] - ETA: 6s
201269248/221551911 [==========================>...] - ETA: 6s
201465856/221551911 [==========================>...] - ETA: 6s
201662464/221551911 [==========================>...] - ETA: 6s
201859072/221551911 [==========================>...] - ETA: 6s
202055680/221551911 [==========================>...] - ETA: 6s
202252288/221551911 [==========================>...] - ETA: 6s
202448896/221551911 [==========================>...] - ETA: 6s
202645504/221551911 [==========================>...] - ETA: 6s
202842112/221551911 [==========================>...] - ETA: 6s
203038720/221551911 [==========================>...] - ETA: 5s
203235328/221551911 [==========================>...] - ETA: 5s
203431936/221551911 [==========================>...] - ETA: 5s
203628544/221551911 [==========================>...] - ETA: 5s
203825152/221551911 [==========================>...] - ETA: 5s
204021760/221551911 [==========================>...] - ETA: 5s
204218368/221551911 [==========================>...] - ETA: 5s
204414976/221551911 [==========================>...] - ETA: 5s
204611584/221551911 [==========================>...] - ETA: 5s
204808192/221551911 [==========================>...] - ETA: 5s
205004800/221551911 [==========================>...] - ETA: 5s
205201408/221551911 [==========================>...] - ETA: 5s
205398016/221551911 [==========================>...] - ETA: 5s
205594624/221551911 [==========================>...] - ETA: 5s
205791232/221551911 [==========================>...] - ETA: 5s
205987840/221551911 [==========================>...] - ETA: 4s
206184448/221551911 [==========================>...] - ETA: 4s
206381056/221551911 [==========================>...] - ETA: 4s
206577664/221551911 [==========================>...] - ETA: 4s
206774272/221551911 [==========================>...] - ETA: 4s
206970880/221551911 [===========================>..] - ETA: 4s
207167488/221551911 [===========================>..] - ETA: 4s
207364096/221551911 [===========================>..] - ETA: 4s
207560704/221551911 [===========================>..] - ETA: 4s
207757312/221551911 [===========================>..] - ETA: 4s
207953920/221551911 [===========================>..] - ETA: 4s
208076800/221551911 [===========================>..] - ETA: 4s
208216064/221551911 [===========================>..] - ETA: 4s
208412672/221551911 [===========================>..] - ETA: 4s
208609280/221551911 [===========================>..] - ETA: 4s
208805888/221551911 [===========================>..] - ETA: 4s
208994304/221551911 [===========================>..] - ETA: 4s
209133568/221551911 [===========================>..] - ETA: 3s
209330176/221551911 [===========================>..] - ETA: 3s
209526784/221551911 [===========================>..] - ETA: 3s
209723392/221551911 [===========================>..] - ETA: 3s
209920000/221551911 [===========================>..] - ETA: 3s
210116608/221551911 [===========================>..] - ETA: 3s
210313216/221551911 [===========================>..] - ETA: 3s
210509824/221551911 [===========================>..] - ETA: 3s
210706432/221551911 [===========================>..] - ETA: 3s
210903040/221551911 [===========================>..] - ETA: 3s
211099648/221551911 [===========================>..] - ETA: 3s
211296256/221551911 [===========================>..] - ETA: 3s
211492864/221551911 [===========================>..] - ETA: 3s
211689472/221551911 [===========================>..] - ETA: 3s
211886080/221551911 [===========================>..] - ETA: 3s
212082688/221551911 [===========================>..] - ETA: 3s
212279296/221551911 [===========================>..] - ETA: 2s
212475904/221551911 [===========================>..] - ETA: 2s
212672512/221551911 [===========================>..] - ETA: 2s
212869120/221551911 [===========================>..] - ETA: 2s
213065728/221551911 [===========================>..] - ETA: 2s
213262336/221551911 [===========================>..] - ETA: 2s
213458944/221551911 [===========================>..] - ETA: 2s
213655552/221551911 [===========================>..] - ETA: 2s
213852160/221551911 [===========================>..] - ETA: 2s
214048768/221551911 [===========================>..] - ETA: 2s
214245376/221551911 [============================>.] - ETA: 2s
214441984/221551911 [============================>.] - ETA: 2s
214638592/221551911 [============================>.] - ETA: 2s
214835200/221551911 [============================>.] - ETA: 2s
215031808/221551911 [============================>.] - ETA: 2s
215228416/221551911 [============================>.] - ETA: 2s
215425024/221551911 [============================>.] - ETA: 1s
215621632/221551911 [============================>.] - ETA: 1s
215818240/221551911 [============================>.] - ETA: 1s
216014848/221551911 [============================>.] - ETA: 1s
216203264/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: 1s
218112000/221551911 [============================>.] - ETA: 1s
218308608/221551911 [============================>.] - ETA: 1s
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
221233152/221551911 [============================>.] - ETA: 0s
221257728/221551911 [============================>.] - ETA: 0s
221315072/221551911 [============================>.] - ETA: 0s
221347840/221551911 [============================>.] - ETA: 0s
221388800/221551911 [============================>.] - ETA: 0s
221454336/221551911 [============================>.] - ETA: 0s
221503488/221551911 [============================>.] - ETA: 0s
221544448/221551911 [============================>.] - ETA: 0s
221552640/221551911 [==============================] - 71s 0us/step

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

Anchors can also be computed easily using YOLO toolkit.

Note

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

from akida_models.detection.generate_anchors import generate_anchors

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

Out:

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

3. Model architecture

The model zoo contains a YOLO model that is built upon the AkidaNet 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 AkidaNet (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_28 (InputLayer)       [(None, 224, 224, 3)]     0

 rescaling_1 (Rescaling)     (None, 224, 224, 3)       0

 conv_0 (Conv2D)             (None, 112, 112, 16)      432

 conv_0_BN (BatchNormalizati  (None, 112, 112, 16)     64
 on)

 conv_0_relu (ReLU)          (None, 112, 112, 16)      0

 conv_1 (Conv2D)             (None, 112, 112, 32)      4608

 conv_1_BN (BatchNormalizati  (None, 112, 112, 32)     128
 on)

 conv_1_relu (ReLU)          (None, 112, 112, 32)      0

 conv_2 (Conv2D)             (None, 56, 56, 64)        18432

 conv_2_BN (BatchNormalizati  (None, 56, 56, 64)       256
 on)

 conv_2_relu (ReLU)          (None, 56, 56, 64)        0

 conv_3 (Conv2D)             (None, 56, 56, 64)        36864

 conv_3_BN (BatchNormalizati  (None, 56, 56, 64)       256
 on)

 conv_3_relu (ReLU)          (None, 56, 56, 64)        0

 separable_4 (SeparableConv2  (None, 28, 28, 128)      8768
 D)

 separable_4_BN (BatchNormal  (None, 28, 28, 128)      512
 ization)

 separable_4_relu (ReLU)     (None, 28, 28, 128)       0

 separable_5 (SeparableConv2  (None, 28, 28, 128)      17536
 D)

 separable_5_BN (BatchNormal  (None, 28, 28, 128)      512
 ization)

 separable_5_relu (ReLU)     (None, 28, 28, 128)       0

 separable_6 (SeparableConv2  (None, 14, 14, 256)      33920
 D)

 separable_6_BN (BatchNormal  (None, 14, 14, 256)      1024
 ization)

 separable_6_relu (ReLU)     (None, 14, 14, 256)       0

 separable_7 (SeparableConv2  (None, 14, 14, 256)      67840
 D)

 separable_7_BN (BatchNormal  (None, 14, 14, 256)      1024
 ization)

 separable_7_relu (ReLU)     (None, 14, 14, 256)       0

 separable_8 (SeparableConv2  (None, 14, 14, 256)      67840
 D)

 separable_8_BN (BatchNormal  (None, 14, 14, 256)      1024
 ization)

 separable_8_relu (ReLU)     (None, 14, 14, 256)       0

 separable_9 (SeparableConv2  (None, 14, 14, 256)      67840
 D)

 separable_9_BN (BatchNormal  (None, 14, 14, 256)      1024
 ization)

 separable_9_relu (ReLU)     (None, 14, 14, 256)       0

 separable_10 (SeparableConv  (None, 14, 14, 256)      67840
 2D)

 separable_10_BN (BatchNorma  (None, 14, 14, 256)      1024
 lization)

 separable_10_relu (ReLU)    (None, 14, 14, 256)       0

 separable_11 (SeparableConv  (None, 14, 14, 256)      67840
 2D)

 separable_11_BN (BatchNorma  (None, 14, 14, 256)      1024
 lization)

 separable_11_relu (ReLU)    (None, 14, 14, 256)       0

 separable_12 (SeparableConv  (None, 7, 7, 512)        133376
 2D)

 separable_12_BN (BatchNorma  (None, 7, 7, 512)        2048
 lization)

 separable_12_relu (ReLU)    (None, 7, 7, 512)         0

 separable_13 (SeparableConv  (None, 7, 7, 512)        266752
 2D)

 separable_13_BN (BatchNorma  (None, 7, 7, 512)        2048
 lization)

 separable_13_relu (ReLU)    (None, 7, 7, 512)         0

 1conv (SeparableConv2D)     (None, 7, 7, 1024)        528896

 1conv_BN (BatchNormalizatio  (None, 7, 7, 1024)       4096
 n)

 1conv_relu (ReLU)           (None, 7, 7, 1024)        0

 2conv (SeparableConv2D)     (None, 7, 7, 1024)        1057792

 2conv_BN (BatchNormalizatio  (None, 7, 7, 1024)       4096
 n)

 2conv_relu (ReLU)           (None, 7, 7, 1024)        0

 3conv (SeparableConv2D)     (None, 7, 7, 1024)        1057792

 3conv_BN (BatchNormalizatio  (None, 7, 7, 1024)       4096
 n)

 3conv_relu (ReLU)           (None, 7, 7, 1024)        0

 detection_layer (SeparableC  (None, 7, 7, 35)         45091
 onv2D)

=================================================================
Total params: 3,573,715
Trainable params: 3,561,587
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 AkidaNet/ImageNet network, it is possible to perform transfer learning from ImageNet pretrained weights when training a YOLO model. See the PlantVillage 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 AkidaNet/ImageNet pretrained float weights,

akida_models create -s yolo_akidanet_voc.h5 yolo_base --classes 2 \
         --base_weights akidanet_imagenet_224_alpha_50.h5
  • freeze the AkidaNet layers and perform training,

yolo_train train -d voc_preprocessed.pkl -m yolo_akidanet_voc.h5 \
    -ap voc_anchors.pkl -e 25 -fb 1conv -s yolo_akidanet_voc.h5
  • unfreeze all layers, lower the learning rate and quantize the network (e.g to 8-bits weights and activations),

cnn2snn quantize -m yolo_akidanet_voc.h5 -iq 8 -wq 8 -aq 8
yolo_train train -d voc_preprocessed.pkl \
    -m yolo_akidanet_voc_iq8_wq8_aq8.h5 \
    -ap voc_anchors.pkl -e 20 -s yolo_akidanet_voc_iq8_wq8_aq8.h5
  • quantize to a lower bitwidth until reaching the target bitwidth and retrain.

cnn2snn quantize -m yolo_akidanet_voc_iq8_wq8_aq8.h5 -iq 8 -wq 4 -aq 4
yolo_train train -d voc_preprocessed.pkl \
    -m yolo_akidanet_voc_iq8_wq4_aq4.h5 \
    -ap voc_anchors.pkl -e 20 -s yolo_akidanet_voc_iq8_wq4_aq4.h5

Note

  • voc_anchors.pkl is obtained saving the output of the generate_anchors call to a pickle file,

  • voc_preprocessed.pkl is obtained saving training data, validation data (obtained using parse_voc_annotations) and labels list (i.e [“car”, “person”]) into a pickle file.

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

5. Performance

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

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

Note

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

Reported performanced for all training steps are as follows:

Float

8-bit/8-bit

4-bit/4-bit

Global mAP

42.07 %

41.45 %

30.23 %

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

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

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

# Create the mAP evaluator object
num_images = 100

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

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

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

Out:

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

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

   16384/14327744 [..............................] - ETA: 0s
   73728/14327744 [..............................] - ETA: 55s
  270336/14327744 [..............................] - ETA: 18s
  466944/14327744 [..............................] - ETA: 12s
  663552/14327744 [>.............................] - ETA: 9s 
  860160/14327744 [>.............................] - ETA: 8s
 1056768/14327744 [=>............................] - ETA: 7s
 1253376/14327744 [=>............................] - ETA: 6s
 1449984/14327744 [==>...........................] - ETA: 6s
 1646592/14327744 [==>...........................] - ETA: 5s
 1843200/14327744 [==>...........................] - ETA: 5s
 2039808/14327744 [===>..........................] - ETA: 5s
 2236416/14327744 [===>..........................] - ETA: 5s
 2433024/14327744 [====>.........................] - ETA: 4s
 2629632/14327744 [====>.........................] - ETA: 4s
 2826240/14327744 [====>.........................] - ETA: 4s
 3022848/14327744 [=====>........................] - ETA: 4s
 3219456/14327744 [=====>........................] - ETA: 4s
 3416064/14327744 [======>.......................] - ETA: 4s
 3612672/14327744 [======>.......................] - ETA: 4s
 3809280/14327744 [======>.......................] - ETA: 3s
 4005888/14327744 [=======>......................] - ETA: 3s
 4202496/14327744 [=======>......................] - ETA: 3s
 4399104/14327744 [========>.....................] - ETA: 3s
 4595712/14327744 [========>.....................] - ETA: 3s
 4792320/14327744 [=========>....................] - ETA: 3s
 4988928/14327744 [=========>....................] - ETA: 3s
 5185536/14327744 [=========>....................] - ETA: 3s
 5382144/14327744 [==========>...................] - ETA: 3s
 5578752/14327744 [==========>...................] - ETA: 3s
 5775360/14327744 [===========>..................] - ETA: 2s
 5971968/14327744 [===========>..................] - ETA: 2s
 6168576/14327744 [===========>..................] - ETA: 2s
 6365184/14327744 [============>.................] - ETA: 2s
 6561792/14327744 [============>.................] - ETA: 2s
 6758400/14327744 [=============>................] - ETA: 2s
 6955008/14327744 [=============>................] - ETA: 2s
 7151616/14327744 [=============>................] - ETA: 2s
 7348224/14327744 [==============>...............] - ETA: 2s
 7544832/14327744 [==============>...............] - ETA: 2s
 7741440/14327744 [===============>..............] - ETA: 2s
 7938048/14327744 [===============>..............] - ETA: 2s
 8134656/14327744 [================>.............] - ETA: 2s
 8331264/14327744 [================>.............] - ETA: 1s
 8527872/14327744 [================>.............] - ETA: 1s
 8724480/14327744 [=================>............] - ETA: 1s
 8921088/14327744 [=================>............] - ETA: 1s
 9117696/14327744 [==================>...........] - ETA: 1s
 9314304/14327744 [==================>...........] - ETA: 1s
 9510912/14327744 [==================>...........] - ETA: 1s
 9707520/14327744 [===================>..........] - ETA: 1s
 9904128/14327744 [===================>..........] - ETA: 1s
10100736/14327744 [====================>.........] - ETA: 1s
10297344/14327744 [====================>.........] - ETA: 1s
10493952/14327744 [====================>.........] - ETA: 1s
10690560/14327744 [=====================>........] - ETA: 1s
10887168/14327744 [=====================>........] - ETA: 1s
11075584/14327744 [======================>.......] - ETA: 1s
11214848/14327744 [======================>.......] - ETA: 1s
11411456/14327744 [======================>.......] - ETA: 0s
11608064/14327744 [=======================>......] - ETA: 0s
11804672/14327744 [=======================>......] - ETA: 0s
12001280/14327744 [========================>.....] - ETA: 0s
12197888/14327744 [========================>.....] - ETA: 0s
12394496/14327744 [========================>.....] - ETA: 0s
12591104/14327744 [=========================>....] - ETA: 0s
12787712/14327744 [=========================>....] - ETA: 0s
12984320/14327744 [==========================>...] - ETA: 0s
13115392/14327744 [==========================>...] - ETA: 0s
13312000/14327744 [==========================>...] - ETA: 0s
13377536/14327744 [===========================>..] - ETA: 0s
13574144/14327744 [===========================>..] - ETA: 0s
13770752/14327744 [===========================>..] - ETA: 0s
13967360/14327744 [============================>.] - ETA: 0s
14163968/14327744 [============================>.] - ETA: 0s
14327808/14327744 [==============================] - 5s 0us/step

14336000/14327744 [==============================] - 5s 0us/step
car 0.4333
person 0.3427
mAP: 0.3880
Keras inference on 100 images took 4.16 s.

6. Conversion to Akida

6.1 Convert to Akida model

Check model compatibility before akida conversion

from cnn2snn import check_model_compatibility

compat = check_model_compatibility(model_keras, False)

Out:

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

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

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

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

from cnn2snn import convert

model_akida = convert(compatible_model)
model_akida.summary()

Out:

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

              SW/conv_0-detection_layer (Software)
_________________________________________________________________
Layer (type)                 Output shape    Kernel shape
=================================================================
conv_0 (InputConv.)          [112, 112, 16]  (3, 3, 3, 16)
_________________________________________________________________
conv_1 (Conv.)               [112, 112, 32]  (3, 3, 16, 32)
_________________________________________________________________
conv_2 (Conv.)               [56, 56, 64]    (3, 3, 32, 64)
_________________________________________________________________
conv_3 (Conv.)               [56, 56, 64]    (3, 3, 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.3476
person 0.3376
mAP: 0.3426
Akida inference on 100 images took 14.42 s.

6.2 Show predictions for a random image

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

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

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

input_shape = model_akida.layers[0].input_dims

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

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

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

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

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

# 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 runtime')
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 5 voc yolo detection

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

Gallery generated by Sphinx-Gallery