GeoTagr is an AI-powered tool that predicts the geographical location of photos using a LangChain-based agent system powered by Google's Gemini Flash 1.5 LLM.
GeoTagr analyzes images and returns predicted coordinates along with detailed reasoning for its predictions. You can test it HERE
.
├── src/ # Main application code and agent implementation
└── test/ # Test images and benchmarking scripts
-
Clone the repository:
git clone https://github.com/mwitjez/GeoTagrBacked.git cd GeoTagrBacked
-
Set up environment variables:
# Copy the template cp .env_template .env # Edit .env with your credentials nano .env
-
Install dependencies:
pip install -r requirements.txt
-
Start the API server:
uvicorn api:app --reload --port 8000
-
Access the API:
- Interactive Documentation: Visit
http://localhost:8000/docs
- Direct API endpoint:
http://localhost:8000/process-image
- Interactive Documentation: Visit
-
Make a prediction:
curl -X POST "http://localhost:8000/process-image" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/your/image.jpg"
-
Response Format:
{ "latitude": str, "longitude": str, "reasoning": str, }
- Run with a single image specified in main.py:
python src/main.py
- Run using Streamlit interface:
streamlit run app.py
Benchmark results on the Im2GPS dataset:
Metric | Accuracy |
---|---|
Within 1km | 13.9% |
Within 25km | 43.9% |
Within 200km | 64.1% |
Within 750km | 80.2% |
Within 2500km | 92.8% |
Additional Statistics:
- Mean Distance Error: 843.23 km
- Median Distance Error: 49.06 km