--- title: Shuffle PatchMix colorFrom: purple colorTo: red sdk: gradio sdk_version: 5.44.1 app_file: app.py pinned: false license: mit emoji: 🔥 short_description: An interactive demo for SPM augmentation. --- # Shuffle PatchMix (SPM) — Hugging Face Space An interactive demo for SPM augmentation. GitHub repo: https://github.com/PrasannaPulakurthi/SPM arxiv.org/abs/2505.24216 ## Parameters - **Grid (N×N):** Choose one of **2×2, 4×4, 8×8, 16×16**. The image is cropped (top-left) so its width and height are divisible by N. - **Enable Overlap Patch Blend):** When enabled, each base cell expands by ±overlap pixels (2× at borders to keep areas comparable) and patches are blended with a feather mask. - **Overlap (px):** Pixel overlap per side. Automatically clipped to `< 1/2 * patch size`. - **Mix probability:** Per-patch probability to mix original and a shuffled patch. - **Beta α, β:** Shape parameters for the Beta distribution used for blending weights. - **Seed:** Optional deterministic seed. ## Batch Mode Upload a `.zip` containing images (`.png`, `.jpg`, `.jpeg`). The app returns a `.zip` of augmented results with the same folder structure. ## Local Development ```bash pip install -r requirements.txt python app.py ``` ## License MIT