This repository contains some experimental Python code designed for the detection of low-quality images through a machine learning approach. In particular, the algorithm will perform
- sharp (good quality) images detection,
- defocused blur detection,
- motion blur detection,
- horizontal/vertical bands detection,
- noise detection,
- excessive exposure detection,
- glare detection,
- dark photo detection,
- uninformative constant colour detection.
Check the Medium article for the technical details.
Create and use a Python environment with Python 3.10.13 and the packages listed in requirements.txt. Check here or, if you are using Anaconda, here for the detailed steps.
The images are available here and here. Once downloaded the .zip folder, extract its contents ( defocused_blurred, motion_blurred, sharp) inside a folder called dataset_dms (unless another location is chosen).
python 01_synthetic_low_quality_images.pyA folder called dataset_synthetic (unless another location is chosen) will be created with generated low quality images.
python 02_features_generation.pyA CSV file called df_public.csv (unless another name is used) will be generated.
Look at 03_models_{name}.ipynb notebooks as examples.
python detect.py {image path}