acidtib commited on
Commit
554ca16
1 Parent(s): 9a668bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
- from pathlib import Path
4
 
5
  pipeline = pipeline(task="image-classification", model="acidtib/tcg-magic-cards")
6
 
@@ -10,10 +9,9 @@ def predict(input_img):
10
 
11
  gradio_app = gr.Interface(
12
  predict,
13
- inputs=gr.Image(label="Select Magic Card", type="pil"),
14
- outputs=gr.Label(label="Result", num_top_classes=2),
15
- title="TCG Magic Classifier",
16
- description='This classifier returns the id of cards from scryfall!, try one of the samples below'
17
  )
18
 
19
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  from transformers import pipeline
 
3
 
4
  pipeline = pipeline(task="image-classification", model="acidtib/tcg-magic-cards")
5
 
 
9
 
10
  gradio_app = gr.Interface(
11
  predict,
12
+ inputs=gr.Image(label="Select Magic Card", sources=['upload', 'webcam'], type="pil"),
13
+ outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
14
+ title="Magic Card",
 
15
  )
16
 
17
  if __name__ == "__main__":