Viihtorugo
Add the files
8436dd5
raw
history blame contribute delete
507 Bytes
import gradio as gr
from transformers import pipeline
# Carregar o modelo diretamente do Hugging Face Hub
classifier = pipeline("image-classification", model="mestrevh/computer-vision-cifar-10")
# Função de classificação
def predict_image(image):
return classifier(image)
# Interface Gradio
interface = gr.Interface(fn=predict_image,
inputs=gr.inputs.Image(type="pil"),
outputs="label",
live=True)
interface.launch()