SegCraft
SegCraft is a config-first semantic segmentation toolkit for training, evaluating, and running image/video prediction from the same YAML setup.
Install
From a checkout, use the same entry point on every platform. It installs a
pinned uv, creates the local environment, starts the web app, waits until it
is ready, and then opens it in your browser.
.\run.bat
./run.command # macOS
./run.sh # Linux
Run doctor, intentionally rebuild the environment with repair, or use the
Docker path with the same launcher:
./run.sh doctor
./run.sh repair
./run.sh docker
./run.sh logs
./run.sh stop
The PowerShell equivalents are .\run.ps1 doctor and .\run.ps1 docker.
Docker binds the UI only to 127.0.0.1:8000 and keeps outputs and model caches
in named volumes. An NVIDIA host can opt into GPU access with:
docker compose -f compose.yaml -f compose.nvidia.yaml up --build
For package-only use, install just the extras you need:
pip install "segcraft[torch]" # prediction/training with TorchVision
pip install "segcraft[torch,smp]" # segmentation-models-pytorch
pip install "segcraft[torch,transformers]" # Hugging Face segmentation models
pip install "segcraft[torch,transformers,video]" # video files and YouTube helpers
pip install "segcraft[web]" # FastAPI UI with video + default model backends
For development from a checkout:
uv sync --frozen --extra web --extra dev
For NVIDIA GPUs, install the CUDA-enabled PyTorch wheel that matches your system from the PyTorch install page, then run:
segcraft doctor
segcraft doctor reports the Python executable, Torch version, CUDA build,
CUDA availability, and visible GPU names. If it reports CUDA available: False,
launch SegCraft from the environment where Torch can see CUDA, or keep
runtime.device: auto so SegCraft falls back to CPU instead of failing.
CLI
segcraft validate
segcraft predict --preset cityscapes_video --local configs/local.yaml
segcraft train --preset fast_dev --local configs/local.yaml
segcraft evaluate --preset quality --local configs/local.yaml
configs/local.yaml is for machine-specific paths and is ignored by git.
Start from configs/local.example.yaml.
Web App
segcraft-web
Open http://127.0.0.1:8000. The UI accepts either a video upload or a
YouTube URL, lets you choose a preset or type a custom preset path/name, shows
job progress, shows the active Torch/CUDA runtime, and exposes downloads for
the generated outputs.
Notebooks
notebooks/01_quickstart.ipynb: video prediction demo.notebooks/02_config_and_api.ipynb: config and API basics.notebooks/03_web_app.ipynb: launching the optional FastAPI app.
Presets
SegCraft merges configs in this order:
configs/base.yaml- optional preset
- optional local config
Preset names work in the CLI, Python API, and web app:
fast_dev: tiny CPU training run.quality: longer training settings with scheduler and metrics.binary_quickstart: binary foreground/background setup.pascal_video: TorchVision PASCAL/VOC video prediction.cityscapes_video: SegFormer Cityscapes video prediction.cpu_video_demo: short Cityscapes CPU demo settings.ade20k_video: SegFormer ADE20K video prediction.smp_unet_resnet34: SMP Unet training setup.
task.num_classes controls trainable model heads. task.class_names only
controls display names; if labels are missing or do not match the model,
SegCraft falls back to class_<id> names during prediction.
Python API
from segcraft import load_config, load_config_object, list_available_presets
from segcraft.prediction import run_prediction
print(list_available_presets())
config = load_config("configs/base.yaml", preset_path="cityscapes_video")
typed = load_config_object("configs/base.yaml", preset_path="cityscapes_video")
events = []
summary = run_prediction(config, progress_callback=events.append)
Outputs
Video prediction writes:
original.mp4overlay.mp4comparison.mp4summary.json
Image-folder prediction writes masks, overlays, an optional overlay video, and the same summary metadata.
Development
pip install -e ".[web,dev]"
pytest
python -m build
twine check dist/*
Publishing uses .github/workflows/release.yml with GitHub trusted publishing.
Configure the PyPI/TestPyPI publisher for owner oney-erge, repository
SegCraft-Semantic-Segmentation, workflow release.yml, and environment
pypi. A v* tag publishes the package, container image, distribution files,
and GitHub release. A manual run can publish to TestPyPI without making a
release.
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 segcraft-0.1.5.tar.gz.
File metadata
- Download URL: segcraft-0.1.5.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7f54b6a7f8b3e9eeffbe75f9380d7afa82e0e42957c461fc2fc6f8173927d77
|
|
| MD5 |
6aa53953260e3667bf3d046703fc6e91
|
|
| BLAKE2b-256 |
0b4a3243a31c21b320d336010f88c160a48b77b34b9dbc0228ace980bb98c952
|
Provenance
The following attestation bundles were made for segcraft-0.1.5.tar.gz:
Publisher:
release.yml on oney-erge/SegCraft-Semantic-Segmentation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
segcraft-0.1.5.tar.gz -
Subject digest:
f7f54b6a7f8b3e9eeffbe75f9380d7afa82e0e42957c461fc2fc6f8173927d77 - Sigstore transparency entry: 2591271734
- Sigstore integration time:
-
Permalink:
oney-erge/SegCraft-Semantic-Segmentation@0c6a9c824747f04bd73454160b9bb812d081275c -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/oney-erge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c6a9c824747f04bd73454160b9bb812d081275c -
Trigger Event:
push
-
Statement type:
File details
Details for the file segcraft-0.1.5-py3-none-any.whl.
File metadata
- Download URL: segcraft-0.1.5-py3-none-any.whl
- Upload date:
- Size: 54.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fde8cb8c3dac577f3f1e535bb38e352d48742077ada4de48491bfbdc230d452
|
|
| MD5 |
7280014d4fcecae00cedcd33c8d2e964
|
|
| BLAKE2b-256 |
072e19be43e8d4d7166dbf69cbffd80750bc689fe3a37723af88b675fab4643e
|
Provenance
The following attestation bundles were made for segcraft-0.1.5-py3-none-any.whl:
Publisher:
release.yml on oney-erge/SegCraft-Semantic-Segmentation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
segcraft-0.1.5-py3-none-any.whl -
Subject digest:
9fde8cb8c3dac577f3f1e535bb38e352d48742077ada4de48491bfbdc230d452 - Sigstore transparency entry: 2591273538
- Sigstore integration time:
-
Permalink:
oney-erge/SegCraft-Semantic-Segmentation@0c6a9c824747f04bd73454160b9bb812d081275c -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/oney-erge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c6a9c824747f04bd73454160b9bb812d081275c -
Trigger Event:
push
-
Statement type: