瀏覽代碼

just save images when a person is detected

blakeblackshear 6 年之前
父節點
當前提交
122a1666ca
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      detect_objects.py

+ 1 - 1
detect_objects.py

@@ -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([value for index,value in enumerate(classes[0]) if str(category_index.get(value)) == 'person' and scores[0,index] > 0.5]) > 0:
+        if len([value for index,value in enumerate(classes[0]) if str(category_index.get(value).get('name')) == 'person' and scores[0,index] > 0.5]) > 0:
             vis_util.visualize_boxes_and_labels_on_image_array(
                 cropped_frame,
                 np.squeeze(boxes),