Aleksander Bojda commited on
Commit
081f351
·
1 Parent(s): d3b23a0

Limit output image height

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -16,12 +16,12 @@ def predict(img, model_type):
16
 
17
  # Interface
18
  inputs = [
19
- "image",
20
  gr.Dropdown(["yolov5s", "yolov5m"], label="Model", value="yolov5s"),
21
  ]
22
 
23
  outputs = [
24
- "image",
25
  ]
26
 
27
  examples = [
@@ -31,5 +31,12 @@ examples = [
31
  ["examples/ex4.jpg", None],
32
  ]
33
 
34
- iface = gr.Interface(fn=predict, inputs=inputs, outputs=outputs, examples=examples, cache_examples=False)
 
 
 
 
 
 
 
35
  iface.launch()
 
16
 
17
  # Interface
18
  inputs = [
19
+ gr.Image(),
20
  gr.Dropdown(["yolov5s", "yolov5m"], label="Model", value="yolov5s"),
21
  ]
22
 
23
  outputs = [
24
+ gr.Image(elem_classes="output-image")
25
  ]
26
 
27
  examples = [
 
31
  ["examples/ex4.jpg", None],
32
  ]
33
 
34
+ css = ".output-image {height: 700px !important}"
35
+
36
+ iface = gr.Interface(fn=predict,
37
+ inputs=inputs,
38
+ outputs=outputs,
39
+ examples=examples,
40
+ cache_examples=False,
41
+ css=css)
42
  iface.launch()