Pragmatically sorting through my home lab. A simple neural classifier, trained on acozma/imagenet-1k-rand_blur from Hugging Face.
To build and run the project, first initialize your environment.
python -m venv .myvenv
source .myvenv/bin/activate
pip install -r requirements.txtNote: it is highly recommended to use CUDA. Ensure you are installing the GPU-accelerated versions of PyTorch.
python classifier.py train --steps 1000python classifier.py inf --source /path/to/images # image directory to be sorted
--output /path/to/output # sorted images are cp'd to here in `normal`, `blurred` subdirs
--threshold 0.8 # confidence threshold for classifying an image as blurry (range: 0 to 1. default: 0.8)- Thanks to @mlindgren for adding HEIC support