Ultimate Image Processing Toolkit by SECourses

Ultimate Image Processing Toolkit by SECourses

18 46 69
calendar_today agoschedule16 min read

Ultimate Image Processing APP Premium by SECourses : Batch Cropping, Zooming In, Resizing, Duplicate Image Removing, Face Extraction, SAM 2, SAM 3.1 and Yolo Segmentation, Masking for Windows, RunPod, Massed Compute


Installers and APP is shared here with instructions : https://www.patreon.com/posts/120352012


  • Video Tutorial : Hopefully coming soon

Batch Image Cropping, Zooming Subject, Resizing, Segmenting, Masking, Duplicate Removing APP that utilizes YOLO V26, YOLO Face V12, SAM 2, SAM 3.1 with 1-click installers for Windows, RunPod, SimplePod and Massed Compute (Linux users use this)


28 July 2026 V1.0

  • We have completey remade the app and read below to understand how it works and full features
  • Make a fresh install and read the below carefully please
  • We use latest pre-compiled wheels and Torch 2.13 and CUDA 13

image

Windows Requirements


Turn a folder of raw photos into a clean, correctly framed, ready-to-train dataset. The nine tabs are designed to feed each other: the output of one is exactly what the next expects to read.

One architectural detail matters more than any single feature: the Gradio process never has to import torch. Tick Run every task in a subprocess on the Performance tab and every job runs in a throw-away process that loads the model, does the work and exits, returning 100% of its VRAM, RAM and CUDA context the moment it finishes. A long session never creeps upwards, and the app sits at zero idle VRAM between runs. It ships off, so jobs run in-process by default and keep their models resident for faster repeated runs — turn it on when you would rather have the memory back.

Overview of all nine tabs


Contents


Requirements

  • Python 3.12.10 (3.10.x / 3.11.x / 3.13.x may also work)
  • CUDA 13.0 and cuDNN 9.17+
  • Git, FFmpeg
  • Visual Studio Community Edition with all C++ options (needed for torch.compile)
  • An NVIDIA GPU — any card works, more VRAM is better. CPU-only is supported but slow.

Setup walkthrough for the prerequisites: https://youtu.be/DrhUHnYfwC0

Installation

Windows — automatic

Run Windows_Install_or_Update.bat. It clones this repository, creates a Python 3.12 venv, installs the dependency set with uv, and then downloads every model via HF_model_downloader_img_process.py.

Re-run the same script later to update — it does a git reset --hard + git pull before reinstalling.

Manual

git clone --depth 1 https://github.com/FurkanGozukara/Ultimate_Image_Processor_Pro
cd Ultimate_Image_Processor_Pro
py -3.12 -m venv venv
call .\venv\Scripts\activate.bat
python -m pip install --upgrade pip
pip install uv
cd ..
uv pip install -r requirements_image_process.txt --index-strategy unsafe-best-match
python HF_model_downloader_img_process.py

The requirements file pins torch==2.13.0+cu130 plus prebuilt wheels for xformers, FlashAttention, SageAttention, torchao, InsightFace and SAM 2 — so no compilation is needed on a supported platform.

Cloud (RunPod / SimplePod / Massed Compute)

See the instructions bundled with the Patreon release.

Launching the app

Use Windows_Start_App.bat, or activate the venv and run:

python app.py
Flag Effect
--share create a public Gradio link
--server-port PORT serve on a specific port (default: auto)
--server-name HOST host to bind to (default: 127.0.0.1)
--no-browser do not open a browser window on launch
--quiet reduce Gradio's start-up output

Presets

A preset captures every control in the entire app, across all nine tabs — around 150 of them. The preset you last saved or loaded is restored automatically the next time the app starts, so your working configuration survives a restart.

Selecting a preset in the dropdown changes nothing until you press Load, so a mis-click can never wipe the settings you are in the middle of editing. The built-in Default set lives in code rather than on disk, so it can never be overwritten or deleted.

Preset bar


Tab 1 — Image Cropper

Finds the subject in every photo of a folder and crops the tightest box that matches each aspect ratio you ask for. It detects the subject, adds your padding, then grows the box outwards until the ratio is exact — so the subject is never squashed and no part of it is ever cut off.

Output goes to one sub-folder per aspect ratio (1024x1024/, 1280x720/, 1080x1350/ …), which is exactly the layout the Image Resizer tab reads back.

  • Live folder scan — image count, extensions and total size shown before you press start
  • Three detection engines, each showing only its own thresholds
  • All instances (union) — spans every match so nobody is cropped out of a group photo
  • Padding in percent or pixels, applied before the ratio so the ratio stays exact; negative values crop in tighter
  • Annotated previews — optionally writes a copy with detections drawn on it, to check a prompt before a big run
  • Safe re-runs — with overwrite off, images whose crops already exist are skipped

