Antoine245 commited on
Commit
51c985c
·
1 Parent(s): f5f2a5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -9,6 +9,10 @@ def predict(image):
9
  preds = classifier(image)
10
  return {pred["label"]: round(float(pred["score"]), 4) for pred in preds}
11
 
 
 
 
 
12
  description = """
13
  """
14
 
@@ -17,8 +21,9 @@ gr.Interface(
17
  inputs=[
18
  gr.inputs.Image(label="Image to classify", type="pil"),
19
  ],
20
- clear = gr.ClearButton([inputs]),
21
  outputs=gr.outputs.Label(),
22
  title="Image Classifier",
23
  description=description
 
24
  ).launch()
 
9
  preds = classifier(image)
10
  return {pred["label"]: round(float(pred["score"]), 4) for pred in preds}
11
 
12
+ def clear():
13
+ return None, None
14
+
15
+
16
  description = """
17
  """
18
 
 
21
  inputs=[
22
  gr.inputs.Image(label="Image to classify", type="pil"),
23
  ],
24
+ clear = gr.Button("Clear"),
25
  outputs=gr.outputs.Label(),
26
  title="Image Classifier",
27
  description=description
28
+ clear.click(lambda: None, None, inputs)
29
  ).launch()