Generate scribble annotations from segmentation masks
Project description
Scribble From Segmentation
Generate scribble annotations from segmentation masks using advanced image processing techniques.
Overview
This tool converts segmentation masks into scribble annotations by applying morphological operations and skeletonization. It's useful for creating weak supervision labels or simplifying segmentation annotations for training purposes.
The tool:
- Processes segmentation masks and extracts individual classes
- Automatically detects and skips background classes
- Applies morphological operations to refine class boundaries
- Skeletonizes regions to create scribble-like annotations
- Preserves the original color information for each class
Installation
Install from PyPI:
pip install scribble-from-segmentation
Or install from source:
pip install -e .
Usage
Use the command-line interface to process segmentation masks:
scribble-from-segmentation --input_dir /path/to/segmentation/masks --output_dir /path/to/output/scribbles
Arguments
--input_dir(required): Path to directory containing segmentation mask images--output_dir(required): Path to directory where scribble annotations will be saved
Supported Image Formats
- PNG
- JPG/JPEG
- GIF
- BMP
- TIF
Python API
You can also use the tool directly in your Python code:
from scribble_from_segmentation import generate_scribbles_from_segmentations
# Generate scribbles from segmentation masks
generate_scribbles_from_segmentations(
input_dir="/path/to/segmentation/masks",
output_dir="/path/to/output/scribbles"
)
Requirements
- Python >= 3.8
- numpy
- opencv-python
- Pillow
- scikit-image
License
MIT License
Author
Alex Senden
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scribble_from_segmentation-0.0.1.tar.gz.
File metadata
- Download URL: scribble_from_segmentation-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cedfce8b6af2810908de25b29957b1dbc5d3051ac11eba138c83fca53ab7b41
|
|
| MD5 |
34d38ded728c8c0b2b6dd90121fe3c19
|
|
| BLAKE2b-256 |
e56c02b7891b7a8bcacaf6a5c0d939adc454b0c0a97810dc99b71c28bf086652
|
Provenance
The following attestation bundles were made for scribble_from_segmentation-0.0.1.tar.gz:
Publisher:
pypi-publish.yml on alexsenden/scribble-from-segmentation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scribble_from_segmentation-0.0.1.tar.gz -
Subject digest:
8cedfce8b6af2810908de25b29957b1dbc5d3051ac11eba138c83fca53ab7b41 - Sigstore transparency entry: 869304118
- Sigstore integration time:
-
Permalink:
alexsenden/scribble-from-segmentation@f4f42b5ce30efa4c5afe928e47f7ef7e4be61279 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/alexsenden
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@f4f42b5ce30efa4c5afe928e47f7ef7e4be61279 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scribble_from_segmentation-0.0.1-py3-none-any.whl.
File metadata
- Download URL: scribble_from_segmentation-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56728307dd66d095320c93dc81d5b5caaea7025cc59be8ef819086a48163404a
|
|
| MD5 |
e42d7b1837547ee3bc5a172445dd3335
|
|
| BLAKE2b-256 |
0653882b3f36b6145058bb7a37014422591c5b58877f056f799bbed20d4b193e
|
Provenance
The following attestation bundles were made for scribble_from_segmentation-0.0.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on alexsenden/scribble-from-segmentation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scribble_from_segmentation-0.0.1-py3-none-any.whl -
Subject digest:
56728307dd66d095320c93dc81d5b5caaea7025cc59be8ef819086a48163404a - Sigstore transparency entry: 869304121
- Sigstore integration time:
-
Permalink:
alexsenden/scribble-from-segmentation@f4f42b5ce30efa4c5afe928e47f7ef7e4be61279 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/alexsenden
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@f4f42b5ce30efa4c5afe928e47f7ef7e4be61279 -
Trigger Event:
push
-
Statement type: