Releases: Koldim2001/YOLO-Patch-Based-Inference
Python library 1.3.3 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, YOLO11, YOLO11-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.3.3
🚀MAIN UPDATES:
There is an opportunity to produce cropping into patches at different resolutions. This way, small objects can be detected when cropping into smaller patches, and large objects can be detected when cropping into larger patches. As a result, the algorithm will be able to detect a wider range of object sizes in the frame. To achieve this, the image needs to be processed multiple times through MakeCropsDetectThem with different patch parameters, and then pass the list of element_crops to the CombineDetections process. Below is an example of this approach:
An example of using this approach can be seen in this Google Colab notebook –
Python library 1.3.1 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.3.1
🚀MAIN UPDATES:
The key advancements in this version are centered around the enhanced visualization capabilities for neural network inference results. Now you can implement a color selection not only for boxes and masks, but also a color selection of the class text field. An example is shown below:
visualize_results_usual_yolo_inference(
img,
model,
conf=0.15,
iou=0.7,
segment=True,
show_classes_list=[0, 1, 2, 7],
list_of_class_colors=[(0,0,255),(0,255,0),(0,0,0),_,_,_,_,(255,0,0)],
color_class_background=[(0,0,255),(0,255,0),(0,0,0),_,_,_,_,(255,0,0)],
thickness=3,
font_scale=0.65,
show_class=True,
show_boxes=False,
)
Python library 1.3.0 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.3.0
🚀MAIN UPDATES:
There is now an option to choose between class-agnostic and not class-agnostic types of NMS, which improves quality in the case of a multi-class detection or instance segmentation task.
To efficiently process a large number of images of varying sizes and contents, manually selecting the optimal patch sizes and overlaps can be difficult. To address this, an algorithm auto_calculate_crop_values
has been developed to automatically calculate the best parameters for patches (crops).
Furthermore, enhanced default parameters for more effective patched inference have been established.
Python library 1.2.9 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.9
🚀MAIN UPDATES:
The capability to convert a list of polygons obtained from inference into a list of binary arrays using the function create_masks_from_polygons
has been added. Additionally, the ability to manually set display colors for classes in the visualization function has been introduced; previously, one could only choose to randomly generate colors for the classes. Furthermore, the algorithm has been optimized in the mask processing mode with memory_optimize=False
, which has reduced memory consumption in this mode by approximately half.
Python library 1.2.8 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.8
🚀MAIN UPDATES:
The algorithm for duplicate suppression (intelligent_sorter) has been refined. It now allows for setting the number of bins (sorter_bins) to adjust the quality of suppression. A smaller number of bins makes the NMS more dependent on object sizes rather than confidence scores.
Python library 1.2.7 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.7
🚀MAIN UPDATES:
The core advancement in the library update is the implementation of batch inference support coupled with TensorRT technology, significantly enhancing processing speed.
By enabling batch_inference=True
during the initialization of the MakeCropsDetectThem
class, fps will be improved by approximately 1.5 times. Furthermore, the library now supports any converted ultralytics detection and instance segmentation model in TensorRT format, offering an additional 1.5 times fps increase. This dual-enhancement significantly accelerates video stream processing.
Python library 1.2.6 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.6
🚀MAIN UPDATES:
Increased the processing speed of the visualize_results_usual_yolo_inference
function for the task of instance segmentation visualization, and added the ability to pass extra arguments to the inference. You can find a list of possible additional arguments in the Ultralytics documentation - here.
Python library 1.2.5 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.5
🚀MAIN UPDATES:
Possibility to pass extra arguments to the inference function was added
You can find a list of possible additional arguments in the Ultralytics documentation here.
Code example:
element_crops = MakeCropsDetectThem(
image=img,
model_path="yolov8m-seg.pt",
segment=True,
inference_extra_args={
'retina_masks': True
}
)
This feature will allow you to customize patched_yolo_infer even better for your project
Python library 1.2.4 version
This Python library simplifies SAHI-like inference for instance segmentation tasks, enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks, supporting a wide range of Ultralytics models.
The library also provides a sleek customization of the visualization of the inference results for all models, both in the standard approach (direct network run) and the unique patch-based variant.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.2.4
🚀MAIN UPDATES:
For the task of instance segmentation, we have managed to significantly speed up the inference process and resolve the issue of excessive memory load (thanks to the transition from storing binary masks of objects to storing the coordinates of approximated polygons).
Python library 1.1.2 version
This library facilitates various visualizations of inference results from ultralytics segmentation/detection models, including cropping with overlays, as well as a patch-based inference algorithm enabling the detection of small objects in images. It caters to both object detection and instance segmentation tasks.
Model Support: The library offers support for multiple ultralytics deep learning models, such as YOLOv8, YOLOv8-seg, YOLOv9, YOLOv9-seg, FastSAM, and RTDETR. Users can select from pre-trained options or utilize custom-trained models to best meet their task requirements.
pip install patched-yolo-infer==1.1.2