Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waikato-datamining/simple-mask-utils
Utility functions around image segmentation masks.
https://github.com/waikato-datamining/simple-mask-utils
image-segmentation masks polygons
Last synced: about 2 months ago
JSON representation
Utility functions around image segmentation masks.
- Host: GitHub
- URL: https://github.com/waikato-datamining/simple-mask-utils
- Owner: waikato-datamining
- License: mit
- Created: 2024-06-19T22:13:54.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-19T23:35:28.000Z (6 months ago)
- Last Synced: 2024-09-23T04:18:54.677Z (3 months ago)
- Topics: image-segmentation, masks, polygons
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
# simple-mask-utils
Utility functions around image segmentation masks and turning them into polygons.## Installation
You can install the library via `pip` (or `pip3`):
```bash
pip install simple-mask-utils
```Or directly from the repo:
```bash
pip install https://github.com/waikato-datamining/simple-mask-utils.git
```## Usage
```python
from smu import mask_to_polygon, polygon_to_listsmask = ... # binary mask (0/1) or float mask (0-1)
polys = mask_to_polygon(mask) # determine polygons
for poly in polys:
px, py = polygon_to_lists(poly, swap_x_y=True, as_type="int") # get coordinates
```See also [this example](example).