A powerful tool for managing and cleaning up large photo and video libraries. Features a modern web interface with AI-powered duplicate detection and semantic search.
- 🚀 Smart Duplicate Detection: 3-phase scanning (size → partial hash → full SHA-256) for 100% accuracy
- 🧠 AI-Powered Search: Find photos using natural language (e.g., "sunset on beach", "family dinner") via CLIP
- 📁 Folder Cleanup: Identify and remove duplicates across folders
- 🗑️ Safe Deletion: Moves files to trash instead of permanent deletion
- 📂 Empty Folder Finder: Automatically detect and remove empty directories
- 🎥 Video Support: Duplicate detection and thumbnail generation with FFmpeg
- 📱 Modern Web UI: Clean, responsive interface for managing your entire library
3 steps to get started:
# 1. Clone and navigate
git clone https://github.com/Amal97/Photo-Clean-Up.git
cd Photo-Clean-Up
# 2. Configure your photos directory
cp .env.example .env
# Edit .env: PHOTOS_DIR=/path/to/your/photos
# 3. Launch
docker-compose up -dAccess at: http://localhost:8080
View logs: docker-compose logs -f
✅ Always use http://localhost:8080 on your host machine
❌ Don't try to access the container's internal IP (e.g., 172.x.x.x)
The container can only scan directories you mount. To scan a different directory:
# Edit .env file
PHOTOS_DIR=/path/to/different/photos
# Restart
docker-compose down
docker-compose up -d| Variable | Default | Description |
|---|---|---|
PHOTOS_DIR |
- | Required: Path to your photos on host machine |
PORT |
8080 |
Web server port |
IMMICH_API_URL |
- | Optional: Immich integration endpoint |
IMMICH_API_KEY |
- | Optional: Immich API key |
Advanced setup? See DOCKER.md for GPU support, reverse proxies, Kubernetes, and more.
- Python 3.8+
- FFmpeg (for video thumbnails)
- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg
- macOS:
# Clone repository
git clone https://github.com/Amal97/Photo-Clean-Up.git
cd Photo-Clean-Up
# Install dependencies
pip install -r requirements.txt
# Run
python clean.pyAccess at: http://localhost:8080
You can set the photos directory via:
-
Environment variable (recommended):
export ROOT_DIR=/path/to/photos python clean.py -
Settings file: Edit via the web UI Settings tab
-
Code: Edit
ROOT_DIRinclean.py(line 38)
- Duplicates Tab: Review and delete duplicate files
- Folders Tab: Find folders containing duplicates
- Smart Search: AI-powered natural language search
- Small Files: Find and remove screenshots/small images
- Empty Folders: Detect and clean empty directories
- All Media: Browse and manage your entire library
- History: Track deleted files and space saved
# Index images for Smart Search
python tools.py index
# Cleanup based on folder rules
python tools.py cleanup /path/to/keep/folderFirst run downloads the CLIP model (~600MB) from Hugging Face.
- macOS: Automatically uses Apple Silicon (MPS) for faster indexing
- Linux/Windows: Uses CPU (or CUDA if available)
- Performance: ~200-2000 images/minute depending on hardware
View logs:
docker-compose logs -fStop:
docker-compose downRebuild after code changes:
docker-compose up -d --buildPermission errors?
# Edit docker-compose.yml, add:
user: "1000:1000" # Use your host user IDPort conflict?
# Edit .env file:
PORT=8090 # Use different portThis project is licensed under the MIT License.
If you use this software in your projects (open-source or commercial), you must:
- Retain the
LICENSEandNOTICEfiles - Link back to this repository:
https://github.com/Amal97/Photo-Clean-Up - Credit Amal Chandra in your documentation
Built with ❤️ by Amal Chandra