jr98rh commited on
Commit
c1802b2
·
verified ·
1 Parent(s): 9bd4f1a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import numpy as np
3
+ import gradio as gr
4
+
5
+ inputs_image = gr.Image(type="filepath", label="Input Image")
6
+ # def img_inf(img, model):
7
+
8
+ # model, classes, colors = load_model() # Load the MobileNet-SSD model
9
+ # image, height, width, channels = load_img(img) # Load and preprocess the image
10
+ # blob, outputs = detect_objects(image, model) # Detect objects in the image
11
+ # boxes, class_ids = get_box_dimensions(outputs, height, width) # Get the bounding boxes
12
+ # return cv2.cvtColor(image1, cv2.COLOR_BGR2RGB) # Re
13
+ df ff(ev):
14
+ print(ev)
15
+ interface_image = gr.Interface(
16
+ fn=ff,
17
+ inputs=[inputs_image],
18
+ outputs=outputs_image,
19
+ title="Image Inference",
20
+ description="Upload your photo and select one model and see the results!",
21
+ # examples=[["sample/dog.jpg"]],
22
+ cache_examples=False,
23
+ )