| Crates.io | powerboxesrs |
| lib.rs | powerboxesrs |
| version | 0.2.3 |
| created_at | 2023-11-13 20:59:20.700578+00 |
| updated_at | 2024-05-27 20:20:35.697722+00 |
| description | Utility functions to manipulate and compute metrics on boxes |
| homepage | https://github.com/Smirkey/powerboxes |
| repository | https://github.com/Smirkey/powerboxes |
| max_upload_size | |
| id | 1034033 |
| size | 83,746 |
Powerboxes is a package containing utility functions for transforming bounding boxes and computing metrics.
cargo add powerboxesrs
box_areas: Compute the area of list of boxesbox_convert: Convert a box from one format to another. Supported formats are xyxy, xywh, cxcywh.remove_small_boxes: Remove boxes with area smaller than a thresholdmask_to_boxes: Convert a mask to a list of boxesiou_distance: Compute the intersection over union matrix of two sets of boxesparallel_iou_distance: Compute the intersection over union matrix of two sets of boxes in parallelgiou_distance: Compute the generalized intersection over union matrix of two sets of boxesparallel_giou_distance: Compute the generalized intersection over union matrix of two sets of boxes in paralleltiou_distance: Compute the tracking intersection over union matrix of two sets of boxesrotated_iou_distance: Compute the intersection over union matrix of two sets of rotated boxes in cxcywha formatrotated_giou_distance: Compute the generalized intersection over union matrix of two sets of rotated boxes in cxcywha formatnms: Non-maximum suppression, returns the indices of the boxes to keep
rtree_nms: Non-maximum suppression, returns the indices of the boxes to keep, uses a r-tree internally to avoid quadratic complexity, useful when having many boxes.
See the documentation for more details. Here is a simple example:
use ndarray::array;
use powerboxesrs::boxes::box_areas;
let boxes = array![[1., 2., 3., 4.], [0., 0., 10., 10.]];
let areas = box_areas(&boxes);
assert_eq!(areas, array![4., 100.]);