Skip to main content

PrepImage logo

PrepImage

A Unified Framework for Computer Vision Dataset Preparation
Deduplicate, clean, crop, resize, annotate, and augment image datasets — all in one desktop app.

PyPI version Python versions License: MIT GitHub repo pip install prepimage


Preparing an image dataset for a computer vision or AI project usually means stitching together a pile of one-off scripts — one for finding duplicates, another for resizing, another still for labeling and augmenting. PrepImage replaces all of that with a single, modern PySide6 (Qt) desktop application: open a folder of raw images, and clean, standardize, label, and expand it into a training-ready dataset without leaving the app.

PrepImage home screen

Table of Contents

Why PrepImage

  • One app, four workflows — deduplication, preprocessing, annotation, and augmentation share one consistent, modern dark-themed interface instead of four different scripts and conventions.
  • Built for real datasets — background worker threads keep the UI responsive on folders with thousands of images; every long-running step shows live progress.
  • Training-format aware — exports YOLO .txt, Pascal VOC .xml, and COCO-style .json annotations, and augments images with their labels so bounding boxes and polygons stay correct after a flip, rotation, or crop.
  • Nothing leaves your machine — PrepImage is a local desktop tool; your images and labels never get uploaded anywhere.

Modules

1. Duplicate, Blur & Noise Detection

Duplicate, Blur & Noise Detection screen

Scans a folder of images and flags three kinds of problems that quietly hurt model training if they slip into a dataset:

  • Duplicate & near-duplicate images — found via perceptual average-hashing (imagehash), then grouped so you can keep one representative from each group instead of every copy.
  • Blurry images — detected via a Laplacian-variance sharpness score.
  • Noisy images — detected via a median-filter residual noise estimate.

Enable any combination of the three Detection Options and run one scan; each category gets its own results tab with its own thumbnail grid. From there you can Forward Unique → Preprocess (send the clean set straight into the next module), Download Unique Images, or Download Duplicates for manual review.

Directories

Field Purpose
Input Directory The folder of images to scan. Required.
(no separate output field) Results stay in memory until you explicitly export them — each export action (Forward, Download Unique, Download Duplicates) prompts for its own destination folder when clicked.

2. Image Preprocessing (Crop / Resize / Rename)

Preprocessing screen

Batch-normalizes a folder of images into a consistent size and naming scheme — the shape most training pipelines expect:

  • Crops every image to a square, trimming evenly from the longer side (never stretching or distorting the image).
  • Resizes the square result to a fixed target size in pixels.
  • Renames output files sequentially with a custom prefix.
  • Zoomable thumbnail gallery to review and select which images to process before running.

Directories

Field Purpose
Input Directory Folder of source images to process. Required.
Output Directory Folder where cropped/resized/renamed images are written. Required.

3. Image Annotation

Image Annotation screen

A full labeling workspace for building object detection and segmentation datasets:

  • Bounding boxes for object detection and polygons for pixel-level segmentation, with an optional rasterized mask PNG export.
  • Per-image class labels, editable at any time (a "⋮" menu on every class and every annotation row covers editing, recoloring, renaming, changing class, and deleting).
  • Undo/redo — whole-shape while browsing, per-vertex while a polygon is still being drawn.
  • Export to YOLO .txt, Pascal VOC .xml, and/or COCO-style .json — pick any combination — with class names round-tripped through a per-folder classes.txt so relabeling later doesn't lose your class names.
  • Zoom/pan canvas, keyboard shortcuts, and an in-app shortcuts reference.

Directories

Field Purpose
Input Image Folder Folder of images to annotate. Required.
Custom Save Directory Where annotation files (and masks, if enabled) are saved. Optional — defaults to the input image folder if left blank.

4. Image Augmentation

Data Augmentation screen

Expands a dataset by generating pixel-level and geometric variations of each image, in two modes:

  • Image Augmentation — augments a folder of images with no annotations to carry along.
  • Annotated Image Augmentation — augments images and their existing YOLO .txt annotations together. Pixel/non-geometric augmentations (brightness, contrast, sharpen, Gaussian blur, saturation, Gaussian noise, grayscale) leave box coordinates untouched; geometric ones (horizontal/vertical flip, 90°/180°/270° rotation) transform the coordinates to match, so every saved label still lines up with its image.