Image Cropper full guide

The three detection engines

Engine What it is Its knobs Use when
SAM 3.1 (default) Detects and segments in one model from open-vocabulary text. Pixel-accurate masks, no fixed class list. confidence, max instances your subject is not a COCO class, or you need a real mask
YOLO Fastest, no prompt wording to get wrong. 80 COCO classes plus a dedicated face model (yolov12l-face.pt swaps it in automatically). confidence, NMS IoU, inference size, max detections your subject is a COCO class and you want throughput
SAM 2.1 + GroundingDINO The older two-stage pipeline: GroundingDINO proposes boxes, SAM 2.1 turns them into masks. box threshold, text threshold reproducing results from before SAM 3.1

Detection engines compared

How the cropping logic works

Detect → pad → grow outwards to the ratio. And the detail that surprises most people: nothing is ever upscaled. The aspect ratio you type is used as a ratio, not as a target size, so a 6000 px wide photo yields a 6000 px wide 16:9 crop, not a 1280 px one. Tick Resize crops to the exact target size if you want the Cropper to scale too — otherwise crop here and resize in the Image Resizer tab, where you choose the filter. That order throws away the least detail.

Aspect ratio logic

The run panel

Every batch tab shares the same panel: a live status card with progress, images/sec and ETA, a copyable log naming each file and how many outputs it produced, and a Stop button that really stops the worker and keeps whatever was already written.

Live run

Real results

The annotated detection preview alongside the 1:1, 16:9 and 4:5 crops of the same photos. Every crop is a plain rectangle of original pixels — the app never resamples during cropping.

Cropper results


Tab 2 — Segmentation

SAM 3.1 masks from plain English, with an interactive single-image tester and a folder batch that share one set of settings.

Dial your prompt in on one image first — it takes a few seconds and shows the exact mask, the confidence score and the mask area in pixels. The batch section further down the page then uses those identical settings; there is no second set of controls to keep in sync.

You get the segmented overlay, the mask itself (white inside, black outside — ready for inpainting, ControlNet or masked training), and a copyable detections table with label, score, bounding box and mask pixel count per instance.

Segmentation single image

Negative prompts

Subtract one concept from another in a single pass. Below, the prompt is face. and the negative prompt is eye. lips. — the eyes and mouth are carved straight out of the face mask. The negative mask is saved separately so you can reuse or invert it.

This is how you build skin-only masks, or segment a car while cutting out the person standing in front of it.

Negative prompts

Settings and the YOLO backend

Concepts are separated by periods and the vocabulary is open. Confidence drops weak instances; max instances caps both the result count and how much VRAM the mask upsample needs on a busy scene; overlay opacity affects only the preview tint (the saved mask is always pure black and white).

On the YOLO backend you multi-select any number of the 80 COCO classes instead of writing a prompt, with a separate exclude list. YOLO mask source decides where masks come from: SAM 2.1 refined turns each box into a pixel-accurate mask (loads a second model, still fast), while filled boxes is instant and plenty for rectangular crops or inpainting blocks.

Segmentation settings and YOLO

Batch processing

One mask per image, plus optional annotated overlays and negative masks. Leaving the overlay folder empty makes a run noticeably faster, because the masks then never need upsampling to full resolution for display. Skip images that already have a mask makes an interrupted run cheap to resume.

Segmentation batch

The prompt below was a single word: face. The bottom row is a red-carpet shot with a crowd in the background — SAM 3.1 found 16 separate faces in it and every one is in the mask.

Segmentation results


Tab 3 — Extract Faces & Objects

Cuts the detected region out of each photo and saves it as its own image — the fastest way to build a face dataset. Unlike the Image Cropper this does not force an aspect ratio: you get the detection box plus whatever padding you ask for.

  • Save every detected instance as its own file — a group photo of five people yields five crops (photo_1.pngphoto_5.png). Off gives exactly one crop per photo, chosen by confidence or largest area.
  • Padding — faces almost always look better with 15–30% of breathing room. Percent scales with the face, so close-ups and wide shots come out consistent.
  • Minimum crop size — one slider that drops background faces too small to be useful.
  • Not limited to faces: hand. licence plate. dog. all work.

Extract Faces

Extract Faces results


Tab 4 — Image Resizer

Writes every input image at one or more exact pixel sizes. Each input is written once per resolution into <output>/<WxH>/, so several dataset buckets come out of a single run.

