Sa-m commited on
Commit
963fd73
·
verified ·
1 Parent(s): 9aeaee7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -29,18 +29,25 @@ def classify_image(inp):
29
  return {LABELS[i]: float(f"{prediction[0][i]:.6f}") for i in range(NUM_CLASSES)}
30
 
31
 
32
- # Gradio interface
 
 
 
 
 
 
33
  iface = gr.Interface(
34
  fn=classify_image,
35
  inputs=gr.Image(
36
  label="Input Image",
37
- sources="upload", # or "sketchpad", "webcam"
38
- type="numpy", # pass as numpy array to your function
39
- height=HEIGHT, # set display height :contentReference[oaicite:0]{index=0}
40
- width=WIDTH # set display width :contentReference[oaicite:1]{index=1}
41
  ),
42
  outputs=gr.Label(num_top_classes=4),
43
- title="Brand Logo Detection"
 
44
  )
45
 
46
  if __name__ == "__main__":
 
29
  return {LABELS[i]: float(f"{prediction[0][i]:.6f}") for i in range(NUM_CLASSES)}
30
 
31
 
32
+ example_list = [
33
+ ["Examples/Untitled.png"],
34
+ ["Examples/Untitled2.png"],
35
+ ["Examples/Untitled3.png"],
36
+ ["Examples/Untitled5.png"]
37
+ ]
38
+
39
  iface = gr.Interface(
40
  fn=classify_image,
41
  inputs=gr.Image(
42
  label="Input Image",
43
+ source="upload",
44
+ type="numpy",
45
+ height=HEIGHT,
46
+ width=WIDTH
47
  ),
48
  outputs=gr.Label(num_top_classes=4),
49
+ title="Brand Logo Detection",
50
+ examples=example_list
51
  )
52
 
53
  if __name__ == "__main__":