Skip to content

Commit 628bd95

Browse files
committed
inference_extra_args
1 parent c5c4b5d commit 628bd95

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Class implementing cropping and passing crops through a neural network for detec
120120
| show_crops | bool | False | Whether to visualize the cropping. |
121121
| resize_initial_size | bool | False | Whether to resize the results to the original input image size (ps: slow operation). |
122122
| memory_optimize | bool | True | Memory optimization option for segmentation (less accurate results when enabled). |
123+
| inference_extra_args | dict | None | Dictionary with extra ultralytics [inference parameters](https://docs.ultralytics.com/modes/predict/#inference-arguments) (possible keys: half, device, max_det, augment, agnostic_nms and retina_masks) |
123124

124125

125126
**CombineDetections**

patched_yolo_infer/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Class implementing cropping and passing crops through a neural network for detec
9898
- **show_crops** (*bool*): Whether to visualize the cropping.
9999
- **resize_initial_size** (*bool*): Whether to resize the results to the original image size (ps: slow operation).
100100
- **memory_optimize** (*bool*): Memory optimization option for segmentation (less accurate results when enabled).
101+
- **inference_extra_args** (*dict*): Dictionary with extra ultralytics [inference parameters](https://docs.ultralytics.com/modes/predict/#inference-arguments) (possible keys: half, device, max_det, augment, agnostic_nms and retina_masks)
101102

102103
**CombineDetections**
103104
Class implementing combining masks/boxes from multiple crops + NMS (Non-Maximum Suppression).\

patched_yolo_infer/nodes/MakeCropsDetectThem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class MakeCropsDetectThem:
5050
image size (ps: slow operation).
5151
class_names_dict (dict): Dictionary containing class names of the YOLO model.
5252
memory_optimize (bool): Memory optimization option for segmentation (less accurate results)
53+
inference_extra_args (dict): Dictionary with extra ultralytics inference parameters
5354
"""
54-
5555
def __init__(
5656
self,
5757
image: np.ndarray,
@@ -89,8 +89,8 @@ def __init__(
8989
self.show_crops = show_crops # Whether to visualize the cropping
9090
self.resize_initial_size = resize_initial_size # slow operation !
9191
self.memory_optimize = memory_optimize # memory opimization option for segmentation
92-
self.class_names_dict = self.model.names
93-
self.inference_extra_args = inference_extra_args
92+
self.class_names_dict = self.model.names # dict with human-readable class names
93+
self.inference_extra_args = inference_extra_args # dict with extra ultralytics inference parameters
9494

9595
self.crops = self.get_crops_xy(
9696
self.image,

0 commit comments

Comments
 (0)