import gradio as gr
import numpy as np
import tensorflow as tf
from huggingface_hub import from_pretrained_keras
description = "Keras implementation for Video Vision Transformer to classify samples of medmnist"
article = "Author: Pablo RodrÃguez; Based on the keras example by Aritra Roy Gosthipaty and Ayush Thakur"
title = "Video Vision Transformer on medmnist"
def infer(x):
return model.predict(tf.expand_dims(x, axis=0))[0]
model = from_pretrained_keras("pablorodriper/vivit")
iface = gr.Interface(
fn = infer,
inputs = "video",
outputs = "number",
description = description,
title = title,
article = article
)
iface.launch()