Skip to content

Commit

Permalink
inference_extra_args
Browse files Browse the repository at this point in the history
  • Loading branch information
Koldim2001 committed Jun 8, 2024
1 parent c5c4b5d commit 628bd95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Class implementing cropping and passing crops through a neural network for detec
| show_crops | bool | False | Whether to visualize the cropping. |
| resize_initial_size | bool | False | Whether to resize the results to the original input image size (ps: slow operation). |
| memory_optimize | bool | True | Memory optimization option for segmentation (less accurate results when enabled). |
| 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) |


**CombineDetections**
Expand Down
1 change: 1 addition & 0 deletions patched_yolo_infer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Class implementing cropping and passing crops through a neural network for detec
- **show_crops** (*bool*): Whether to visualize the cropping.
- **resize_initial_size** (*bool*): Whether to resize the results to the original image size (ps: slow operation).
- **memory_optimize** (*bool*): Memory optimization option for segmentation (less accurate results when enabled).
- **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)

**CombineDetections**
Class implementing combining masks/boxes from multiple crops + NMS (Non-Maximum Suppression).\
Expand Down
6 changes: 3 additions & 3 deletions patched_yolo_infer/nodes/MakeCropsDetectThem.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class MakeCropsDetectThem:
image size (ps: slow operation).
class_names_dict (dict): Dictionary containing class names of the YOLO model.
memory_optimize (bool): Memory optimization option for segmentation (less accurate results)
inference_extra_args (dict): Dictionary with extra ultralytics inference parameters
"""

def __init__(
self,
image: np.ndarray,
Expand Down Expand Up @@ -89,8 +89,8 @@ def __init__(
self.show_crops = show_crops # Whether to visualize the cropping
self.resize_initial_size = resize_initial_size # slow operation !
self.memory_optimize = memory_optimize # memory opimization option for segmentation
self.class_names_dict = self.model.names
self.inference_extra_args = inference_extra_args
self.class_names_dict = self.model.names # dict with human-readable class names
self.inference_extra_args = inference_extra_args # dict with extra ultralytics inference parameters

self.crops = self.get_crops_xy(
self.image,
Expand Down

0 comments on commit 628bd95

Please sign in to comment.