kadirnar commited on
Commit
e661260
1 Parent(s): dd0f854
Files changed (1) hide show
  1. app.py +72 -72
app.py CHANGED
@@ -7,7 +7,6 @@ def image_app():
7
  with gr.Row():
8
  with gr.Column():
9
  seg_automask_image_file = gr.Image(type="filepath").style(height=260)
10
-
11
  with gr.Row():
12
  with gr.Column():
13
  seg_automask_image_model_type = gr.Dropdown(
@@ -20,26 +19,27 @@ def image_app():
20
  label="Model Type",
21
  )
22
 
23
- seg_automask_image_points_per_side = gr.Slider(
24
- minimum=0,
25
- maximum=32,
26
- step=2,
27
- value=16,
28
- label="Points per Side",
29
- )
30
-
31
- seg_automask_image_points_per_batch = gr.Slider(
32
- minimum=0,
33
- maximum=64,
34
- step=2,
35
- value=64,
36
- label="Points per Batch",
37
- )
38
-
39
  seg_automask_image_min_area = gr.Number(
40
  value=0,
41
  label="Min Area",
42
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  seg_automask_image_predict = gr.Button(value="Generator")
45
 
@@ -64,7 +64,6 @@ def video_app():
64
  with gr.Row():
65
  with gr.Column():
66
  seg_automask_video_file = gr.Video().style(height=260)
67
-
68
  with gr.Row():
69
  with gr.Column():
70
  seg_automask_video_model_type = gr.Dropdown(
@@ -76,27 +75,28 @@ def video_app():
76
  value="vit_l",
77
  label="Model Type",
78
  )
79
-
80
- seg_automask_video_points_per_side = gr.Slider(
81
- minimum=0,
82
- maximum=32,
83
- step=2,
84
- value=16,
85
- label="Points per Side",
86
- )
87
- seg_automask_video_points_per_batch = gr.Slider(
88
- minimum=0,
89
- maximum=64,
90
- step=2,
91
- value=64,
92
- label="Points per Batch",
93
  )
94
- with gr.Row():
95
- with gr.Column():
96
- seg_automask_video_min_area = gr.Number(
97
- value=1000,
98
- label="Min Area",
99
- )
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  seg_automask_video_predict = gr.Button(value="Generator")
102
  with gr.Column():
@@ -120,16 +120,25 @@ def sahi_app():
120
  with gr.Row():
121
  with gr.Column():
122
  sahi_image_file = gr.Image(type="filepath").style(height=260)
 
 
 
 
 
 
 
 
 
 
123
  with gr.Row():
124
  with gr.Column():
125
- sahi_autoseg_model_type = gr.Dropdown(
126
  choices=[
127
- "vit_h",
128
- "vit_l",
129
- "vit_b",
130
  ],
131
- value="vit_l",
132
- label="Sam Model Type",
133
  )
134
  sahi_image_size = gr.Slider(
135
  minimum=0,
@@ -152,25 +161,9 @@ def sahi_app():
152
  value=256,
153
  label="Slice Width",
154
  )
155
-
156
- sahi_overlap_height = gr.Slider(
157
- minimum=0,
158
- maximum=1,
159
- step=0.1,
160
- value=0.2,
161
- label="Overlap Height",
162
- )
163
  with gr.Row():
164
- with gr.Column():
165
- sahi_model_type = gr.Dropdown(
166
- choices=[
167
- "yolov5",
168
- "yolov8",
169
- ],
170
- value="yolov5",
171
- label="Detector Model Type",
172
- )
173
-
174
  sahi_model_path = gr.Dropdown(
175
  choices=[
176
  "yolov5l.pt",
@@ -178,16 +171,10 @@ def sahi_app():
178
  "yolov8l.pt",
179
  "yolov8x.pt"
180
  ],
181
- value="yolov5m",
182
  label="Detector Model Path",
183
  )
184
- sahi_slice_height = gr.Slider(
185
- minimum=0,
186
- maximum=640,
187
- step=32,
188
- value=256,
189
- label="Slice Height",
190
- )
191
 
192
  sahi_overlap_width = gr.Slider(
193
  minimum=0,
@@ -196,8 +183,21 @@ def sahi_app():
196
  value=0.2,
197
  label="Overlap Width",
198
  )
199
-
200
-
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  sahi_image_predict = gr.Button(value="Generator")
202
 
203
  with gr.Column():
 
7
  with gr.Row():
8
  with gr.Column():
9
  seg_automask_image_file = gr.Image(type="filepath").style(height=260)
 
10
  with gr.Row():
11
  with gr.Column():
12
  seg_automask_image_model_type = gr.Dropdown(
 
19
  label="Model Type",
20
  )
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  seg_automask_image_min_area = gr.Number(
23
  value=0,
24
  label="Min Area",
25
  )
26
+ with gr.Row():
27
+ with gr.Column():
28
+ seg_automask_image_points_per_batch = gr.Slider(
29
+ minimum=0,
30
+ maximum=64,
31
+ step=2,
32
+ value=64,
33
+ label="Points per Batch",
34
+ )
35
+ seg_automask_image_points_per_side = gr.Slider(
36
+ minimum=0,
37
+ maximum=32,
38
+ step=2,
39
+ value=16,
40
+ label="Points per Side",
41
+ )
42
+
43
 
44
  seg_automask_image_predict = gr.Button(value="Generator")
45
 
 
64
  with gr.Row():
65
  with gr.Column():
66
  seg_automask_video_file = gr.Video().style(height=260)
 
67
  with gr.Row():
68
  with gr.Column():
69
  seg_automask_video_model_type = gr.Dropdown(
 
75
  value="vit_l",
76
  label="Model Type",
77
  )
78
+ seg_automask_video_min_area = gr.Number(
79
+ value=1000,
80
+ label="Min Area",
 
 
 
 
 
 
 
 
 
 
 
81
  )
82
+
83
+ with gr.Row():
84
+ with gr.Column():
85
+ seg_automask_video_points_per_side = gr.Slider(
86
+ minimum=0,
87
+ maximum=32,
88
+ step=2,
89
+ value=16,
90
+ label="Points per Side",
91
+ )
92
+
93
+ seg_automask_video_points_per_batch = gr.Slider(
94
+ minimum=0,
95
+ maximum=64,
96
+ step=2,
97
+ value=64,
98
+ label="Points per Batch",
99
+ )
100
 
101
  seg_automask_video_predict = gr.Button(value="Generator")
102
  with gr.Column():
 
120
  with gr.Row():
121
  with gr.Column():
122
  sahi_image_file = gr.Image(type="filepath").style(height=260)
123
+ sahi_autoseg_model_type = gr.Dropdown(
124
+ choices=[
125
+ "vit_h",
126
+ "vit_l",
127
+ "vit_b",
128
+ ],
129
+ value="vit_l",
130
+ label="Sam Model Type",
131
+ )
132
+
133
  with gr.Row():
134
  with gr.Column():
135
+ sahi_model_type = gr.Dropdown(
136
  choices=[
137
+ "yolov5",
138
+ "yolov8",
 
139
  ],
140
+ value="yolov5",
141
+ label="Detector Model Type",
142
  )
143
  sahi_image_size = gr.Slider(
144
  minimum=0,
 
161
  value=256,
162
  label="Slice Width",
163
  )
164
+
 
 
 
 
 
 
 
165
  with gr.Row():
166
+ with gr.Column():
 
 
 
 
 
 
 
 
 
167
  sahi_model_path = gr.Dropdown(
168
  choices=[
169
  "yolov5l.pt",
 
171
  "yolov8l.pt",
172
  "yolov8x.pt"
173
  ],
174
+ value="yolov5l6.pt",
175
  label="Detector Model Path",
176
  )
177
+
 
 
 
 
 
 
178
 
179
  sahi_overlap_width = gr.Slider(
180
  minimum=0,
 
183
  value=0.2,
184
  label="Overlap Width",
185
  )
186
+
187
+ sahi_overlap_height = gr.Slider(
188
+ minimum=0,
189
+ maximum=1,
190
+ step=0.1,
191
+ value=0.2,
192
+ label="Overlap Height",
193
+ )
194
+ sahi_slice_height = gr.Slider(
195
+ minimum=0,
196
+ maximum=640,
197
+ step=32,
198
+ value=256,
199
+ label="Slice Height",
200
+ )
201
  sahi_image_predict = gr.Button(value="Generator")
202
 
203
  with gr.Column():