Spaces:
Runtime error
Runtime error
| #import cv2 | |
| #import numpy as np | |
| import gradio as gr | |
| inputs_image = gr.Image(type="filepath", label="Input Image") | |
| # def img_inf(img, model): | |
| # model, classes, colors = load_model() # Load the MobileNet-SSD model | |
| # image, height, width, channels = load_img(img) # Load and preprocess the image | |
| # blob, outputs = detect_objects(image, model) # Detect objects in the image | |
| # boxes, class_ids = get_box_dimensions(outputs, height, width) # Get the bounding boxes | |
| # return cv2.cvtColor(image1, cv2.COLOR_BGR2RGB) # Re | |
| def ff(ev): | |
| print(ev) | |
| interface_image = gr.Interface( | |
| fn=ff, | |
| inputs=[inputs_image], | |
| #outputs=outputs_image, | |
| title="Image Inference", | |
| description="Upload your photo and select one model and see the results!", | |
| # examples=[["sample/dog.jpg"]], | |
| cache_examples=False, | |
| ) |