Manipulate run-length-encoded image masks
Project description
RLEMaskLib: Run-Length Encoded Mask Operations
This library provides efficient run-length encoded (RLE) operations for binary masks in Python. It is designed to be fast and memory efficient, and is particularly useful for working with large datasets. The library provides an intuitive and extensive object-oriented interface as well as a simpler functional one. To achieve high efficiency, the core functionality is implemented in C, and wrapped via Cython.
RLEMaskLib is fully compatible with the COCO mask format (in the form of dictionaries) but can also work directly with runlength sequences.
The library provides many operations on masks, including:
- Set operations (complement, difference, symmetric difference) and custom boolean functions.
- Crop, pad, tile, concatenate
- Connected components extraction
- Warp (affine, perspective, lens distortion)
- Transpose, flip, rotate by multiples of 90 degrees
- Binary morphology: dilate, erode, open, close
- Convolve with arbitrary kernels
- Directly create fully foreground and fully background masks
- Decompress of COCO's compressed RLE format to integer run-lengths, and vice versa
- Extra compression (optional) using gzip on top of the LEB128-like encoding used by the COCO API (~40% reduction beyond the COCO compression)
- Object-oriented and functional APIs.
This library originates as a fork of the COCO API's pycocotools.mask module (which was originally written by Piotr Dollár and Tsung-Yi Lin) but now mostly consists of new code.
Installation
pip install rlemasklib
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file rlemasklib-0.0.0.tar.gz.
File metadata
- Download URL: rlemasklib-0.0.0.tar.gz
- Upload date:
- Size: 466.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b44faa25c55e257d997cb0a9ba59023df7d3f2ac30448d15d27550e7d6a41bd
|
|
| MD5 |
94a031bc7c663c097e0952f9d9ddeabd
|
|
| BLAKE2b-256 |
687af40461104e1525a94b15b5ac79126c9667ac9639a1a54a3c47a83fa910ae
|
Provenance
The following attestation bundles were made for rlemasklib-0.0.0.tar.gz:
Publisher:
python-publish.yml on isarandi/rlemasklib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rlemasklib-0.0.0.tar.gz -
Subject digest:
0b44faa25c55e257d997cb0a9ba59023df7d3f2ac30448d15d27550e7d6a41bd - Sigstore transparency entry: 186631727
- Sigstore integration time:
-
Permalink:
isarandi/rlemasklib@6ff752f8b005269c70155da58100433c62633c4c -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/isarandi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6ff752f8b005269c70155da58100433c62633c4c -
Trigger Event:
release
-
Statement type: