ImgDate is a powerful Python-based tool designed to streamline the digitization and organization of printed photographs. It can automatically crop, read date stamps, and sort images, making it invaluable for film photography.
- Automatic Image Cropping: Crops multiple images from a single scan
- Date Extraction: Employs GPT-4 Vision to extract dates from scanned photos
- Metadata Management: Updates EXIF data with extracted dates on the images
- Orientation Correction: Automatically detects and corrects the orientation of photos using facial recognition (requires dlib)
- Date Editor: Easily update the EXIF data of photos manually for the ones that the script failed to process
- File Organization: Sorts processed images into folders by year and month
- Multi-threading Support: Enhances processing speed for large batches of images
- Web Interface: User-friendly browser interface for easy image processing and date editing
- Python 3.8 or higher
- Windows operating system (for Visual Studio Build Tools)
- OpenAI API key
- 64-bit Python installation (required for dlib)
-
Clone the repository:
git clone https://github.com/bobbleheadhobo/ImgDate.git cd ImgDate
-
Install Microsoft Visual Studio Build Tools (required for dlib):
- Download Visual Studio Build Tools from Microsoft's website
- Run the installer
- Select "Desktop development with C++"
- Make sure the following components are checked:
- MSVC Build Tools
- Windows 10 SDK
- C++ CMake tools for Windows
- Click Install
-
Install required dependencies:
pip install -r requirements.txt
-
Add your API keys in .env_copy
- Enter the needed keys
- Rename the file to .env
- If you encounter issues installing dlib, make sure you have Python 64-bit installed
- After installing Visual Studio Build Tools, you may need to restart your computer
- If the pip install still fails, you can try installing dlib separately first:
pip install dlib
The simplest way to use ImgDate is through its web interface:
-
Start the web server:
python app.py
-
Open your web browser and navigate to
http://localhost:8888
For users who want quicker processing times and have lots of images:
-
Place your scanned images in the
img/unprocessed
folder -
Run one of the following commands:
# Process and organize images automatically python main.py organize # Open the date editor for manually editing dates python main.py edit # Process images and then open editor for failed detections python main.py process # Flags: # -d to delete all images in the save path # -c to draw contours around cropped images
-
Processed images will be saved in the
img/processed
folder by default -
Customize ImgDate's behavior by modifying the parameters in main.py:
image_organizer = ImageOrganizer( scans_path=r"..\img\unprocessed", save_path=r"..\img\processed", error_path=r"..\img\processed\Failed", archive_path=r"..\img\processed\archive", crop_images=True, date_images=True, fix_orientation=True, archive_scans=True, sort_images=True ) date_editor = ImageDateEditor(source_folder_path="..\img\processes\Failed")
- For accurate date detection, ensure dates appear in:
- Bottom right corner for landscape images
- Bottom left corner for portrait images
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.