RLEMaskLib


NameRLEMaskLib JSON
Version 0.3.15 PyPI version JSON
download
home_pageNone
SummaryManipulate run-length-encoded image masks
upload_time2025-10-23 18:03:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseCopyright (c) 2023-2025, Istvan Sarandi Copyright (c) 2014, Piotr Dollar and Tsung-Yi Lin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
keywords computer-vision cython image-processing segmentation run-length-encoding rle image-segmentation mask compression-algorithm image-mask runlengthencoding run-length image-masking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RLEMaskLib: Run-Length Encoded Mask Operations
![Read the Docs](https://img.shields.io/readthedocs/rlemasklib) ![PyPI - Version](https://img.shields.io/pypi/v/rlemasklib)

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](https://github.com/cocodataset/cocoapi)'s `pycocotools.mask` module (which was originally written by Piotr Dollár and Tsung-Yi Lin) but now mostly consists of new code.


## Installation

```bash
pip install rlemasklib
```

## Documentation

See [https://rlemasklib.readthedocs.io/](https://rlemasklib.readthedocs.io/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "RLEMaskLib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "computer-vision, cython, image-processing, segmentation, run-length-encoding, rle, image-segmentation, mask, compression-algorithm, image-mask, runlengthencoding, run-length, image-masking",
    "author": null,
    "author_email": "Istv\u00e1n S\u00e1r\u00e1ndi <istvan.sarandi@uni-tuebingen.de>",
    "download_url": "https://files.pythonhosted.org/packages/7d/f4/d0525d92d89fcae0b732c2ae7d6784dcbc530ceb05373d2ecf77ad6b31bc/rlemasklib-0.3.15.tar.gz",
    "platform": null,
    "description": "# RLEMaskLib: Run-Length Encoded Mask Operations\n![Read the Docs](https://img.shields.io/readthedocs/rlemasklib) ![PyPI - Version](https://img.shields.io/pypi/v/rlemasklib)\n\nThis 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.\n\nRLEMaskLib is fully compatible with the COCO mask format (in the form of dictionaries) but can also work directly with runlength sequences.\n\nThe library provides many operations on masks, including:\n\n- Set operations (complement, difference, symmetric difference) and custom boolean functions.\n- Crop, pad, tile, concatenate\n- Connected components extraction\n- Warp (affine, perspective, lens distortion)\n- Transpose, flip, rotate by multiples of 90 degrees\n- Binary morphology: dilate, erode, open, close\n- Convolve with arbitrary kernels\n- Directly create fully foreground and fully background masks\n- Decompress of COCO's compressed RLE format to integer run-lengths, and vice versa\n- Extra compression (optional) using gzip on top of the LEB128-like encoding used by the COCO API (~40% reduction beyond\n  the COCO compression)\n- Object-oriented and functional APIs.\n\n\nThis library originates as a fork of the [COCO API](https://github.com/cocodataset/cocoapi)'s `pycocotools.mask` module (which was originally written by Piotr Doll\u00e1r and Tsung-Yi Lin) but now mostly consists of new code.\n\n\n## Installation\n\n```bash\npip install rlemasklib\n```\n\n## Documentation\n\nSee [https://rlemasklib.readthedocs.io/](https://rlemasklib.readthedocs.io/).\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023-2025, Istvan Sarandi\n        Copyright (c) 2014, Piotr Dollar and Tsung-Yi Lin\n        All rights reserved.\n        \n        Redistribution and use in source and binary forms, with or without\n        modification, are permitted provided that the following conditions are met:\n        \n        1. Redistributions of source code must retain the above copyright notice, this\n           list of conditions and the following disclaimer.\n        2. Redistributions in binary form must reproduce the above copyright notice,\n           this list of conditions and the following disclaimer in the documentation\n           and/or other materials provided with the distribution.\n        \n        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n        ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n        (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n        LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n        ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n        (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n        SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n        \n        The views and conclusions contained in the software and documentation are those\n        of the authors and should not be interpreted as representing official policies,\n        either expressed or implied, of the FreeBSD Project.",
    "summary": "Manipulate run-length-encoded image masks",
    "version": "0.3.15",
    "project_urls": {
        "Author": "https://istvansarandi.com",
        "Changelog": "https://github.com/isarandi/rlemasklib/releases",
        "Documentation": "https://rlemasklib.readthedocs.io/",
        "Homepage": "https://github.com/isarandi/rlemasklib",
        "Issues": "https://github.com/isarandi/rlemasklib/issues",
        "Repository": "https://github.com/isarandi/rlemasklib"
    },
    "split_keywords": [
        "computer-vision",
        " cython",
        " image-processing",
        " segmentation",
        " run-length-encoding",
        " rle",
        " image-segmentation",
        " mask",
        " compression-algorithm",
        " image-mask",
        " runlengthencoding",
        " run-length",
        " image-masking"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7df4d0525d92d89fcae0b732c2ae7d6784dcbc530ceb05373d2ecf77ad6b31bc",
                "md5": "a6de956bc2a2692eb9cc1beee7d56842",
                "sha256": "a63c8be79d340678de7a41cb647f3d2e1711f1e955a486ee70760c105f1b6a68"
            },
            "downloads": -1,
            "filename": "rlemasklib-0.3.15.tar.gz",
            "has_sig": false,
            "md5_digest": "a6de956bc2a2692eb9cc1beee7d56842",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 477861,
            "upload_time": "2025-10-23T18:03:02",
            "upload_time_iso_8601": "2025-10-23T18:03:02.873352Z",
            "url": "https://files.pythonhosted.org/packages/7d/f4/d0525d92d89fcae0b732c2ae7d6784dcbc530ceb05373d2ecf77ad6b31bc/rlemasklib-0.3.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-23 18:03:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "isarandi",
    "github_project": "rlemasklib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rlemasklib"
}
        
Elapsed time: 1.92376s