Run it after the Image Cropper: crop first at native resolution, then resize once with the filter you want.

Image Resizer

It works out what you pointed it at

Point at an Image Cropper output folder and it reports Image Cropper layout detected, listing how many files each WxH bucket contributes and naming any resolution with no matching sub-folder. Point at a plain folder of pictures and it says Plain folder detected and does the multiplication for you: 12 images × 3 resolutions = 36 output files.

Input detection

Framing choices

Crop to fill keeps the aspect ratio and trims the overflow — no bars, some content lost, and the default. Fit inside keeps every pixel and pads with your chosen background colour. Stretch distorts the image and is almost never what you want.

Separately, Centre the crop on decides where the crop is taken. Image centre is instant and loads no model, but a geometric centre crop can push the subject out of frame. Detected face / subject runs a detector first so the subject stays in frame — slower, since each worker loads its own model, so keep the worker count low in that mode.

Fit modes and centring


Tab 5 — Generate Tiled Images

Slices each photo into an overlapping N×N grid of fixed-size tiles. Because the tiles are cut at native resolution and never upscaled, this is a very good way to turn a handful of very large photos into a high-detail training set.

Tiles per image must be a perfect square — 9 means a 3×3 grid — and tiles overlap automatically so the whole frame is covered. If an image is smaller than one tile you choose the policy: Skip protects quality, Upscale guarantees output but invents pixels, Shrink the tile keeps the grid but writes smaller tiles for those images only.

Generate Tiled Images

Tiling results


Tab 6 — Find Duplicates

Groups visually identical or near-identical images and moves the extras out of the way, keeping one copy per group. Every comparison uses a true perceptual distance — earlier versions compared hashes as big integers, which is not a similarity measure at all and both missed real duplicates and invented fake ones.

Nothing is deleted. Duplicates are moved to a destination folder keeping their relative structure, and a full report is written next to them, so the step is reversible. You choose which copy survives: highest resolution, largest file, oldest, or first alphabetically.

Find Duplicates

Choosing an algorithm

The app ships a reference table for aHash, dHash, pHash, wHash, ColorHash, KAZE local features and a combined multi-hash mode — what each measures, what it is good at, where it breaks down, and the cutoff to start from.

Cutoffs are Hamming distances: how many bits differ out of hash size², so smaller is stricter. Each algorithm gets its own threshold, because a distance of 5 means something completely different for aHash than for pHash. KAZE is the odd one out — it survives rotation, perspective and heavy cropping, but it is quadratic in image count, so keep it for small folders.

There is also a safety cap on image count, because comparison is quadratic and a 100,000-image folder would otherwise run for hours. Anything dropped by the cap is reported explicitly rather than silently ignored.

Duplicate algorithms

Duplicate results


Tab 7 — Move Low-Res Files

Quality control for a crop run. Any processed image smaller than your threshold is moved out of the way together with the original it came from, so your two folders stay in sync — you never end up with a source photo whose result has been thrown away.

Set the minimum width and height, then choose whether to reject when either dimension is under the limit (strict) or only when both are. Files are paired by name, and Same name, any extension handles the everyday case where the crop is a .png and the original a .jpg. Preview mode is on by default and lists exactly what would move without touching disk.

Move Low-Res Files


Tab 8 — Rename Files

Renames a folder to a clean prefix + number sequence. The rename happens in two passes through temporary names, so a target name already taken by another file in the same folder can never clobber it. Extensions are always preserved.

Set the prefix, the starting number, the zero padding (4 or 5 so files sort correctly everywhere) and the numbering order — by name, by date, or by size. Only rename image files leaves captions and JSON sidecars alone. Preview mode is on by default and shows the first 50 planned renames without touching disk.

Rename Files


Tab 9 — Performance & VRAM

