This Python project detects landmarks using Google Cloud Vision API. It stores the processed data in a CSV file with details like description, confidence score, and Google Maps reference.
project-root/
│
├── main.py # Entry point of the program
├── landmarks.csv # Output CSV file with landmark data (auto-generated)
├── images/ # Source folder with original images
├── resized/ # Folder where resized images are saved (auto-generated)
├── credentials.json # Your Google Cloud credentials file
│
└── src/
├── resize/
│ └── resize.py # Resizing logic
├── identify/
│ └── identify.py # Landmark detection logic
└── csv/
└── csv.py # CSV writing logic
- All
.jpg,.jpeg, and.pngimages in theimages/folder are resized to 25% of their original size — only if their width or height exceeds 512px. - Resized images are saved to the
resized/folder.
- Uses Google Cloud Vision API to detect landmarks in each resized image.
- Detected results are written to
landmarks.csv, including:- Image name
- Landmark description
- Confidence score
- Latitude & Longitude
- A Google Maps reference link
git clone https://github.com/jsoningram/landmarks.git
cd landmarkspython -m venv .venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
pip install -r requirements.txt- Enable the Vision API in your Google Cloud Console.
- Download your service account credentials as
credentials.jsonand place it in the project root. - Generate a Gemini API key in the AI Studio
- Store the Gemini API key in a
.envfile at the root of the project asGOOGLE_AI_API_KEY
Place your input images into the images/ folder and then run:
python main.pyThe script will:
- Resize images (if needed)
- Detect landmarks
- Write results to
landmarks.csv
| Image | Description | Confidence Score | Longitude | Latitude | Ref |
|---|---|---|---|---|---|
| paris.jpg | Eiffel Tower | 0.987 | 2.2945 | 48.8584 | Google Maps |
| lake.jpg | unknown |
- You can configure resize percentage and image limits in
main.pyandresize.py.