only save images of persons

This commit is contained in:
blakeblackshear 2019-02-22 21:03:47 -06:00
parent 9486a321c6
commit 5258803cd7

View File

@ -63,7 +63,7 @@ def detect_objects(cropped_frame, sess, detection_graph, region_size, region_x_o
feed_dict={image_tensor: image_np_expanded})
if debug:
if len([category_index.get(value) for index,value in enumerate(classes[0]) if scores[0,index] > 0.5]) > 0:
if len([value for index,value in enumerate(classes[0]) if str(category_index.get(value)) == 'person' and scores[0,index] > 0.5]) > 0:
vis_util.visualize_boxes_and_labels_on_image_array(
cropped_frame,
np.squeeze(boxes),