File size: 917 Bytes
1a7973f
5eb99ac
ec574b7
5eb99ac
97efaa3
 
 
5eb99ac
c1a321e
 
fac92f6
460a57d
 
 
97efaa3
 
460a57d
d6da658
c1a321e
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()