Skip to content
mask-generation · practical Batch Sticker Queue · Alpha PNG · Polygons · OWASP CSV/JSON WASM q8 · 106.0 MB License: Apache-2.0

Practical: Batch Sticker & Alpha-Cutout Workbench

Encode a photo once with SAM ViT-Base, click multiple objects (or load starter target seeds) into an extraction queue, and extract cropped transparent .png alpha cutouts with predicted IoU, tight bounding boxes, convex-hull polygons, and OWASP formula-safe CSV / upstreamModel JSON export — 100% locally in your browser.

1 · Queue target objects & extract alpha-channel stickers

Select a starter scene, upload/drop/paste your own photo, or capture a webcam snapshot. Click objects on the photo to queue sticker seeds, or use the preset multi-object pack, then extract all masks off the main thread with a cancellable queue.

Initialising model loader…

Click any object on the photo to add a numbered sticker target pin.

Queued targets0
Extracted stickers0
Mean pred. IoU–
Total mask area–
Encode / Mean decode–
NaN / invalid0
Extracted transparent alpha cutouts (0 stickers)
Cutout Target Tier & IoU Area & Coverage BBox & Hull Decode Actions
Queue targets and press Extract queued stickers to generate transparent PNG cutouts.

See inside the code

Show the code — sam-base-client.js: renderCutoutCanvas() (tight-bbox RGBA alpha cutout)
Show the code — sam-base-core.mjs: computeMaskMetrics() (bbox, perimeter, compactness, convex hull)
Show the code — sam-base-core.mjs: escapeCsvCell() (OWASP formula-injection safe CSV)

References