April 2020
Intermediate to advanced
438 pages
12h 2m
English
Perform the following steps to implement object detection using the pretrained Faster R-CNN network in TensorFlow:
with open('models/image_info_test2017.json','r') as R: js = json.loads(R.read())labels = {i['id']:i['name'] for i in js['categories']}print(len(labels))# 80
HSV_tuples = [(x/len(labels), 0.8, 0.8) for x in range(len(labels))]colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), HSV_tuples))
img = cv2.imread('images/bus.jpg')with tf.io.gfile.GFile('models/faster_rcnn/frozen_inference_graph.pb', ...Read now
Unlock full access