saltacc commited on
Commit
ed59dd7
1 Parent(s): 155ecb5

Add application file

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ detection_pipeline = pipeline("image-classification", "saltacc/anime-ai-detect")
5
+
6
+
7
+ def detect(img):
8
+ output = detection_pipeline(img)
9
+ final = {}
10
+ for d in output:
11
+ final[d["label"]] = d["score"]
12
+ return final
13
+
14
+
15
+ iface = gr.Interface(fn=detect, inputs=gr.Image(type="pil"), outputs=gr.Label(label="result"))
16
+ iface.launch()