Skip to content

markbakos/geo-guesser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geo Guesser

Time spent in project

Table of Contents

About

This project uses a deep learning approach to predict the geographic location of an image. By using convolutional neural networks (CNNs), it identifies patterns in visual data that correlate with specific regions. The model, designed with a hierarchical structure predicts the coordinates and region (continent).

The dataset for training is collected using Mapillary API. The model's architecture combines pre-trained layers from EfficientNetV2S backbone with custom dense layers. Outputs are weighted for a focus on regional and coordinate predictions.

Features

Data Handling:

  • Uses the Mapillary API to gather equal amount of diverse images per region for training
  • Splits data for training, validation and testing.

Deep Learning Model:

  • Employs EfficientNetV2S as the backbone, with additional layers for hierarchical predictions.
  • Estimates latitude and longitude coordinate and predicts region.
  • Haversine Loss for coordinate accuracy and Categorical Crossentropy for regions.

Training and Evaluation:

  • Tracks multiple metrics like regional accuracy and coordinate based location accuracy.
  • Saves best_location_model.keras as the best validation coordinates accuracy from training.
  • Saves best_overall_model.keras as the best overall model based on validation loss from training.

Frontend UI:

  • Uses NextJS for the frontend, with TypeScript and TailwindCSS.

Requirements

Prerequisites

  1. Python 3.10 or higher: Install from python.org.
  2. pip: Python package manager (comes with Python installations).

Python Dependencies

Install the required Python packages from requirements.txt found in the root folder.

pip install -r requirements.txt

Installation

  1. Clone the repository
 https://github.com/markbakos/geo-guesser.git
 cd geo-guesser
  1. Set up enviromental variables
  • In the root folder (geo-guesser), in your .env file:
MAPILLARY_KEY=[Your API key]
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up the dataset
  • Collect images using mapillary_collection.py
  • Recommended amount of images: 25-50k or more
  1. Use the trained model
  • From console:
python -m predict path/to/saved/image

Using the UI -- Either:

Start the FastAPI server

uvicorn server:app

Contributing

Feel free to fork this repository, make changes, and submit a pull request.

📧 Contact

For any inquiries, feel free to reach out:

Email: markbakosss@gmail.com
GitHub: markbakos