import gradio as gr import tensorflow as tf import numpy as np from huggingface_hub import from_pretrained_keras def greet(image): model = from_pretrained_keras("vahidrezanezhad/sbb_binarization") print(np.shape(image)) print(type(image)) prediction = model.predict(image.reshape(1,image.shape[0],image.shape[1],image.shape[2])) prediction = tf.squeeze(tf.round(prediction)) print(prediction.shape) #print(model.summary()) return "Hello " iface = gr.Interface(fn=greet, inputs="image", outputs="text") iface.launch()