Sliced Inference Support for Improved Results #468
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request supports sliced window inference to improve object detection results, especially for larger or high-resolution images. By slicing an image into smaller overlapping windows and running the detection model on each slice, we increase the chances of detecting smaller objects or objects partially visible in a single frame.
The key addition is a slicing mechanism that divides an image into smaller sections before passing it through the detection model. After detection, the predictions from each slice are merged back into the original image space. This method helps detect objects that span slice boundaries while also handling scenarios where a large object might be missed in a single inference pass on the full image.
Key Changes:
How to Use:
Results on 0.6 threshold score:
These results were achieved by using
Example Usage
python tools/infer.py \ -c configs/rtdetr/rtdetr_r101vd_6x_coco.yml \ -r /path/to/model/weights.pth \ --im-file='/path/to/image.jpg' \ --device=cuda:0 \ -s True \ -nc 35