Skip to content

Commit

Permalink
extra inf arguments + release v1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Koldim2001 committed Jun 27, 2024
1 parent cb7710f commit b7d0ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions patched_yolo_infer/functions_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def visualize_results_usual_yolo_inference(
show_confidences=False,
axis_off=True,
show_classes_list=[],
return_image_array=False
return_image_array=False,
inference_extra_args=None,
):
"""
Visualizes the results of usual YOLOv8 or YOLOv8-seg inference on an image
Expand All @@ -54,6 +55,7 @@ def visualize_results_usual_yolo_inference(
show_confidences (bool): If True and show_class=True, confidences near class are visualized.
axis_off (bool): If True, axis is turned off in the final visualization.
show_classes_list (list): If empty, visualize all classes. Otherwise, visualize only classes in the list.
inference_extra_args (dict/None): Dictionary with extra ultralytics inference parameters.
return_image_array (bool): If True, the function returns the image bgr array instead of displaying it.
Default is False.
Expand All @@ -62,7 +64,8 @@ def visualize_results_usual_yolo_inference(
"""

# Perform inference
predictions = model.predict(img, imgsz=imgsz, conf=conf, iou=iou, verbose=False)
extra_args = {} if inference_extra_args is None else inference_extra_args
predictions = model.predict(img, imgsz=imgsz, conf=conf, iou=iou, verbose=False, **extra_args)

labeled_image = img.copy()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
long_description = "\n" + fh.read()


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

setup(
Expand Down

0 comments on commit b7d0ffd

Please sign in to comment.