chansung commited on
Commit
b47a42c
·
1 Parent(s): 4cde037

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -50,14 +50,23 @@ def get_predictions(image):
50
  confidences = {labels[i]: float(probs[0][i]) for i in range(3)}
51
  return confidences
52
 
53
- title = "Simple demo for a Image Classification of the Beans Dataset with HF ViT model"
 
54
 
55
- demo = gr.Interface(
56
- get_predictions,
57
- gr.inputs.Image(),
58
- gr.outputs.Label(num_top_classes=3),
59
- allow_flagging="never",
60
- title=title,
61
- )
62
 
63
- demo.launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  confidences = {labels[i]: float(probs[0][i]) for i in range(3)}
51
  return confidences
52
 
53
+ with gr.Block() as demo:
54
+ gr.Markdown("## Simple demo for a Image Classification of the Beans Dataset with HF ViT model")
55
 
56
+ wb_token_if = gr.Textbox("Your Weight & Biases API Key")
 
 
 
 
 
 
57
 
58
+ with gr.Row():
59
+ image_if = gr.Image()
60
+ label_if = gr.Label()
61
+
62
+ classify_if = gr.Button()
63
+
64
+ # demo = gr.Interface(
65
+ # get_predictions,
66
+ # gr.inputs.Image(),
67
+ # gr.outputs.Label(num_top_classes=3),
68
+ # allow_flagging="never",
69
+ # title=title,
70
+ # )
71
+
72
+ demo.launch(debug=True)