Fauzan Ardhana commited on
Commit
9a8d35c
1 Parent(s): ed70bf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,12 +1,14 @@
1
  import gradio as gr
 
2
  from transformers import pipeline
3
 
4
  pipeline = pipeline(
5
- "image-classification", model="fauzanardh/anime-time-beit_classifier"
 
6
  )
7
 
8
 
9
- def classify_image(input_img):
10
  data = pipeline(input_img, top_k=4)
11
  out = {}
12
  for d in data:
@@ -20,4 +22,5 @@ demo = gr.Interface(
20
  outputs=gr.Label(label="Prediction"),
21
  )
22
 
 
23
  demo.launch()
 
1
  import gradio as gr
2
+ from PIL import Image
3
  from transformers import pipeline
4
 
5
  pipeline = pipeline(
6
+ "image-classification",
7
+ model="fauzanardh/anime-time-beit_classifier",
8
  )
9
 
10
 
11
+ def classify_image(input_img: Image.Image) -> dict:
12
  data = pipeline(input_img, top_k=4)
13
  out = {}
14
  for d in data:
 
22
  outputs=gr.Label(label="Prediction"),
23
  )
24
 
25
+ demo.queue()
26
  demo.launch()