Target Images controls how many augmented images to generate in total; Max Aug / Img caps how many augmented variants can come from any single source image. Augmented files follow the naming convention originalname_SHORTCODE1_SHORTCODE2_0001.ext, so it's obvious at a glance which combination of augmentations produced a given output.

Directories

Field Purpose
Input Image Folder Folder of source images (in Annotated mode, this folder should also contain the matching .txt label for each image). Required.
Output Image Folder Folder where augmented images (and, in Annotated mode, their updated .txt labels) are written. Required.

Installation

From PyPI

pip install prepimage

From source (editable / dev mode)

git clone https://github.com/harsh-iasri/PrepImage.git
cd prepimage/prepimage_pkg
pip install -e .

Usage

prepimage

or, without installing the console script:

python -m prepimage

Requirements

  • Python >= 3.9
  • PySide6 — Qt GUI framework
  • Pillow — image I/O and processing
  • ImageHash — perceptual hashing for duplicate detection
  • NumPy — array operations for preprocessing, blur/noise detection, and augmentation

All of the above are installed automatically as dependencies.

Project Layout

prepimage_pkg/
├── pyproject.toml
├── README.md
├── LICENSE
└── src/
    └── prepimage/
        ├── __init__.py
        ├── __main__.py            # entry point (`prepimage` / `python -m prepimage`)
        ├── app.py                 # QMainWindow + navigation (QStackedWidget)
        ├── theme.py               # colors, fonts, global stylesheet
        ├── widgets.py             # ToolCard (painted card, hover zoom)
        ├── assets.py              # shared logo loading helper
        ├── duplicates.py          # duplicate/blur/noise detection core logic
        ├── preprocess.py          # crop/resize/rename core logic
        ├── augment.py             # augmentation engine + box/polygon transforms
        └── screens/
            ├── __init__.py
            ├── home.py             # landing page (hero + 4 tool cards + About dialog)
            ├── duplicates.py       # Duplicate, Blur & Noise Detection screen
            ├── preprocess.py       # Preprocessing screen
            ├── annotate.py         # Image Annotation screen (boxes + polygons)
            ├── augment.py          # Image Augmentation screen
            ├── working.py          # shared "under construction" placeholder
            └── images/             # screenshots + logo bundled with the package

License

Released under the MIT License.

Contributors

Name Affiliation
Harsh Sachan ICAR-Indian Agricultural Statistics Research Institute (IASRI), New Delhi
Shalini Kumari ICAR-Indian Agricultural Statistics Research Institute (IASRI), New Delhi
Md Ashraful Haque ICAR-Indian Agricultural Statistics Research Institute (IASRI), New Delhi
Sudeep Marwaha ICAR-Central Institute of Agricultural Engineering (CIAE), Bhopal
Chandan Kumar Deb ICAR-Indian Agricultural Statistics Research Institute (IASRI), New Delhi

Contributions are welcome — feel free to open an issue or pull request on GitHub.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prepimage-1.0.0.tar.gz (774.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prepimage-1.0.0-py3-none-any.whl (779.0 kB view details)

Uploaded Python 3

File details

Details for the file prepimage-1.0.0.tar.gz.

File metadata

  • Download URL: prepimage-1.0.0.tar.gz
  • Upload date:
  • Size: 774.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for prepimage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 00eb701e691f70b74d711b4f78ff9e2a499ffa2ae7e5006f15bace6c8208ff68
MD5 bef593f18d034ec387682d910a08a146
BLAKE2b-256 9836e446165a8433c357fb5acc52621c08e45443dca7deab5aa7c77e2b3bad84

See more details on using hashes here.

File details

Details for the file prepimage-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: prepimage-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 779.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for prepimage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5081f022d551e1d8db1cb13ab28e9069957a3a8cb2872d2f731d28a00726a8a3
MD5 a0244eb2087b442e3cbd34fb0eb3718c
BLAKE2b-256 d0d894c85f76d468bc8e1f7889b22d49fd8f2871d8ae3d01418669290496c720

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page