Commit Graph

116 Commits

Author SHA1 Message Date
pre-commit-ci[bot] 242ac5f7db fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-26 10:27:43 +00:00
SkalskiP e6f0ae8514 Add 'as_hex' method and corresponding test to Color class. 2023-11-26 11:25:59 +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
Onuralp SEZER b9573605c7
fix(test): 🧪 pre-commit's whitespace exclude and test case fix for whiespace
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-11-15 17:01:57 +03:00
pre-commit-ci[bot] 8025b468a2 fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-15 13:42:25 +00:00
SkalskiP d3fb4ad932 Ignoring W291 for test_file.py 2023-11-15 14:41:38 +01:00
pre-commit-ci[bot] fcfb57612f fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-15 13:37:51 +00:00
SkalskiP c28aa5aebd Updated tests to reflect changes in file content handling 2023-11-15 14:37:02 +01:00
Onuralp SEZER e8f0ceab71
fix: 🐞 test fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-11-10 22:07:47 +03:00
pre-commit-ci[bot] 08a48a4f5d fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-10 18:26:26 +00:00
SkalskiP 95f4b5c0b8 Add linting rule exceptions for test_file.py
Added linting rule exceptions for 'test/utils/test_file.py' in 'pyproject.toml'. Specifically, the 'W291' error which checks for trailing whitespace is ignored for this test file. This is necessary to test whether 'read_txt_file' function in 'test_utils.py' correctly ignores trailing whitespaces in varies test scenarios.
2023-11-10 10:25:59 -08:00
pre-commit-ci[bot] 6211139201 fix(pre_commit): 🎨 auto format pre-commit hooks 2023-11-10 18:15:39 +00:00
SkalskiP e416ef4c0e Refactor import paths and improve text file reading
Refactored import paths for test utility methods across multiple test files to align with a recent package restructure. Enriched 'read_txt_file' functionality in 'file.py' allowing to optionally skip empty lines, enhancing flexibility for various use-cases. Added tests for the new 'read_txt_file' behavior in a new 'test_file.py'. Renamed 'utils.py' in test package to 'test_utils.py' for better differentiation from the util package in the source code.
2023-11-10 10:15:08 -08: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
pre-commit-ci[bot] 476a31fa79 fix(pre_commit): 🎨 auto format pre-commit hooks 2023-10-12 17:11:59 +00:00
SkalskiP e1e455f99c Update color mapping system in detection annotations
Adjusted the way colors are applied to detection annotations to allow support for custom color schemes. Modified 'ColorMap' to 'ColorLookup' across multiple files, adding ability to use a color lookup array. This refinement will enable users to assign custom colors to different detection annotations, offering greater flexibility in visual representation of detection data. Updated related tests to reflect these changes.
2023-10-12 19:10:19 +02: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 d7a5624d60 Refactor TraceAnnotator to separate utility class 2023-10-04 15:28:00 +02: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 f7bf766a60 🧪 Test of `LabelAnnotator` alternative `annotate` method implementation. 2023-09-28 18:08:01 +02:00
pre-commit-ci[bot] 472ddd8d0e fix(pre_commit): 🎨 auto format pre-commit hooks 2023-09-21 11:35:41 +00:00
Onuralp SEZER 90b23430d2
Merge branch 'develop' into feature/redesigned_annotators
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-09-21 14:35:24 +03: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
SkalskiP 7d449abee2 🛠️ small fix 2023-08-16 13:23:10 +02:00
SkalskiP afc240e6be 🛠️ small fix 2023-08-16 13:20:58 +02:00
Mayank Agarwal 47268c893c merge develop 2023-08-16 12:44:55 +05:30
Onuralp SEZER 3d3b3e6436
Merge additonal features and changes from 'origin/develop'
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-08-07 23:23:23 +03:00
Piotr Skalski 525e1b00ec
Merge pull request #236 from hardikdava/feature/map
Feature MeanAveragePrecision 🔥
2023-08-07 10:03:33 +02:00
SkalskiP 7f4662cf3d Final changes before merge 2023-08-07 09:58:46 +02:00
SkalskiP 3a31ea2986 More small changes 2023-08-06 13:24:51 +02:00
Onuralp SEZER 21062b22a4
fix: 🐛 test_pascal_voc data format fix for pytest
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-08-02 15:35:34 +03:00
Onuralp SEZER f9d3aaa67e
fix(formatting): 🐛 merge latest code from develop for formatting
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2023-08-02 15:29:29 +03:00
Mayank Agarwal 58156fe61e rename test 2023-08-02 09:44:05 +05:30
Mayank Agarwal d170cbeda0 fix tests according to offset 2023-08-02 09:42:18 +05:30
kirilllzaitsev 6fdabf0a96 extend tests for test_detections_from_xml_obj 2023-07-31 20:10:20 +02:00
kirilllzaitsev e2d1fe7695 remove artifacts 2023-07-31 19:42:53 +02:00
kirilllzaitsev e8f616ba2f cleanup imports 2023-07-29 23:41:02 +02:00
kirilllzaitsev f8005b268b add docstrings 2023-07-29 23:39:42 +02:00
kirilllzaitsev e4ef57ec2d add test_detections_from_xml_obj 2023-07-29 23:27:33 +02:00
kirilllzaitsev 1642432541 add test_parse_polygon_points 2023-07-29 23:08:50 +02:00
kirilllzaitsev 1febd715e2 remove test_detections_to_pascal_voc. conversion to XML is tested, and approx of masks should be in another test suite 2023-07-29 22:53:24 +02:00
kirilllzaitsev a181826527 add test_object_to_pascal_voc 2023-07-28 23:13:11 +02:00
kirilllzaitsev 277a9cb6b9 import polygon_to_mask from supervision 2023-07-26 12:36:49 +02:00