lopesdri commited on
Commit
3e6e90e
·
1 Parent(s): 36fca73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -25,10 +25,7 @@ def detect(img):
25
  scores = predictions[:, 4]
26
  categories = predictions[:, 5]
27
  new_image = np.squeeze(results.render())
28
- scale_percent = 60 # percent of original size
29
- width = int(img.shape[1] * scale_percent / 100)
30
- height = int(img.shape[0] * scale_percent / 100)
31
- dim = (width, height)
32
 
33
  # resize image
34
  new_image = cv2.resize(new_image, dim, interpolation = cv2.INTER_AREA)
@@ -38,7 +35,11 @@ def detect(img):
38
 
39
 
40
 
41
- img = gr.inputs.Image(shape=(192, 192))
42
 
43
- intf = gr.Interface(fn=detect, inputs=img, outputs='image', output_width=192, output_height=192)
44
- intf.launch(inline=False)
 
 
 
 
 
25
  scores = predictions[:, 4]
26
  categories = predictions[:, 5]
27
  new_image = np.squeeze(results.render())
28
+
 
 
 
29
 
30
  # resize image
31
  new_image = cv2.resize(new_image, dim, interpolation = cv2.INTER_AREA)
 
35
 
36
 
37
 
38
+ css = ".output-image, .input-image, .image-preview {height: 600px !important}"
39
 
40
+ iface = gr.Interface(fn=detect,
41
+ inputs=gr.inputs.Image(type="numpy",),
42
+ outputs=gr.outputs.Image(type="numpy",),
43
+ css=css,
44
+ enable_queue=True)
45
+ iface.launch(debug=True, cache_examples=True)