Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Exemplo com BLIP-2 | |
| MODEL = "Salesforce/blip2-flan-t5-xl" | |
| pipe = pipeline("image-to-text", model=MODEL) | |
| def describe_image(image): | |
| result = pipe(image) | |
| return result[0]["generated_text"] | |
| iface = gr.Interface( | |
| fn=describe_image, | |
| inputs=gr.Image(type="pil"), | |
| outputs="text", | |
| title="Teste - Visão Computacional" | |
| ) | |
| iface.launch() | |