私的AI研究会 > TinyYolo1
TinyYolo v1 による物体検出のサンプルプログラムを解読する。
TinyYoloは「物体検出」が可能なモデルでありGoogLeNetやGenderNetなどの「画像認識」モデルは1画像に対して1つの認識しか出来ないが、「物体検出」は1画像に対して複数の認識が可能であり、認識した物体の位置や大きさも知ることができる。
Neural Compute Application Zoo (NC App Zoo) 公開のサンプルから原理を検証する。
~/ncappzoo/networks/tiny-yolo-v1/
~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1.py ~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1.py -i dog.jpg ~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1.py -i person.jpg
-i (画像ファイルのパス)
object | (日本語) |
aeroplane | 飛行機 |
bicycle | 自転車 |
bird | 鳥 |
boat | ボート |
bottle | ボトル |
bus | バス |
car | 車 |
cat | 猫 |
chair | 椅子 |
cow | 牛 |
diningtable | ダイニングテーブル |
dog | 犬 |
horse | 馬 |
motorbike | バイク |
person | 人 |
pottedplant | 植木鉢 |
sheep | 羊 |
sofa | ソファー |
train | 列車 |
tvmonitor | テレビ |
物体検出Yoloのアルゴリズムについて末尾の参考資料のサイトの記事を理解のためにまとめ直す。
・Yolo以前の物体検出は、物体領域を検出してから各領域に対して画像認識を行うというアルゴリズムが主流であったのに対し、YOLO(You Only Look Once)は物体領域検出と画像認識を同時に行うというアルゴリズムで、従来の物体検出より速く行うことが可能である。Tiny版は、小さなメモリで実行可能なモデルで、認識率よりも検出のスピードを重視している。
・物体領域検出はこのような感じで表現される。それぞれの矩形はバウンディングボックス(BB)と呼ばれていて、その領域検出の信用度が高いほど太い枠で表示されてる。
・Yolo以前のアルゴリズムでは、各BBについてCNN(Convolutional Neural Network 畳み込みニューラルネットワーク)による画像認識を行うという手法であった。CNNによる画像認識は処理時間がかかるので、できるだけ回数を減らした方が良い。
そこでYoloは、BBに関係なく画像を7×7のセルに分割し、各セル49箇所に対してのみCNN画像認識を行っている。
・BBは各セルに対して候補を2個だけに絞っている。
・各セルに対してのみCNN画像認識を行うイメージは左のようになる。
・各セルの2個のBBに対し、先ほどの画像認識の結果を融合すると左のようなイメージで成果物が得られる。
・ここまでディープラーニングを使って一気に処理される。
・このままだと非常に情報量の多い表示となる。そこで、その後プログラミングですっきりさせる処理を行う。
・閾値設定に基づき、信用度の高いところのみを抜き出し、重複箇所を消す。すると、左のような「すっきりした情報」になる。
~/ncappzoo/networks/tiny_yolo_v1 にある tiny_yolo_v1.py を参考に「tiny_yolo_v1_a.py」とコードを書き直しながら理解を進めることにする。
import sys import numpy as np import cv2 import argparse
def parse_args(): parser = argparse.ArgumentParser(description = 'Image classifier using \ Intel® Neural Compute Stick 2.' ) parser.add_argument( '--ir', metavar = 'IR_File', type=str, default = 'tiny-yolo-v1_53000.xml', help = 'Absolute path to the neural network IR xml file.') parser.add_argument( '-l', '--labels', metavar = 'LABEL_FILE', type=str, default = 'labels.txt', help='Absolute path to labels file.') parser.add_argument( '-i', '--image', metavar = 'IMAGE_FILE', type=str, default = '../../data/images/nps_chair.png', help = 'Absolute path to image file.') parser.add_argument( '--threshold', metavar = 'FLOAT', type=float, default = DETECTION_THRESHOLD, help = 'Threshold for detection.') parser.add_argument( '--iou', metavar = 'FLOAT', type=float, default = IOU_THRESHOLD, help = 'Intersection Over Union.') return parser
コマンドオプション | デフォールト設定 | 意味 |
--ir | tiny-yolo-v1_53000.xml | 学習済みIRファイル |
-l, --label | labels.txt | ラベルファイル |
-i, --image | ../../data/images/nps_chair.jpg | 入力画像ファイルパス |
--threshold | 0.1 | 表示する閾値 |
--iou | 0.25 | 重なりを許す閾値 ※ |
※ コマンドで設定できるようにソース変更
Device準備 Graph準備 Graphの割り当て 入力画像準備 推論実行 filter_objects関数 display_objects_in_gui関数 後片付け推論実行後に推論結果を表示するのではなく、filter_objects関数とdisplay_objects_in_gui関数を実行している。
さらに各セルに対して、20個のクラス確率情報がある。(図の白い部分)
20種類の画像に対するそれぞれの確率で、ほかの推論モデルと同じ。
filtered_objs = filter_objects(output.astype(np.float32), input_image.shape[1], input_image.shape[2], label_list, threshold)filter_objectsの第一引数に推論結果 outputをデータの型を float32に合わせて渡す。第二引数は入力画像の幅、第三引数には入力画像の高さを渡す。戻り値が filterd_objs に入る。
display_objects_in_gui(display_image, filtered_objs, input_image.shape[1], input_image.shape[2])「入力画像」と先程の「すっきりした情報(filterd_objs)」を使って可視化、ウィンドウが開いて画像が表示される。
# the raw number of floats returned from the inference num_inference_results = len(inference_result)main関数 のoutput はinference_resultという変数で受け取りその配列の要素数を取得する。
num_classes = len(labels) # should be 20main関数 で読み込まれたラベルファイルのデータ(20個)
# only keep boxes with probabilities greater than this probability_threshold = threshold数値が小さい程BBの表示数は増るが、ノイズも増える。
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1.py -i dog.jpg --threshold 0.001 --- ** tiny-Yolo-v1** Object identification --- 4.5.1-openvino OpenVINO inference_engine: 2.1.2021.2.0-1877-176bdf51370-releases/2021/2 Running NCS Caffe TinyYolo example... tiny_yolo_v1_a.py:372: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Tiny Yolo v1: Starting application... - Plugin: Myriad - IR File: tiny-yolo-v1_53000.xml - Input Shape: [1, 3, 448, 448] - Output Shape: [1, 1470] - Labels File: labels.txt - Image File: dog.jpg - Threshold: 0.001 - Intersection Over Union: 0.25 Displaying image with objects detected in GUI... Click in the GUI window and hit any key to exit. Found this many objects in the image: 30 - object: car is at left: 444, top: 95, right: 614, bottom: 153 - object: bicycle is at left: 105, top: 93, right: 641, bottom: 475 - object: dog is at left: 100, top: 219, right: 314, bottom: 529 - object: bicycle is at left: 242, top: 217, right: 310, bottom: 373 - object: bicycle is at left: 301, top: 204, right: 439, bottom: 358 - object: car is at left: 346, top: 93, right: 412, bottom: 129 - object: bicycle is at left: 138, top: 129, right: 392, bottom: 307 - object: dog is at left: 146, top: 292, right: 252, bottom: 448 - object: car is at left: 130, top: 101, right: 228, bottom: 159 - object: car is at left: 20, top: 59, right: 82, bottom: 143 - object: car is at left: 473, top: 92, right: 685, bottom: 256 - object: car is at left: 734, top: 106, right: 758, bottom: 162 - object: car is at left: 194, top: 88, right: 326, bottom: 148 - object: person is at left: 673, top: 152, right: 753, bottom: 398 - object: bicycle is at left: 128, top: 151, right: 226, bottom: 225 - object: car is at left: 555, top: 139, right: 659, bottom: 191 - object: chair is at left: 444, top: 310, right: 504, bottom: 402 - object: car is at left: 661, top: 99, right: 729, bottom: 143 - object: bicycle is at left: 1, top: 104, right: 31, bottom: 300 - object: bicycle is at left: 20, top: 82, right: 92, bottom: 316 - object: car is at left: 0, top: 30, right: 42, bottom: 98 - object: car is at left: 346, top: 56, right: 446, bottom: 90 - object: boat is at left: 358, top: 192, right: 422, bottom: 240 - object: chair is at left: 362, top: 333, right: 628, bottom: 537 - object: horse is at left: 26, top: 225, right: 118, bottom: 483 - object: horse is at left: 2, top: 285, right: 16, bottom: 423 - object: horse is at left: 226, top: 181, right: 294, bottom: 231 - object: aeroplane is at left: 132, top: 223, right: 200, bottom: 361 - object: bus is at left: 172, top: 489, right: 364, bottom: 549 - object: motorbike is at left: 439, top: 158, right: 515, bottom: 220 Finished.
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i dog.jpg --- ** tiny-Yolo-v1** Object identification --- 4.5.1-openvino OpenVINO inference_engine: 2.1.2021.2.0-1877-176bdf51370-releases/2021/2 Running NCS Caffe TinyYolo example... tiny_yolo_v1_a.py:372: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Tiny Yolo v1: Starting application... - Plugin: Myriad - IR File: tiny-yolo-v1_53000.xml - Input Shape: [1, 3, 448, 448] - Output Shape: [1, 1470] - Labels File: labels.txt - Image File: dog.jpg - Threshold: 0.1 - Intersection Over Union: 0.25 Displaying image with objects detected in GUI... Click in the GUI window and hit any key to exit. Found this many objects in the image: 3 - object: car is at left: 444, top: 95, right: 614, bottom: 153 - object: bicycle is at left: 105, top: 93, right: 641, bottom: 475 - object: dog is at left: 100, top: 219, right: 314, bottom: 529 Finished.
num_classes = len(labels) # should be 20 grid_size = 7 # the image is a 7x7 grid. Each box in the grid is 64x64 pixels anchor_boxes_per_grid_cell = 2 # the number of anchor boxes returned for each grid cell
# Class probabilities: # 7x7 = 49 grid cells. # 49 grid cells x 20 classes per grid cell = 980 total class probabilities class_probabilities = inference_result[0:980]
# Box confidence scores: 7x7 = 49 grid cells. "how likely the box contains an object" # 49 grid cells x 2 boxes per grid cell = 98 box scales box_confidence_scores = inference_result[980:1078]
# Box coordinates for all boxes # 98 boxes * 4 box coordinates each = 392 box_coordinates = inference_result[1078:]推論結果 inference_result から残りの要素をスライスで取得。
# These values are the class probabilities for each grid # Reshape the probabilities to 7x7x20 (980 total values) class_probabilities = np.reshape(class_probabilities, (grid_size, grid_size, num_classes)) # These values are how likely each box contains an object # Reshape the box confidence scores to 7x7x2 (98 total values) box_confidence_scores = np.reshape(box_confidence_scores, (grid_size, grid_size, anchor_boxes_per_grid_cell)) # These values are the box coordinates for each box # Reshape the boxes coordinates to 7x7x2x4 (392 total values) box_coordinates = np.reshape(box_coordinates, (grid_size, grid_size, anchor_boxes_per_grid_cell, num_coordinates))
# -------------------- Scale the box coordinates to the input image size -------------------- boxes_to_pixel_units(box_coordinates, input_image_width, input_image_height, grid_size)
# -------------------- Calculate class confidence scores -------------------- # Find the class confidence scores for each grid. # This is done by multiplying the class probabilities by the box confidence scores # Shape of class confidence scores: 7x7x2x20 (1960 values) class_confidence_scores = np.zeros((grid_size, grid_size, anchor_boxes_per_grid_cell, num_classes)) for box_index in range(anchor_boxes_per_grid_cell): # loop over boxes for class_index in range(num_classes): # loop over classifications class_confidence_scores[:,:,box_index,class_index] = np.multiply(class_probabilities[:,:,class_index], box_confidence_scores[:,:,box_index])
# -------------------- Filter object scores/coordinates/indexes >= threshold -------------------- # Find all scores that are larger than or equal to the threshold using a mask. # Array of 1960 bools: True if >= threshold. otherwise False. score_threshold_mask = np.array(class_confidence_scores>=probability_threshold, dtype='bool')
# Using the array of bools, filter all scores >= threshold filtered_scores = class_confidence_scores[score_threshold_mask]
# Get tuple of arrays of indexes from the bool array that have a >= score than the threshold # These tuple of array indexes will help to filter out our box coordinates and class indexes # tuple 0 and 1 are the coordinates of the 7x7 grid (values = 0-6) # tuple 2 is the anchor box index (values = 0-1) # tuple 3 is the class indexes (labels) (values = 0-19) box_threshold_mask = np.nonzero(score_threshold_mask) } - filtered_box_coordinates は 上記のTrueのみ(閾値以上のみ)のBB座標情報配列~ #codeprettify(){{ # Use those indexes to find the coordinates for box confidence scores >= than the threshold filtered_box_coordinates = box_coordinates[box_threshold_mask[0], box_threshold_mask[1], box_threshold_mask[2]]
# Use those indexes to find the class indexes that have a score >= threshold filtered_class_indexes = np.argmax(class_confidence_scores, axis=3)[box_threshold_mask[0], box_threshold_mask[1], box_threshold_mask[2]]
# -------------------- Sort the filtered scores/coordinates/indexes -------------------- # Sort the indexes from highest score to lowest # and then use those indexes to sort box coordinates, scores, class indexes sort_by_highest_score = np.array(np.argsort(filtered_scores))[::-1]filtered_box_coordinates は BB確率が大きい順に並べたBB座標情報配列(閾値以下は含まない)
# Sort the box coordinates, scores, and class indexes to match filtered_box_coordinates = filtered_box_coordinates[sort_by_highest_score] filtered_scores = filtered_scores[sort_by_highest_score] filtered_class_indexes = filtered_class_indexes[sort_by_highest_score]
# -------------------- Filter out duplicates -------------------- # Get mask for boxes that seem to be the same object by calculating iou (intersection over union) # these will filter out duplicate objects duplicate_box_mask = get_duplicate_box_mask(filtered_box_coordinates)
# Update the boxes, probabilities and classifications removing duplicates. filtered_box_coordinates = filtered_box_coordinates[duplicate_box_mask] filtered_scores = filtered_scores[duplicate_box_mask] filtered_class_indexes = filtered_class_indexes[duplicate_box_mask]
# -------------------- Gather the results -------------------- # Set up list and return class labels, coordinates and scores filtered_results = [] for object_index in range( len( filtered_box_coordinates ) ): filtered_results.append([ labels [ filtered_class_indexes [ object_index ] ], # label of the object filtered_box_coordinates [ object_index ] [ 0 ], # xmin (before image scaling) filtered_box_coordinates [ object_index ] [ 1 ], # ymin (before image scaling) filtered_box_coordinates [ object_index ] [ 2 ], # width (before image scaling) filtered_box_coordinates [ object_index ] [ 3 ], # height (before image scaling) filtered_scores [ object_index ] # object score ])最後にはこのリストを戻り値としてmain関数へ返す。
# Converts the boxes in box list to pixel units # assumes box_list is the output from the box output from # the tiny yolo network and is [grid_size x grid_size x 2 x 4]. def boxes_to_pixel_units(box_list, image_width, image_height, grid_size): # number of boxes per grid cell boxes_per_cell = 2 # setup some offset values to map boxes to pixels # box_offset will be [[ [0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6]] ...repeated for 7 ] box_offset = np.transpose(np.reshape(np.array([np.arange(grid_size)]*(grid_size*2)),(boxes_per_cell,grid_size, grid_size)),(1,2,0)) # adjust the box center box_list[:,:,:,0] += box_offset box_list[:,:,:,1] += np.transpose(box_offset,(1, 0, 2)) box_list[:,:,:,0:2] = box_list[:,:,:,0:2] / (grid_size * 1.0) # adjust the lengths and widths box_list[:,:,:,2] = np.multiply(box_list[:,:,:,2], box_list[:,:,:,2]) box_list[:,:,:,3] = np.multiply(box_list[:,:,:,3], box_list[:,:,:,3]) #scale the boxes to the image size in pixels box_list[:,:,:,0] *= image_width box_list[:,:,:,1] *= image_height box_list[:,:,:,2] *= image_width box_list[:,:,:,3] *= image_height
# creates a mask to remove duplicate objects (boxes) and their related probabilities and classifications # that should be considered the same object. This is determined by how similar the boxes are # based on the intersection-over-union metric. # box_list is as list of boxes (4 floats for centerX, centerY and Length and Width) def get_duplicate_box_mask(box_list): # The intersection-over-union threshold to use when determining duplicates. # objects/boxes found that are over this threshold will be # considered the same object max_iou = IOU_THRESHOLD box_mask = np.ones(len(box_list)) for i in range(len(box_list)): if box_mask[i] == 0: continue for j in range(i + 1, len(box_list)): if get_intersection_over_union(box_list[i], box_list[j]) > max_iou: box_mask[j] = 0.0 filter_iou_mask = np.array(box_mask > 0.0, dtype='bool') return filter_iou_mask
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i dog.jpg --iou 1.0 --- ** tiny-Yolo-v1** Object identification --- 4.5.1-openvino OpenVINO inference_engine: 2.1.2021.2.0-1877-176bdf51370-releases/2021/2 Running NCS Caffe TinyYolo example... tiny_yolo_v1_a.py:373: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of Inpu tInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Tiny Yolo v1: Starting application... - Plugin: Myriad - IR File: tiny-yolo-v1_53000.xml - Input Shape: [1, 3, 448, 448] - Output Shape: [1, 1470] - Labels File: labels.txt - Image File: dog.jpg - Threshold: 0.1 - Intersection Over Union: 1.0 Displaying image with objects detected in GUI... Click in the GUI window and hit any key to exit. Found this many objects in the image: 7 - object: car is at left: 444, top: 95, right: 614, bottom: 153 - object: car is at left: 484, top: 103, right: 662, bottom: 161 - object: bicycle is at left: 105, top: 93, right: 641, bottom: 475 - object: car is at left: 433, top: 85, right: 549, bottom: 139 - object: bicycle is at left: 110, top: 84, right: 464, bottom: 500 - object: car is at left: 525, top: 94, right: 627, bottom: 150 - object: dog is at left: 100, top: 219, right: 314, bottom: 529 Finished.
# Evaluate the intersection-over-union for two boxes # The intersection-over-union metric determines how close # two boxes are to being the same box. The closer the boxes # are to being the same, the closer the metric will be to 1.0 # box_1 and box_2 are arrays of 4 numbers which are the (x, y) # points that define the center of the box and the length and width of # the box. # Returns the intersection-over-union (between 0.0 and 1.0) # for the two boxes specified. def get_intersection_over_union(box_1, box_2): # one diminsion of the intersecting box intersection_dim_1 = min(box_1[0]+0.5*box_1[2],box_2[0]+0.5*box_2[2])-\ max(box_1[0]-0.5*box_1[2],box_2[0]-0.5*box_2[2]) # the other dimension of the intersecting box intersection_dim_2 = min(box_1[1]+0.5*box_1[3],box_2[1]+0.5*box_2[3])-\ max(box_1[1]-0.5*box_1[3],box_2[1]-0.5*box_2[3]) if intersection_dim_1 < 0 or intersection_dim_2 < 0 : # no intersection area intersection_area = 0 else : # intersection area is product of intersection dimensions intersection_area = intersection_dim_1*intersection_dim_2 # calculate the union area which is the area of each box added # and then we need to subtract out the intersection area since # it is counted twice (by definition it is in each box) union_area = box_1[2]*box_1[3] + box_2[2]*box_2[3] - intersection_area; # now we can return the intersection over union iou = intersection_area / union_area return iou
intersection_dim_1 = min(a, b) - max(c - d)minは小さい方、maxは大きい方を返すので、最終的には a - d。
# Displays a gui window with an image that contains # boxes and lables for found objects. will not return until # user presses a key. # source_image is the original image for the inference before it was resized or otherwise changed. # filtered_objects is a list of lists (as returned from filter_objects() # each of the inner lists represent one found object and contain # the following 6 values: # string that is network classification ie 'cat', or 'chair' etc # float value for box center X pixel location within source image # float value for box center Y pixel location within source image # float value for box width in pixels within source image # float value for box height in pixels within source image # float value that is the probability for the network classification. def display_objects_in_gui(source_image, filtered_objects, network_input_w, network_input_h): # copy image so we can draw on it. Could just draw directly on source image if not concerned about that. display_image = source_image.copy() source_image_width = source_image.shape[1] source_image_height = source_image.shape[0] x_ratio = float(source_image_width) / network_input_w y_ratio = float(source_image_height) / network_input_h
# loop through each box and draw it on the image along with a classification label print('\n Found this many objects in the image: ' + str(len(filtered_objects))) for obj_index in range(len(filtered_objects)): center_x = int(filtered_objects[obj_index][1] * x_ratio) center_y = int(filtered_objects[obj_index][2] * y_ratio) half_width = int(filtered_objects[obj_index][3] * x_ratio)//2 half_height = int(filtered_objects[obj_index][4] * y_ratio)//2 # calculate box (left, top) and (right, bottom) coordinates box_left = max(center_x - half_width, 0) box_top = max(center_y - half_height, 0) box_right = min(center_x + half_width, source_image_width) box_bottom = min(center_y + half_height, source_image_height) print(' - object: ' + YELLOW + str(filtered_objects[obj_index][0]) + NOCOLOR + ' is at left: ' + str(box_left) + ', top: ' + str(box_top) + ', right: ' + str(box_right) + ', bottom: ' + str(box_bottom)) #draw the rectangle on the image. This is hopefully around the object box_color = (0, 255, 0) # green box box_thickness = 2 cv2.rectangle(display_image, (box_left, box_top),(box_right, box_bottom), box_color, box_thickness)
# draw the classification label string just above and to the left of the rectangle label_background_color = (70, 120, 70) # greyish green background for text label_text_color = (255, 255, 255) # white text cv2.rectangle(display_image,(box_left, box_top+20),(box_right,box_top), label_background_color, -1) cv2.putText(display_image,filtered_objects[obj_index][0] + ' : %.2f' % filtered_objects[obj_index][5], (box_left+5, box_top+15), cv2.FONT_HERSHEY_SIMPLEX, 0.5, label_text_color, 1)
window_name = 'TinyYolo (hit key to exit)' cv2.imshow(window_name, display_image) cv2.moveWindow(window_name, 10, 10) while (True): raw_key = cv2.waitKey(1) # check if the window is visible, this means the user hasn't closed # the window via the X button (may only work with opencv 3.x prop_val = cv2.getWindowProperty(window_name, cv2.WND_PROP_ASPECT_RATIO) if ((raw_key != -1) or (prop_val < 0.0)): # the user hit a key or closed the window (in that order) break
前節の結果、何となくソースコードが解りかけてきたのでカメラと動画ファイルに対応してみる。
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py --- ** tiny_Yolo_v1_a ** Object identification --- 4.5.1-openvino OpenVINO inference_engine: 2.1.2021.2.0-1877-176bdf51370-releases/2021/2 Running NCS Caffe TinyYolo example... tiny_yolo_v1_a.py:366: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Tiny Yolo v1: Starting application... - Plugin: Myriad - IR File: tiny-yolo-v1_53000.xml - Input Shape: [1, 3, 448, 448] - Output Shape: [1, 1470] - Labels File: labels_jp.txt - Image File: ../../data/images/nps_chair.png - Threshold: 0.1 - Intersection Over Union: 0.25 Displaying image with objects detected in GUI... Click in the GUI window and hit any key to exit. Found this many objects in the image: 1 - object: chair is at left: 221, top: 176, right: 601, bottom: 688 Finished.
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i ./dog.jpg pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i ./person.jpg pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i ./dog.jpg --threshold 0.001
pi@raspberrypi-mas:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_b.py --- ** tiny_Yolo_v1_b ** Object identification --- 4.5.1-openvino OpenVINO inference_engine: 2.1.2021.2.0-1877-176bdf51370-releases/2021/2 Running NCS Caffe TinyYolo example... tiny_yolo_v1_b.py:368: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Tiny Yolo v1: Starting application... - Plugin: Myriad - IR File: tiny-yolo-v1_53000.xml - Input Shape: [1, 3, 448, 448] - Output Shape: [1, 1470] - Labels File: labels_jp.txt - Input File: 0 - Threshold: 0.1 - Intersection Over Union: 0.25 Finished.
pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_b.py -i ./car.mp4 pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_b.py -i ./bird.mp4 pi@raspberrypi:~/ncappzoo/networks/tiny_yolo_v1 $ python3 tiny_yolo_v1_a.py -i ./car.mp4 --iou 1.0