This repo is intended to run inference from a fresh clone, but not every local training artifact is checked in.
These files are included because they are required for normal inference:
| File | Needed for | Notes |
|---|---|---|
auto_icon_vectorizer/runtime/nn-seg-results/best-gated-unet.pt |
stroke/outline icon mask inference | Included model checkpoint. |
auto_icon_vectorizer/runtime/nn-seg-results/best-filled-silhouette-unet.pt |
filled icon mask inference | Included model checkpoint. |
auto_icon_vectorizer/runtime/package.json and package-lock.json |
installing the Node Potrace wrapper | Run python3 -m auto_icon_vectorizer.install_runtime after cloning. |
auto_icon_vectorizer/runtime/*.py |
feature extraction, mask cleanup, inference, tracing | Included runtime code. |
These are intentionally excluded:
| Artifact | Why it is not included | How to regenerate |
|---|---|---|
auto_icon_vectorizer/runtime/node_modules/ |
generated dependency folder | python3 -m auto_icon_vectorizer.install_runtime |
auto_icon_vectorizer/runtime/nn-seg-results/feature-cache-v2.npz |
large generated stroke training feature cache | generated automatically by train_aux_fusion_icon_segmenter.py |
auto_icon_vectorizer/runtime/nn-seg-results/filled-silhouette-feature-cache-v1.npz |
large generated filled training feature cache | generated automatically by train_filled_silhouette_segmenter.py |
auto_icon_vectorizer/runtime/truth-stress-eval/ |
local stroke-training corpus used during development | generate a public synthetic replacement with scripts/generate_public_training_corpus.py |
auto_icon_vectorizer/runtime/nn-training-corpus-v2/ |
optional extra local stroke-training corpus | optional; use your own labeled reports if needed |
| diagnostic sheets and TSV summaries | generated during local experiments | rerun the training/eval scripts |
The feature cache files are not needed for inference. They only speed up retraining by avoiding repeated feature extraction.
git clone https://github.com/jaydenbarnescs-tech/auto-icon-vectorizer.git
cd auto-icon-vectorizer
python3 -m pip install -e .
python3 -m auto_icon_vectorizer.install_runtime
python3 -m auto_icon_vectorizer.doctorIf the doctor command reports a missing native Cairo dependency, install Cairo for your platform:
# macOS
brew install cairo
# Debian/Ubuntu
sudo apt-get install libcairo2Then run a smoke test:
auto-icon-vectorizer examples/sample-ai-icon-crop.png \
--out-prefix out/sample-icon \
--json out/sample-icon.jsonThe command prints SVG to stdout and writes out/sample-icon.svg,
out/sample-icon-mask.png, out/sample-icon-source.png, and diagnostics JSON.
Normal users do not need this. Use these commands only if you want to retrain or modify the neural networks.
Training data should match the output contract used by the vectorizer:
- one cropped icon per source image
- one dominant foreground color for the whole icon
- one binary foreground mask in the truth alpha channel
- varied backgrounds that represent the generated UI images, screenshots, or mockups where the model will run
The models learn foreground/background segmentation. They do not learn separate SVG layers for multicolor logos.
The stroke branch expects a report file at:
auto_icon_vectorizer/runtime/truth-stress-eval/latest-run.json
Each report points to:
sourceCrop: RGB crop imagetruthIcon: RGBA image where alpha marks the icon maskid,icon,backgroundMode: metadata used for splits and diagnostics
Generate a public synthetic corpus:
python3 scripts/generate_public_training_corpus.py --count 240That generator draws outline icons with one foreground color over varied background families, matching the single-color icon assumption.
Then retrain:
cd auto_icon_vectorizer/runtime
python3 train_aux_fusion_icon_segmenter.py --force-featuresThis creates:
nn-seg-results/feature-cache-v2.npznn-seg-results/best-gated-unet.ptnn-seg-results/training-history.json- diagnostic PNG/TSV files
The filled branch has its own synthetic generator built into the training
script. It does not require truth-stress-eval. It also draws one foreground
color per generated filled icon, including cutout and same-color hybrid-style
cases.
cd auto_icon_vectorizer/runtime
python3 train_filled_silhouette_segmenter.py --force-featuresThis creates:
nn-seg-results/filled-silhouette-feature-cache-v1.npznn-seg-results/best-filled-silhouette-unet.ptnn-seg-results/filled-silhouette-training-history.json
Create auto_icon_vectorizer/runtime/truth-stress-eval/latest-run.json with
this shape:
{
"reports": [
{
"id": "s01-000",
"icon": "check-circle",
"backgroundMode": "ai-noisy",
"sourceCrop": "/absolute/path/to/source.png",
"truthIcon": "/absolute/path/to/truth-rgba.png"
}
]
}truthIcon should be an RGBA image. The alpha channel is treated as the ground
truth mask. Use one alpha mask for the whole icon foreground; do not encode
separate color layers.
- Run
python3 -m auto_icon_vectorizer.doctor. - If
node_modules/potraceis missing, runpython3 -m auto_icon_vectorizer.install_runtime. - Do not look for
.npzfeature caches unless retraining is requested. - Do not retrain unless the included
.ptcheckpoints are missing or the user explicitly wants a new model. - For retraining, generate or provide
truth-stress-eval/latest-run.jsonbefore runningtrain_aux_fusion_icon_segmenter.py.