This Python application detects landmarks, labels, web entities, and other image properties in images using the Google Cloud Vision API. It provides both a command-line interface and a web interface for processing images and retrieving location information.
- Landmark detection
- Label detection
- Web entity detection
- Image properties analysis (dominant colors)
- Safe search detection
- GPS data extraction from EXIF metadata
- Geolocation using Google Maps API when landmark detection fails
- Asynchronous processing for improved performance
- Error handling and retries for API calls
- Intermediate results saving
- Web interface for easy image upload and result viewing
Before running the application, ensure that you have:
- Python 3.7 or later
- A valid Google Cloud API key
- Google Cloud credentials file
- Google Maps API key
-
Clone the repository:
git clone https://github.com/PierrunoYT/photo-location-finder
-
Navigate to the project directory and install the required packages:
pip install -r requirements.txt
-
Set up the configuration:
- Copy
config.json.template
toconfig.json
- Fill in your Google API key, Google Application Credentials file path, and other necessary information in
config.json
- Copy
-
Ensure your images are in the directory specified in
config.json
. -
Run the script:
python photolocationfinder.py
-
The script will process the images and generate:
- A
result.json
file with the final results intermediate_results_[timestamp].json
files for each processed image
- A
-
Start the web application:
python web_app.py
-
Open a web browser and go to
http://localhost:5000
. -
Use the interface to upload and process individual images.
The application uses the tenacity
library for error handling and retries. API calls are retried up to 3 times with exponential backoff if they fail.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions, suggestions, or issues, please open an issue on the GitHub repository.