File size: 507 Bytes
8436dd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()