SandraCLV's picture
Update app.py
c1a321e
raw
history blame
917 Bytes
import gradio as gr
from transformers import pipeline,WhisperProcessor, WhisperForConditionalGeneration
import torch
import librosa
import datasets
from transformers.pipelines.pt_utils import KeyDataset
from tqdm.auto import tqdm
image_to_text_model = pipeline("image-classification",model="microsoft/beit-base-patch16-224-pt22k-ft22k")
def image_to_text(input_image):
# Convertir la imagen a texto
text_output = image_to_text_model(input_image)[0]['label']
print(text_output)
#texts = transcriber(text_output)
return text_output
gr.Interface.from_pipeline(pipe,
title="22k Image Classification",
description="Object Recognition using Microsoft BEIT",
examples = [],
article = "Author: <a href=\"https://huggingface.co/rowel\">Rowel Atienza</a>",
).launch()