23A066X commited on
Commit
1c009a3
1 Parent(s): 197e3ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -19,7 +19,7 @@ category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABE
19
 
20
 
21
  def pil_image_as_numpy_array(pilimg):
22
-
23
  img_array = tf.keras.utils.img_to_array(pilimg)
24
  img_array = np.expand_dims(img_array, axis=0)
25
  return img_array
@@ -53,13 +53,10 @@ def predict(pilimg):
53
  def predict2(image_np):
54
 
55
  results = detection_model(image_np)
56
-
57
  # different object detection models have additional results
58
  result = {key:value.numpy() for key,value in results.items()}
59
-
60
  label_id_offset = 0
61
  image_np_with_detections = image_np.copy()
62
-
63
  viz_utils.visualize_boxes_and_labels_on_image_array(
64
  image_np_with_detections[0],
65
  result['detection_boxes'][0],
@@ -71,7 +68,6 @@ def predict2(image_np):
71
  min_score_thresh=0.50,
72
  agnostic_mode=False,
73
  line_thickness=3)
74
-
75
  result_pil_img = tf.keras.utils.array_to_img(image_np_with_detections[0])
76
 
77
  return result_pil_img
 
19
 
20
 
21
  def pil_image_as_numpy_array(pilimg):
22
+
23
  img_array = tf.keras.utils.img_to_array(pilimg)
24
  img_array = np.expand_dims(img_array, axis=0)
25
  return img_array
 
53
  def predict2(image_np):
54
 
55
  results = detection_model(image_np)
 
56
  # different object detection models have additional results
57
  result = {key:value.numpy() for key,value in results.items()}
 
58
  label_id_offset = 0
59
  image_np_with_detections = image_np.copy()
 
60
  viz_utils.visualize_boxes_and_labels_on_image_array(
61
  image_np_with_detections[0],
62
  result['detection_boxes'][0],
 
68
  min_score_thresh=0.50,
69
  agnostic_mode=False,
70
  line_thickness=3)
 
71
  result_pil_img = tf.keras.utils.array_to_img(image_np_with_detections[0])
72
 
73
  return result_pil_img