Anime-Cartoon / app.py
Yuuki0's picture
Create app.py
28edf1c verified
raw
history blame contribute delete
409 Bytes
import gradio as gr
from transformers import pipeline
detection_pipeline = pipeline("image-classification", "Yuuki0/anime-cartoon-detect")
def detect(img):
output = detection_pipeline(img, top_k=2)
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()