rbarman commited on
Commit
e38e2da
1 Parent(s): b4f210f

enable interaction and add debug print

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -33,14 +33,14 @@ def predict(img: np.ndarray, threshold) -> str:
33
  boxes = compiled_model([input_image])[output_layer_ir]
34
  # Remove zero only boxes.
35
  boxes = boxes[~np.all(boxes == 0, axis=1)]
36
-
37
  result = convert_result_to_image(image, resized_image, boxes, threshold=threshold, conf_labels=False)
38
 
39
  #plt.figure(figsize=(10, 6))
40
  #plt.axis("off")
41
  #plt.imshow(result)
42
- print(f'result is: {type(result)}')
43
- print(result.shape)
44
  #print(result)
45
 
46
  result_fp = 'temp_result.jpg'
@@ -107,7 +107,7 @@ enable_queue=True
107
  gr.Interface(
108
  fn=predict,
109
  inputs=[
110
- gr.inputs.Image(),
111
  gr.Slider(minimum=0, maximum=1, value=.3)
112
  ],
113
  outputs=gr.outputs.Image(type='filepath'),
 
33
  boxes = compiled_model([input_image])[output_layer_ir]
34
  # Remove zero only boxes.
35
  boxes = boxes[~np.all(boxes == 0, axis=1)]
36
+ print(f'detected {len(boxes)} things')
37
  result = convert_result_to_image(image, resized_image, boxes, threshold=threshold, conf_labels=False)
38
 
39
  #plt.figure(figsize=(10, 6))
40
  #plt.axis("off")
41
  #plt.imshow(result)
42
+ #print(f'result is: {type(result)}')
43
+ #print(result.shape)
44
  #print(result)
45
 
46
  result_fp = 'temp_result.jpg'
 
107
  gr.Interface(
108
  fn=predict,
109
  inputs=[
110
+ gr.inputs.Image(interactive=True),
111
  gr.Slider(minimum=0, maximum=1, value=.3)
112
  ],
113
  outputs=gr.outputs.Image(type='filepath'),