Spaces:
Sleeping
Sleeping
Daniel Cerda Escobar
commited on
Commit
·
d62b128
1
Parent(s):
53b109e
Fix detection model image size
Browse files
utils.py
CHANGED
@@ -9,14 +9,15 @@ TEMP_DIR = "temp"
|
|
9 |
def sahi_yolov8m_inference(
|
10 |
image,
|
11 |
detection_model,
|
12 |
-
slice_height=
|
13 |
-
slice_width=
|
14 |
overlap_height_ratio=0.1,
|
15 |
overlap_width_ratio=0.1,
|
16 |
-
image_size=
|
17 |
postprocess_match_threshold=0.75,
|
18 |
):
|
19 |
# sliced inference
|
|
|
20 |
prediction_result = sahi.predict.get_sliced_prediction(
|
21 |
image=image,
|
22 |
detection_model=detection_model,
|
@@ -30,7 +31,7 @@ def sahi_yolov8m_inference(
|
|
30 |
image=numpy.array(image),
|
31 |
object_prediction_list=prediction_result.object_prediction_list,
|
32 |
rect_th=2,
|
33 |
-
text_size=
|
34 |
)
|
35 |
|
36 |
output = Image.fromarray(visual_result["image"])
|
|
|
9 |
def sahi_yolov8m_inference(
|
10 |
image,
|
11 |
detection_model,
|
12 |
+
slice_height=768,
|
13 |
+
slice_width=768,
|
14 |
overlap_height_ratio=0.1,
|
15 |
overlap_width_ratio=0.1,
|
16 |
+
image_size=1280,
|
17 |
postprocess_match_threshold=0.75,
|
18 |
):
|
19 |
# sliced inference
|
20 |
+
detection_model.image_size = image_size
|
21 |
prediction_result = sahi.predict.get_sliced_prediction(
|
22 |
image=image,
|
23 |
detection_model=detection_model,
|
|
|
31 |
image=numpy.array(image),
|
32 |
object_prediction_list=prediction_result.object_prediction_list,
|
33 |
rect_th=2,
|
34 |
+
text_size=2
|
35 |
)
|
36 |
|
37 |
output = Image.fromarray(visual_result["image"])
|