This project implements a semantic, perceptual image compression pipeline that uses a convolutional model to identify regions of interest in an image and allocate compression quality accordingly. The result is intended to preserve visually important content while reducing overall image size.
The main entry point processes a single image from the command line, generates the compression output, and saves intermediate visualizations such as the ROI heatmap.
image_compressor.py: command-line entry point for compressing a single imagecompression.py: main compression pipeline and ROI-based quality allocationmodel.py: CNN and feature extraction logic used by the compressorutil.py: image loading, resizing, normalization, and helper utilitiesjpeg_compression.py: baseline JPEG compression helperbenchmark_test.py: benchmark script for comparing compression outputsget_metrics.py: metric collection and reporting utilitiesgraph.py: plotting utilities for compression resultsImage_compression_deployment/: deployment-oriented copy of the projectImage Quality Assessment Tools/: PSNR, SSIM, and related evaluation scripts
Install the required dependencies:
pip3 install -r requirements.txtThe project also expects CUDA-enabled TensorFlow dependencies if you are running the original GPU-based setup.
Run compression on a single image:
python3 image_compressor.py path/to/single_image.jpgThe script loads the input image, runs the compression pipeline, and writes output files to the project folders used by the code.
If you need the original invocation with elevated privileges, you can also run:
sudo python3 image_compressor.py path/to/single_image.jpg- The compressor expects a file path to one image, not a directory or glob pattern.
- Output artifacts are written by the script into the local
output/directory and related generated files in the project root.
