Skip to content

mwitjez/GeoTagrBacked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoTagr 🌍 📸 🤖

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.

Overview 🎯

GeoTagr analyzes images and returns predicted coordinates along with detailed reasoning for its predictions. You can test it HERE

Project Structure 📁

.
├── src/          # Main application code and agent implementation
└── test/         # Test images and benchmarking scripts

Usage 🔄

Prerequisites ⚙️

  1. Clone the repository:

    git clone https://github.com/mwitjez/GeoTagrBacked.git
    cd GeoTagrBacked
  2. Set up environment variables:

    # Copy the template
    cp .env_template .env
    
    # Edit .env with your credentials
    nano .env
  3. Install dependencies:

    pip install -r requirements.txt

Option 1: REST API 🌐

  1. Start the API server:

    uvicorn api:app --reload --port 8000
  2. Access the API:

    • Interactive Documentation: Visit http://localhost:8000/docs
    • Direct API endpoint: http://localhost:8000/process-image
  3. Make a prediction:

    curl -X POST "http://localhost:8000/process-image" \
      -H "Content-Type: multipart/form-data" \
      -F "file=@/path/to/your/image.jpg"
  4. Response Format:

    {
      "latitude": str,
      "longitude": str,
      "reasoning": str,
    }

Option 2: Command Line 💻

  1. Run with a single image specified in main.py:
    python src/main.py

Option 3: Streamlit 🎈

  1. Run using Streamlit interface:
    streamlit run app.py

Performance 📊

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages