Commit Graph

54 Commits

Author SHA1 Message Date
LinasKo b72ad4656b Unit tests for merge_metadata, fixes involving numpy arrays 2024-11-08 11:52:24 +02:00
Kader Miyanyedi 3c41c9721d fix: fix typos 2024-08-31 01:31:16 +03:00
pre-commit-ci[bot] 2ed2a793cd fix(pre_commit): 🎨 auto format pre-commit hooks 2024-07-10 10:15:01 +00:00
SkalskiP e0fb73f18a `xywh_to_xyxy` and `xcycwh_to_xyxy` box utils 2024-07-10 12:13:07 +02:00
LinasKo a5d4612402 Revert Detections.merge to 0.20.0, but filter out empty detections 2024-06-03 10:43:31 +02:00
Linas Kondrackis 315c4295ff Move NMS and NMM related methods from utils into overlap_handling.py 2024-05-29 16:17:20 +03:00
Piotr Skalski a0d0d45890
Merge pull request #500 from mario-dg/add_nmm_to_detections
Add Non-Maximum Merging (NMM) to Detections
2024-05-27 21:34:49 +02:00
Linas Kondrackis 2ee9e08446 Renamed to group_overlapping_boxes 2024-05-27 16:21:40 +03:00
pre-commit-ci[bot] db1b4737fe fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-23 13:04:11 +00:00
Linas Kondrackis 6fbca8333e Address review comments, simplify merge
* Reintroduced iou check before response - necessary for algorithm
2024-05-23 16:01:34 +03:00
pre-commit-ci[bot] 996b0a3af3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-21 09:43:30 +00:00
SkalskiP f2716252d5 small refactor + docs improvements 2024-05-21 11:43:09 +02:00
pre-commit-ci[bot] ab55e81087 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-20 19:41:35 +00:00
magda_sk 7b42d8381b
Merge branch 'develop' into 1114_RLE_support_for_COCO 2024-05-20 21:41:22 +02:00
magda skoczen c26eb1a70f unit tests for test_mask_has_multiple_segments 2024-05-20 19:52:48 +02:00
magda skoczen 68f07e18f3 tests for mask_has_holes 2024-05-20 19:23:22 +02:00
Linas Kondrackis 8014e88944 Test box_non_max_merge 2024-05-14 17:42:47 +03:00
pre-commit-ci[bot] 3d0c3d9182 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-10 13:08:35 +00:00
SkalskiP 2364abf481 small error message update + few more test cases for `merge_data` 2024-05-10 15:08:18 +02:00
Linas Kondrackis 8c58ebe30d Roll back flex-merge on data, merge when key missing 2024-05-09 17:06:51 +03:00
Linas Kondrackis 7bb94ce966 Detections.merge merges None and []
* Detections.merge is much friendlier now. If there's a None
  or an empty array, it will merge it happily rather than
  complaining that everything needs to be either None or [].
