This commit adds the WHITE, BLACK, RED, GREEN, and BLUE color constants
to the Color class in color.py. These constants represent
the corresponding colors in the RGB color space.
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
fix bandit rule B318: (xml-attribute-parsing) defusedxml package should be used to parse untrusted XML data
fix bandit rule B314: (xml-entity-expansion) XML entity expansion should be disabled
fix bandit rule B413: (xml-etree-parse) XML parsing library should be secure
fix bandit rule B412: (xml-lib-exploits) XML libraries should be vetted for defusedxml or lxml.vulns
fix bandit rule B410: (xml-minidom-xxe) XML minidom can be vulnerable to XML eXternal Entity attacks
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
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.
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.
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.