gastonamengual's picture
update
3214141
raw
history blame contribute delete
458 Bytes
import json
import gradio
import numpy as np
from model.model import Model
def main(list_encoded_image: str):
image_array = np.array(json.loads(list_encoded_image), dtype=np.uint8)
image = Model().detect_object(data=image_array)
list_encoded_image = np.frombuffer(image, dtype=np.uint8).tolist()
return json.dumps(list_encoded_image)
gradio_interface = gradio.Interface(fn=main, inputs="text", outputs="text")
gradio_interface.launch()