How dzakyalfitra/mosaic-packed-augmentation works
Mosaic-Packed is a script for turning labeled source images into packed object mosaics with corresponding YOLO labels. The documented workflow is to provide images and labels, run the script, and retrieve paired outputs. Internally, the generation routine selects an image and label, crops and resizes an object, packs it onto a background canvas, then saves the mosaic and updated labels. The implementation is concentrated in one file; relationships shown are supported by its excerpt or the README.
Main entry points: mosaic_packed.py Mosaic builder · images Source images · labels YOLO labels · background Background images
Components 10
Input data
- Source images
sample/images - YOLO labels
sample/labels - Background images
background
Mosaic generation
- Batch runner
mosaic_packed.py - Mosaic builder
mosaic_packed.py - Label loader
mosaic_packed.py - Object cropper
mosaic_packed.py
Generated data
- Mosaic images
result/images - Updated labels
result/labels
Other components
- User
Connections 9
- User → Batch runner: runs
README.md - Batch runner → Mosaic builder: generates
mosaic_packed.py - Mosaic builder → Source images: reads
mosaic_packed.py - Mosaic builder → Label loader: loads labels
mosaic_packed.py - Label loader → YOLO labels: reads
mosaic_packed.py - Mosaic builder → Object cropper: crops objects
mosaic_packed.py - Mosaic builder → Background images: loads optionally
README.md - Mosaic builder → Mosaic images: writes mosaics
mosaic_packed.py - Mosaic builder → Updated labels: writes labels
mosaic_packed.py