oValach commited on
Commit
e95a171
·
verified ·
1 Parent(s): b03f2ec

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -30
app.py DELETED
@@ -1,30 +0,0 @@
1
- import gradio as gr
2
- from PIL import Image
3
- import numpy as np
4
- from TheDistanceAssessor import run, load_segformer, load_yolo
5
-
6
- def process_image(input_image):
7
- image_size = [1024, 1024]
8
- target_distances = [650, 1000, 2000]
9
- num_ys = 10
10
-
11
- PATH_model_seg = 'SegFormer_B3_1024_finetuned.pth'
12
- PATH_model_det = 'yolov8s.pt'
13
- model_seg = load_segformer(PATH_model_seg)
14
- model_det = load_yolo(PATH_model_det)
15
-
16
- output_image = run(input_image, model_seg, model_det, image_size, target_distances, num_ys=num_ys)
17
- return output_image
18
-
19
- # Create the Gradio interface
20
- iface = gr.Interface(
21
- fn=process_image, # The function to be called
22
- inputs=gr.Image(type="numpy"), # Input type auto-detects the type
23
- outputs=gr.Image(type="numpy"), # Output type
24
- title="Image Processor", # Title of the interface
25
- description="Upload an image and get a processed image as output." # Description of the interface
26
- )
27
-
28
- # Launch the interface
29
- if __name__ == "__main__":
30
- iface.launch()