RLEMaskLib 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rlemasklib-0.0.0/.github/workflows/python-publish.yml +35 -0
- rlemasklib-0.0.0/.gitignore +163 -0
- rlemasklib-0.0.0/.readthedocs.yaml +16 -0
- rlemasklib-0.0.0/LICENSE +27 -0
- rlemasklib-0.0.0/MANIFEST.in +2 -0
- rlemasklib-0.0.0/Makefile +7 -0
- rlemasklib-0.0.0/PKG-INFO +90 -0
- rlemasklib-0.0.0/README.md +35 -0
- rlemasklib-0.0.0/docs/Makefile +20 -0
- rlemasklib-0.0.0/docs/_static/styles/my_theme.css +76 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/index.rst +11 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/attribute.rst +1 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/class.rst +150 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/data.rst +42 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/exception.rst +1 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/function.rst +25 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/method.rst +25 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/module.rst +160 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/package.rst +1 -0
- rlemasklib-0.0.0/docs/_templates/autoapi/python/property.rst +25 -0
- rlemasklib-0.0.0/docs/abbrev_long.bib +207 -0
- rlemasklib-0.0.0/docs/conf.py +193 -0
- rlemasklib-0.0.0/docs/index.rst +224 -0
- rlemasklib-0.0.0/docs/make.bat +35 -0
- rlemasklib-0.0.0/docs/references.bib +9 -0
- rlemasklib-0.0.0/docs/requirements.txt +15 -0
- rlemasklib-0.0.0/pyproject.toml +76 -0
- rlemasklib-0.0.0/setup.cfg +4 -0
- rlemasklib-0.0.0/setup.py +31 -0
- rlemasklib-0.0.0/src/RLEMaskLib.egg-info/PKG-INFO +90 -0
- rlemasklib-0.0.0/src/RLEMaskLib.egg-info/SOURCES.txt +74 -0
- rlemasklib-0.0.0/src/RLEMaskLib.egg-info/dependency_links.txt +1 -0
- rlemasklib-0.0.0/src/RLEMaskLib.egg-info/requires.txt +1 -0
- rlemasklib-0.0.0/src/RLEMaskLib.egg-info/top_level.txt +1 -0
- rlemasklib-0.0.0/src/rlemasklib/__init__.py +101 -0
- rlemasklib-0.0.0/src/rlemasklib/boolfunc.py +71 -0
- rlemasklib-0.0.0/src/rlemasklib/c/basics.c +198 -0
- rlemasklib-0.0.0/src/rlemasklib/c/basics.h +71 -0
- rlemasklib-0.0.0/src/rlemasklib/c/boolfuncs.c +769 -0
- rlemasklib-0.0.0/src/rlemasklib/c/boolfuncs.h +56 -0
- rlemasklib-0.0.0/src/rlemasklib/c/connected_components.c +422 -0
- rlemasklib-0.0.0/src/rlemasklib/c/connected_components.h +21 -0
- rlemasklib-0.0.0/src/rlemasklib/c/encode_decode.c +309 -0
- rlemasklib-0.0.0/src/rlemasklib/c/encode_decode.h +17 -0
- rlemasklib-0.0.0/src/rlemasklib/c/iou_nms.c +132 -0
- rlemasklib-0.0.0/src/rlemasklib/c/iou_nms.h +8 -0
- rlemasklib-0.0.0/src/rlemasklib/c/largest_interior_rectangle.c +671 -0
- rlemasklib-0.0.0/src/rlemasklib/c/largest_interior_rectangle.h +6 -0
- rlemasklib-0.0.0/src/rlemasklib/c/minmax.h +37 -0
- rlemasklib-0.0.0/src/rlemasklib/c/misc.c +359 -0
- rlemasklib-0.0.0/src/rlemasklib/c/misc.h +10 -0
- rlemasklib-0.0.0/src/rlemasklib/c/moments.c +130 -0
- rlemasklib-0.0.0/src/rlemasklib/c/moments.h +6 -0
- rlemasklib-0.0.0/src/rlemasklib/c/pad_crop.c +704 -0
- rlemasklib-0.0.0/src/rlemasklib/c/pad_crop.h +18 -0
- rlemasklib-0.0.0/src/rlemasklib/c/shapes.c +287 -0
- rlemasklib-0.0.0/src/rlemasklib/c/shapes.h +10 -0
- rlemasklib-0.0.0/src/rlemasklib/c/single_translation_unit.c +15 -0
- rlemasklib-0.0.0/src/rlemasklib/c/transpose_flip.c +328 -0
- rlemasklib-0.0.0/src/rlemasklib/c/transpose_flip.h +33 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_affine.c +338 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_affine.h +4 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_common.c +100 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_common.h +17 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_distorted.c +647 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_distorted.h +39 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_perspective.c +388 -0
- rlemasklib-0.0.0/src/rlemasklib/c/warp_perspective.h +4 -0
- rlemasklib-0.0.0/src/rlemasklib/oop.py +2034 -0
- rlemasklib-0.0.0/src/rlemasklib/oop_cython.c +56343 -0
- rlemasklib-0.0.0/src/rlemasklib/oop_cython.pyx +857 -0
- rlemasklib-0.0.0/src/rlemasklib/rlemasklib.py +755 -0
- rlemasklib-0.0.0/src/rlemasklib/rlemasklib_cython.c +26314 -0
- rlemasklib-0.0.0/src/rlemasklib/rlemasklib_cython.pyx +476 -0
- rlemasklib-0.0.0/tests/test_functional.py +34 -0
- rlemasklib-0.0.0/tests/test_oop.py +504 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
pypi-publish:
|
|
12
|
+
name: Upload release to PyPI
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment: pypi
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
steps:
|
|
18
|
+
- name: Check out repository
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.x"
|
|
27
|
+
|
|
28
|
+
- name: Install build dependencies
|
|
29
|
+
run: python -m pip install --upgrade build
|
|
30
|
+
|
|
31
|
+
- name: Build package distribution
|
|
32
|
+
run: python -m build --sdist
|
|
33
|
+
|
|
34
|
+
- name: Publish package distributions to PyPI
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
#.idea/
|
|
161
|
+
|
|
162
|
+
src/rlemasklib/rlemasklib_cython.c
|
|
163
|
+
src/rlemasklib/oop_cython.c
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
build:
|
|
7
|
+
os: ubuntu-24.04
|
|
8
|
+
tools:
|
|
9
|
+
python: "3.10"
|
|
10
|
+
commands:
|
|
11
|
+
- python -m pip install .
|
|
12
|
+
- python -m pip install --no-cache-dir -r docs/requirements.txt
|
|
13
|
+
- python -m sphinx -E -b html docs $READTHEDOCS_OUTPUT/html
|
|
14
|
+
|
|
15
|
+
sphinx:
|
|
16
|
+
configuration: docs/conf.py
|
rlemasklib-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright (c) 2023-2025, Istvan Sarandi
|
|
2
|
+
Copyright (c) 2014, Piotr Dollar and Tsung-Yi Lin
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
16
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
17
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
18
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
19
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
20
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
21
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
23
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
+
|
|
25
|
+
The views and conclusions contained in the software and documentation are those
|
|
26
|
+
of the authors and should not be interpreted as representing official policies,
|
|
27
|
+
either expressed or implied, of the FreeBSD Project.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RLEMaskLib
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: Manipulate run-length-encoded image masks
|
|
5
|
+
Author-email: István Sárándi <istvan.sarandi@uni-tuebingen.de>
|
|
6
|
+
License: Copyright (c) 2023-2025, Istvan Sarandi
|
|
7
|
+
Copyright (c) 2014, Piotr Dollar and Tsung-Yi Lin
|
|
8
|
+
All rights reserved.
|
|
9
|
+
|
|
10
|
+
Redistribution and use in source and binary forms, with or without
|
|
11
|
+
modification, are permitted provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
14
|
+
list of conditions and the following disclaimer.
|
|
15
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
16
|
+
this list of conditions and the following disclaimer in the documentation
|
|
17
|
+
and/or other materials provided with the distribution.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
23
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
26
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
|
|
30
|
+
The views and conclusions contained in the software and documentation are those
|
|
31
|
+
of the authors and should not be interpreted as representing official policies,
|
|
32
|
+
either expressed or implied, of the FreeBSD Project.
|
|
33
|
+
Project-URL: Homepage, https://github.com/isarandi/rlemasklib
|
|
34
|
+
Project-URL: Repository, https://github.com/isarandi/rlemasklib
|
|
35
|
+
Project-URL: Documentation, https://rlemasklib.readthedocs.io/
|
|
36
|
+
Project-URL: Issues, https://github.com/isarandi/rlemasklib/issues
|
|
37
|
+
Project-URL: Changelog, https://github.com/isarandi/rlemasklib/releases
|
|
38
|
+
Project-URL: Author, https://istvansarandi.com
|
|
39
|
+
Keywords: computer-vision,cython,image-processing,segmentation,run-length-encoding,rle,image-segmentation,mask,compression-algorithm,image-mask,runlengthencoding,run-length,image-masking
|
|
40
|
+
Classifier: Development Status :: 4 - Beta
|
|
41
|
+
Classifier: Intended Audience :: Developers
|
|
42
|
+
Classifier: Intended Audience :: Science/Research
|
|
43
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
44
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
45
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
46
|
+
Classifier: Programming Language :: Python
|
|
47
|
+
Classifier: Programming Language :: C
|
|
48
|
+
Classifier: Programming Language :: Cython
|
|
49
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
50
|
+
Requires-Python: >=3.8
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
License-File: LICENSE
|
|
53
|
+
Requires-Dist: numpy
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
# RLEMaskLib: Run-Length Encoded Mask Operations
|
|
57
|
+
 
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
RLEMaskLib is fully compatible with the COCO mask format (in the form of dictionaries) but can also work directly with runlength sequences.
|
|
62
|
+
|
|
63
|
+
The library provides many operations on masks, including:
|
|
64
|
+
|
|
65
|
+
- Set operations (complement, difference, symmetric difference) and custom boolean functions.
|
|
66
|
+
- Crop, pad, tile, concatenate
|
|
67
|
+
- Connected components extraction
|
|
68
|
+
- Warp (affine, perspective, lens distortion)
|
|
69
|
+
- Transpose, flip, rotate by multiples of 90 degrees
|
|
70
|
+
- Binary morphology: dilate, erode, open, close
|
|
71
|
+
- Convolve with arbitrary kernels
|
|
72
|
+
- Directly create fully foreground and fully background masks
|
|
73
|
+
- Decompress of COCO's compressed RLE format to integer run-lengths, and vice versa
|
|
74
|
+
- Extra compression (optional) using gzip on top of the LEB128-like encoding used by the COCO API (~40% reduction beyond
|
|
75
|
+
the COCO compression)
|
|
76
|
+
- Object-oriented and functional APIs.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install rlemasklib
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
See [https://rlemasklib.readthedocs.io/](https://rlemasklib.readthedocs.io/).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# RLEMaskLib: Run-Length Encoded Mask Operations
|
|
2
|
+
 
|
|
3
|
+
|
|
4
|
+
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.
|
|
5
|
+
|
|
6
|
+
RLEMaskLib is fully compatible with the COCO mask format (in the form of dictionaries) but can also work directly with runlength sequences.
|
|
7
|
+
|
|
8
|
+
The library provides many operations on masks, including:
|
|
9
|
+
|
|
10
|
+
- Set operations (complement, difference, symmetric difference) and custom boolean functions.
|
|
11
|
+
- Crop, pad, tile, concatenate
|
|
12
|
+
- Connected components extraction
|
|
13
|
+
- Warp (affine, perspective, lens distortion)
|
|
14
|
+
- Transpose, flip, rotate by multiples of 90 degrees
|
|
15
|
+
- Binary morphology: dilate, erode, open, close
|
|
16
|
+
- Convolve with arbitrary kernels
|
|
17
|
+
- Directly create fully foreground and fully background masks
|
|
18
|
+
- Decompress of COCO's compressed RLE format to integer run-lengths, and vice versa
|
|
19
|
+
- Extra compression (optional) using gzip on top of the LEB128-like encoding used by the COCO API (~40% reduction beyond
|
|
20
|
+
the COCO compression)
|
|
21
|
+
- Object-oriented and functional APIs.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install rlemasklib
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
See [https://rlemasklib.readthedocs.io/](https://rlemasklib.readthedocs.io/).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import url("theme.css");
|
|
2
|
+
@import url("https://fonts.googleapis.com/css2?family=Mona+Sans:ital,wght@0,200..900;1,200..900&family=Geist:wght@100..900&&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Outfit:wght@100..900&display=swap");
|
|
3
|
+
|
|
4
|
+
/*@media (min-width: 960px) {
|
|
5
|
+
.bd-page-width {
|
|
6
|
+
max-width: 120rem;
|
|
7
|
+
}
|
|
8
|
+
}*/
|
|
9
|
+
|
|
10
|
+
#rtd-footer-container {
|
|
11
|
+
margin-top: 0 !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
html[data-theme="light"] {
|
|
15
|
+
--pst-color-table-row-hover-bg: #dfc6ff;
|
|
16
|
+
--pst-color-link-hover: #845818;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html[data-theme="dark"] {
|
|
20
|
+
--pst-color-table-row-hover-bg: #41296c;
|
|
21
|
+
--pst-color-inline-code: #dd8cd4;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
html[data-theme="dark"] dt:target {
|
|
26
|
+
background-color: #4f4500;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
html[data-theme="dark"] .linkcode-link {
|
|
30
|
+
color: #9090ff;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
html[data-theme="dark"] table.indextable tr.cap {
|
|
34
|
+
background-color: #464646;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
html[data-theme="dark"] a:visited {
|
|
38
|
+
color: #9E67D0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.navbar-brand .logo__title {
|
|
42
|
+
font-family: "Mona Sans", sans-serif;
|
|
43
|
+
font-size: 2.5rem;
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
font-style: normal;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:root {
|
|
49
|
+
--pst-font-family-monospace: "JetBrains Mono", monospace;
|
|
50
|
+
--pst-font-family-heading: "Mona Sans", sans-serif;
|
|
51
|
+
--pst-font-family-base: "Mona Sans", sans-serif;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
body {
|
|
55
|
+
font-weight: 450;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bd-main .bd-content .bd-article-container {
|
|
59
|
+
max-width: 100%; /* default is 60em */
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*.bd-sidebar-primary {
|
|
63
|
+
max-width: 20%;
|
|
64
|
+
}*/
|
|
65
|
+
|
|
66
|
+
/* Ensure links in code blocks are underlined */
|
|
67
|
+
.highlight a {
|
|
68
|
+
text-decoration: underline;
|
|
69
|
+
color: #394198; /* Adjust color as needed */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* For additional emphasis, change hover effect */
|
|
73
|
+
.highlight a:hover {
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
color: #9090ff;
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% extends "python/data.rst" %}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
:html_theme.sidebar_secondary.remove: true
|
|
2
|
+
|
|
3
|
+
{% if obj.display %}
|
|
4
|
+
{% if is_own_page %}
|
|
5
|
+
{{ obj.name }}
|
|
6
|
+
{{ "=" * obj.name | length }}
|
|
7
|
+
|
|
8
|
+
{% endif %}
|
|
9
|
+
{% set visible_children = obj.children|selectattr("display")|list %}
|
|
10
|
+
{% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %}
|
|
11
|
+
{% if is_own_page and own_page_children %}
|
|
12
|
+
.. toctree::
|
|
13
|
+
:hidden:
|
|
14
|
+
|
|
15
|
+
{% for child in own_page_children %}
|
|
16
|
+
{{ child.include_path }}
|
|
17
|
+
{% endfor %}
|
|
18
|
+
|
|
19
|
+
{% endif %}
|
|
20
|
+
.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.args %}({{ obj.args }}){% endif %}
|
|
21
|
+
|
|
22
|
+
{% for (args, return_annotation) in obj.overloads %}
|
|
23
|
+
{{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %}
|
|
24
|
+
|
|
25
|
+
{% endfor %}
|
|
26
|
+
{% if obj.bases %}
|
|
27
|
+
{% if "show-inheritance" in autoapi_options %}
|
|
28
|
+
|
|
29
|
+
Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %}
|
|
30
|
+
{% endif %}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
{% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %}
|
|
34
|
+
.. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }}
|
|
35
|
+
:parts: 1
|
|
36
|
+
{% if "private-members" in autoapi_options %}
|
|
37
|
+
:private-bases:
|
|
38
|
+
{% endif %}
|
|
39
|
+
|
|
40
|
+
{% endif %}
|
|
41
|
+
{% endif %}
|
|
42
|
+
{% if obj.docstring %}
|
|
43
|
+
|
|
44
|
+
{{ obj.docstring|indent(3) }}
|
|
45
|
+
{% endif %}
|
|
46
|
+
{% for obj_item in visible_children %}
|
|
47
|
+
{% if obj_item.type not in own_page_types %}
|
|
48
|
+
|
|
49
|
+
{{ obj_item.render()|indent(3) }}
|
|
50
|
+
{% endif %}
|
|
51
|
+
{% endfor %}
|
|
52
|
+
{% if is_own_page and own_page_children %}
|
|
53
|
+
{% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %}
|
|
54
|
+
{% if visible_attributes %}
|
|
55
|
+
Attributes
|
|
56
|
+
----------
|
|
57
|
+
|
|
58
|
+
.. autoapisummary::
|
|
59
|
+
|
|
60
|
+
{% for attribute in visible_attributes %}
|
|
61
|
+
{{ attribute.id }}
|
|
62
|
+
{% endfor %}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
{% endif %}
|
|
66
|
+
{% set visible_properties = own_page_children|selectattr("type", "equalto", "property")|list %}
|
|
67
|
+
{% if visible_properties %}
|
|
68
|
+
Properties
|
|
69
|
+
----------
|
|
70
|
+
|
|
71
|
+
.. autoapisummary::
|
|
72
|
+
|
|
73
|
+
{% for property in visible_properties %}
|
|
74
|
+
{{ property.id }}
|
|
75
|
+
{% endfor %}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
{% endif %}
|
|
79
|
+
{% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %}
|
|
80
|
+
{% if visible_exceptions %}
|
|
81
|
+
Exceptions
|
|
82
|
+
----------
|
|
83
|
+
|
|
84
|
+
.. autoapisummary::
|
|
85
|
+
|
|
86
|
+
{% for exception in visible_exceptions %}
|
|
87
|
+
{{ exception.id }}
|
|
88
|
+
{% endfor %}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
{% endif %}
|
|
92
|
+
{% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %}
|
|
93
|
+
{% if visible_classes %}
|
|
94
|
+
Classes
|
|
95
|
+
-------
|
|
96
|
+
|
|
97
|
+
.. autoapisummary::
|
|
98
|
+
|
|
99
|
+
{% for klass in visible_classes %}
|
|
100
|
+
{{ klass.id }}
|
|
101
|
+
{% endfor %}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
{% endif %}
|
|
105
|
+
|
|
106
|
+
{% set static_methods = own_page_children|selectattr("type", "equalto", "method")|selectattr("properties", "defined")|selectattr("properties", "equalto", ["staticmethod"])|list %}
|
|
107
|
+
{% set class_methods = own_page_children|selectattr("type", "equalto", "method")|selectattr("properties", "defined")|selectattr("properties", "equalto", ["classmethod"])|list %}
|
|
108
|
+
{% set instance_methods = own_page_children|selectattr("type", "equalto", "method")|rejectattr("properties", "equalto", ["staticmethod"])|rejectattr("properties", "equalto", ["classmethod"])|list %}
|
|
109
|
+
|
|
110
|
+
{% if instance_methods %}
|
|
111
|
+
Instance Methods
|
|
112
|
+
----------------
|
|
113
|
+
|
|
114
|
+
.. autoapisummary::
|
|
115
|
+
|
|
116
|
+
{% for method in instance_methods %}
|
|
117
|
+
{{ method.id }}
|
|
118
|
+
{% endfor %}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
{% endif %}
|
|
122
|
+
{% if class_methods %}
|
|
123
|
+
Class Methods
|
|
124
|
+
-------------
|
|
125
|
+
|
|
126
|
+
.. autoapisummary::
|
|
127
|
+
|
|
128
|
+
{% for method in class_methods %}
|
|
129
|
+
{{ method.id }}
|
|
130
|
+
{% endfor %}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
{% endif %}
|
|
134
|
+
{% if static_methods %}
|
|
135
|
+
Static Methods
|
|
136
|
+
--------------
|
|
137
|
+
|
|
138
|
+
.. autoapisummary::
|
|
139
|
+
|
|
140
|
+
{% for method in static_methods %}
|
|
141
|
+
{{ method.id }}
|
|
142
|
+
{% endfor %}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
{% endif %}
|
|
146
|
+
{% endif %}
|
|
147
|
+
{% endif %}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
.. footbibliography::
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:html_theme.sidebar_secondary.remove: true
|
|
2
|
+
|
|
3
|
+
{% if obj.display %}
|
|
4
|
+
{% if is_own_page %}
|
|
5
|
+
{{ obj.name }}
|
|
6
|
+
{{ "=" * obj.name | length }}
|
|
7
|
+
|
|
8
|
+
{% endif %}
|
|
9
|
+
.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.name }}{% endif %}
|
|
10
|
+
{% if obj.annotation is not none %}
|
|
11
|
+
|
|
12
|
+
:type: {% if obj.annotation %} {{ obj.annotation }}{% endif %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
{% if obj.value is not none %}
|
|
15
|
+
|
|
16
|
+
{% if obj.value.splitlines()|count > 1 %}
|
|
17
|
+
:value: Multiline-String
|
|
18
|
+
|
|
19
|
+
.. raw:: html
|
|
20
|
+
|
|
21
|
+
<details><summary>Show Value</summary>
|
|
22
|
+
|
|
23
|
+
.. code-block:: python
|
|
24
|
+
|
|
25
|
+
{{ obj.value|indent(width=6,blank=true) }}
|
|
26
|
+
|
|
27
|
+
.. raw:: html
|
|
28
|
+
|
|
29
|
+
</details>
|
|
30
|
+
|
|
31
|
+
{% else %}
|
|
32
|
+
:value: {{ obj.value|truncate(100) }}
|
|
33
|
+
{% endif %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
|
|
36
|
+
{% if obj.docstring %}
|
|
37
|
+
|
|
38
|
+
{{ obj.docstring|indent(3) }}
|
|
39
|
+
{% endif %}
|
|
40
|
+
{% endif %}
|
|
41
|
+
|
|
42
|
+
.. footbibliography::
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% extends "python/class.rst" %}
|