Skip to content

Commit

Permalink
doc: refresh (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smirkey committed Feb 24, 2024
1 parent 7064fe3 commit 9e65b7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
Powerboxes is a package containing utility functions for transforming bounding boxes and computing metrics. It is implemented in both Python and Rust.
It shows a significant speedup over the equivalent numpy implementations in Python, or other libraries such as [shapely](https://github.com/shapely/shapely) or [torchvision](https://pytorch.org/vision/main/ops.html).

# Checkout out the documentation !

**🦀 Rust [documentation](https://docs.rs/powerboxesrs)**


**🐍 Python [documentation]("https://smirkey.github.io/powerboxes/")**

## Installation

### Python
Expand Down Expand Up @@ -35,30 +42,9 @@ area = pb.box_areas(box)
# Compute the intersection of the box with itself
intersection = pb.iou_distance(box, box)
```
### Functions available
#### Box Transformations and utilities
- `box_areas`: Compute the area of list of boxes
- `box_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 threshold
- `mask_to_boxes`: Convert a mask to a list of boxes

#### Box Metrics
- `iou_distance`: Compute the intersection over union matrix of two sets of boxes
- `parallel_iou_distance`: Compute the intersection over union matrix of two sets of boxes in parallel
- `giou_distance`: Compute the generalized intersection over union matrix of two sets of boxes
- `parallel_giou_distance`: Compute the generalized intersection over union matrix of two sets of boxes in parallel
- `tiou_distance`: Compute the tracking intersection over union matrix of two sets of boxes

#### Rotated Box Metrics
- `rotated_iou_distance`: Compute the intersection over union matrix of two sets of rotated boxes in cxcywha format
- `rotated_giou_distance`: Compute the generalized intersection over union matrix of two sets of rotated boxes in cxcywha format

#### Box NMS
- `nms`: 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.


## Use it in Rust
See the [documentation](https://docs.rs/powerboxesrs) for more details.
Here is a simple example:
```rust
use ndarray::array;
Expand Down Expand Up @@ -98,4 +84,4 @@ Torchvision vs powerboxes vs lsnms vs numpy

#### Normal image (1000x1000 pixels)

![Box NMS](./images/box_nms_normal_image.png)
![Box NMS](./images/box_nms_normal_image.png)
2 changes: 2 additions & 0 deletions bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ license = "MIT"
readme = "README.md"
authors = [{name = "Buillaume", email = "guillaume.bertrand@edhec.com"}]
description = "Utility functions to manipulate and compute metrics on boxes"
homepage = "https://smirkey.github.io/powerboxes/"
documentation = "https://smirkey.github.io/powerboxes/"
repository = "https://github.com/Smirkey/powerboxes"
version = "0.2.1"
dependencies = ["numpy"]
Expand Down

0 comments on commit 9e65b7b

Please sign in to comment.