Skip to content

Commit b7d0ffd

Browse files
committed
extra inf arguments + release v1.2.6
1 parent cb7710f commit b7d0ffd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

patched_yolo_infer/functions_extra.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def visualize_results_usual_yolo_inference(
2727
show_confidences=False,
2828
axis_off=True,
2929
show_classes_list=[],
30-
return_image_array=False
30+
return_image_array=False,
31+
inference_extra_args=None,
3132
):
3233
"""
3334
Visualizes the results of usual YOLOv8 or YOLOv8-seg inference on an image
@@ -54,6 +55,7 @@ def visualize_results_usual_yolo_inference(
5455
show_confidences (bool): If True and show_class=True, confidences near class are visualized.
5556
axis_off (bool): If True, axis is turned off in the final visualization.
5657
show_classes_list (list): If empty, visualize all classes. Otherwise, visualize only classes in the list.
58+
inference_extra_args (dict/None): Dictionary with extra ultralytics inference parameters.
5759
return_image_array (bool): If True, the function returns the image bgr array instead of displaying it.
5860
Default is False.
5961
@@ -62,7 +64,8 @@ def visualize_results_usual_yolo_inference(
6264
"""
6365

6466
# Perform inference
65-
predictions = model.predict(img, imgsz=imgsz, conf=conf, iou=iou, verbose=False)
67+
extra_args = {} if inference_extra_args is None else inference_extra_args
68+
predictions = model.predict(img, imgsz=imgsz, conf=conf, iou=iou, verbose=False, **extra_args)
6669

6770
labeled_image = img.copy()
6871

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
long_description = "\n" + fh.read()
99

1010

11-
VERSION = '1.2.5'
11+
VERSION = '1.2.6'
1212
DESCRIPTION = '''YOLO-Patch-Based-Inference for detection/segmentation of small objects in images.'''
1313

1414
setup(

0 commit comments

Comments
 (0)