Everything on this tab applies to every other tab and is saved with your presets. The shipped defaults are already the fastest configuration that still matches the reference model output — you only need this tab to trade quality for memory, or to try torch.compile.

  • Run every task in a subprocess (off by default, tick it if you want it) — each run starts a fresh Python process, works, then exits, returning 100% of its VRAM and RAM, CUDA context and all. Left off, models stay resident between runs: faster repeated runs, but the VRAM stays held.
  • Switching model frees the old one first. Only one model set is ever resident. Change the backend, the precision, the resolution, the GPU or the YOLO class that swaps in the face weights, and the previous model is unloaded — collected out of RAM and released from VRAM — before the new one is read from disk, so a switch never has to hold both. Measured on an RTX 5090: SAM 3.1 (1861 MB) → YOLO leaves 262 MB held, and eight switches back and forth drift by 0 MB. The console names what it dropped: [models] released SAM 3.1 (concept prompts) [bfloat16 @ cuda:0, res 1008]. If a second task happens to be running when you switch, its model is left alone until the process is quiet again.
  • Unload models and release VRAM — the diagnostics button below drops every loaded model on demand and reports the before/after figures, e.g. model weights 1893 MB → 0 MB, allocator reserve 2670 MB → 0 MB. What is left after that is the CUDA context itself, which only a process exit returns.
  • GPU IDs — comma-separated CUDA indices. With several GPUs the image list is split across them, but each device loads its own copy of the model, so a second GPU only pays for itself on folders of a few hundred images or more. Enter cpu to force CPU.
  • Model precision — the shipped SAM 3.1 checkpoint is stored in bfloat16, so keeping the weights in bfloat16 is bit-identical to the published values. Measured against the float32 path: 0.9992 mask IoU, 46% less VRAM (1.9 GB vs 3.5 GB), ~7× faster model loading and ~5% faster per image.
  • Load weights straight into VRAM — builds the model on the GPU and reads the safetensors file directly into VRAM, skipping the ~3.4 GB float32 copy in system RAM. Roughly 2.5× faster model loading.
  • Chunked mask upsampling — upsamples instance masks a few at a time. On a 24 MP photo with 20 instances this is the difference between a ~1 GB spike and a few tens of MB, with pixel-identical results.
  • Attention kernel, TF32, cuDNN autotuner, channels-last, matmul precision — all exposed and documented inline.
  • torch.compile the vision backbone — a one-off compile cost of roughly one to three minutes (cached under .cache/uipp) for faster steady-state inference. Worth it for large batches, not for a handful of images; falls back to eager mode if compilation fails.
  • SAM 3.1 inference resolution — 1008 is what the model was trained at. Lower is faster but loses small objects; higher costs quadratically more and adds no detail the model was trained to use.

Performance and VRAM

Runtime probe

One click imports torch — in a throw-away subprocess if Run every task in a subprocess is ticked, otherwise in this process — and reports what your machine can actually do: Python and platform, torch and CUDA versions, every GPU with its compute capability and VRAM, the status of Triton / FlashAttention / xformers / SageAttention / torchao, whether torch.compile is genuinely usable on this box (CUDA root, host compiler, ninja, cache path), and whether each model backend is ready. In subprocess mode the process then exits and the memory is gone.

Runtime probe


  1. Find Duplicates — clean first, so you never spend GPU time on near-identical shots
  2. Image Cropper — frame the subject, one sub-folder per ratio, at native resolution
  3. Move Low-Res Files — quality control, results and originals moved together
  4. Image Resizer — point it at the Cropper's output folder for exact pixel sizes
  5. Rename Files — a clean, correctly sorting sequence

Side branches whenever you need them: Segmentation for masks, Extract Faces for a face dataset, Generate Tiled Images for more data out of very large photos, and Performance & VRAM set once for everything.

The one rule that matters most: crop before you resize. Cropping keeps the original pixels, so resizing afterwards starts from the largest possible image and only has to downscale once. The other way round throws away detail you can never get back, and can force an upscale.

Output folder layout

The Image Cropper's <width>x<height>/ sub-folder layout is not cosmetic — the Image Resizer reads it directly, matching each bucket to the resolution of the same name. That is exactly why the recommended order is crop → resize.

Quick reference

Every tab, the one setting that matters most, and the mistake to avoid.


Measured benchmarks

Single RTX 5090, 12 source photos at up to 6714 × 5274 px, SAM 3.1 at its default settings.

Job Work done Time
Image Cropper 12 photos → 36 crops across 3 aspect ratios 47.7 s (0.25 img/s)
Segmentation (batch) 12 photos, 33 instances masked 28.8 s (0.42 img/s)
Extract Faces 33 face crops from 12 photos 9.6 s (1.25 img/s)
Image Resizer 36 files at exact pixel sizes 2.0 s (17.7 img/s, CPU)
Generate Tiled Images 108 tiles from 12 photos 1.2 s
Find Duplicates 4 groups across 17 images 0.4 s
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

SECourses Upscaler Pro Beating Topaz AI by Far With Specalized FlashVSR+ & SeedVR2.5 - Local Windows

FurkanGozukara - Feb 24

MCP Is the USB-C of AI. So Why Are You Plugging Everything In?

Ken W. Algerverified - Jun 10
chevron_left
1.3k Points133 Badges
Türkiye, Mersinpatreon.com/SECourses
31Posts
6Comments
PhD Computer Engineer and Assistant Professor at Computer Engineering Department

100+ Generative A... Show more

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!