* Data merge follows suit.
2024-05-07 17:30:12 +03:00
pre-commit-ci[bot] dc5f841bae fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 13:06:47 +00:00
SkalskiP 64eef66b54 `get_data_item` unit tests 2024-03-28 14:04:21 +01:00
SkalskiP 824a9140b6 tests fixed 2024-02-07 09:59:58 +01:00
pre-commit-ci[bot] aaf3621841 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-03 03:10:29 +00:00
Adonai Vera 6a9c013949 Added nms for segmentation algorithm, added unit test, added init, added withnms conditional depends if contains mask 2024-02-02 21:33:15 -05:00
SkalskiP f4d2f2a900 use `CLASS_NAME_DATA_FIELD` data constant over 'class_name' string 2024-01-03 07:22:48 +01:00
pre-commit-ci[bot] d35f1888f9 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-01-02 20:02:04 +00:00
SkalskiP 706ff0fd46 initial update of `process_roboflow_result` function 2024-01-02 21:00:17 +01:00
pre-commit-ci[bot] 51694819e3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-01-02 14:05:34 +00:00
SkalskiP ced9f35b6e initial `Detections.__getitem__` implementation 2024-01-02 15:05:20 +01:00
pre-commit-ci[bot] ea21a75135 fix(pre_commit): 🎨 auto format pre-commit hooks 2023-12-29 15:37:49 +00:00
SkalskiP 95e2ad6d52 refactor of `core.py`; moving utils to `utils.py` 2023-12-29 16:36:54 +01:00
pre-commit-ci[bot] a530b2ba5e fix(pre_commit): 🎨 auto format pre-commit hooks 2023-12-06 11:20:43 +00:00
SkalskiP 7cbf16be8a Add `scale_boxes` function to detection utils
Added a new function scale_boxes to the detection utilities in order to scale the dimensions of bounding boxes. This function accepts bounding boxes and a scaling factor as input and returns the scaled bounding boxes. It can enlarge or shrink the input bounding boxes based on the value of the passed factor. The function was also documented in the utils.md file and necessary tests were added to assure its correctness.
2023-12-06 12:16:22 +01:00
SkalskiP 7750856c18 Fix method names and improve code formatting
Renamed methods to improve clarity. `get_anchor_coordinates` changed to `get_anchors_coordinates` and `calculate_centroids` changed to `calculate_masks_centroids`. Indentation for method arguments was adjusted in `core.py` and other files for better readability. Functionality remains the same, these changes are meant to improve code maintainability and readability.
2023-11-16 15:23:55 +01:00
pre-commit-ci[bot] 72ab46687f fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-16 12:59:16 +00:00
SkalskiP 50e561a4fb Add centroid calculation for binary masks
Added `calculate_centroids` function to compute center of mass for binary mask representations. Method added to `utils.py` and method import added to `core.py`. `Position` enumeration updated with `CENTER_OF_MASS` constant. Test function is added with test cases covering different mask scenarios. Update allows for masks to carry center of mass information too, useful in object detection.
2023-11-16 13:52:32 +01:00
SkalskiP ce7e3a1de4 Refactor clip_boxes function and enhance detections processing
Refactored the `clip_boxes` function for clarity by renaming arguments from `boxes_xyxy` and `frame_resolution_wh` to `xyxy` and `resolution_wh`, respectively. These change makes the function arguments more intuitive and improves code readability.

The processing of detections in `supervision/annotators/core.py` has been updated to include clipping of detection boxes to the image bounds before processing. This prevents errors and ensures detections beyond the image dimensions are handled correctly. Adjustments were also made in the test cases and in `polygon_zone.py` to match the updated `clip_boxes` function.
2023-10-31 18:04:13 +01:00
ashishdatta 6ef7bf31d3 formatting 2023-10-07 10:32:25 -07:00
ashishdatta c3a025cc9d Extending testing to support tracker_id field.
Cases covered:
empty
non-empty without tracker_id key
non-empty with tracker_id key and None value
non-empty with tracker_id key and non-None value
2023-10-07 10:27:40 -07:00
SkalskiP e911516180 Change prediction class handling from text to ids
Updated the prediction parsing logic in supervision/detection/utils.py and supervision/detection/core.py to use 'class_id' instead of 'class' names. Adapted tests in test/detection/test_utils.py accordingly to reflect the same change.
2023-10-04 10:44:49 +02:00
pre-commit-ci[bot] ed30ef68af fix(pre_commit): 🎨 auto format pre-commit hooks 2023-10-03 17:47:44 +00:00
Hardik Dava fefd273a0f removing class list from test inputs 2023-10-03 19:45:38 +02:00
SkalskiP 6d7de56c25 slicer refactor 2023-08-30 15:08:07 +02:00
pre-commit-ci[bot] b86f8ccdb8 fix(pre_commit): 🎨 auto format pre-commit hooks 2023-08-22 10:25:41 +00:00
SkalskiP 7de50e6b0b 🛠️ fix ready for merging 2023-08-22 12:23:39 +02:00
Onuralp SEZER af82b4e2d2
fix: 🐛 200+ E501 doc error lines are fixed.
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-07-25 23:09:14 +03:00
Onuralp SEZER 57e17c34a0
feat: 🚀 pre-commit and initial formatted files
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-07-25 13:02:26 +03:00
SkalskiP 453d4df068 🧪 refactor + some tests 2023-06-14 16:38:08 +02:00