Spaces:
Running
Running
File size: 396 Bytes
ed59dd7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
from transformers import pipeline
detection_pipeline = pipeline("image-classification", "saltacc/anime-ai-detect")
def detect(img):
output = detection_pipeline(img)
final = {}
for d in output:
final[d["label"]] = d["score"]
return final
iface = gr.Interface(fn=detect, inputs=gr.Image(type="pil"), outputs=gr.Label(label="result"))
iface.launch()
|