Giter Site home page Giter Site logo

mever-team / visloc-estimation Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 4.46 MB

Authors official PyTorch implementation of the "Leveraging EfficientNet and Contrastive Learning for Accurate Global-scale Location Estimation" [ICMR 2021] and "Leveraging Selective Prediction for Reliable Image Geolocation" [MMM 2022]

License: Apache License 2.0

Python 100.00%
geolocalization geolocation geotagging location-estimation im2gps geolocation-estimation

visloc-estimation's Introduction

Visual location estimation

This repository contains the PyTorch implementation of the papers Leveraging EfficientNet and Contrastive Learning for Accurate Global-scale Location Estimation and Leveraging Selective Prediction for Reliable Image Geolocation. It provides all necessary code and pre-trained models for the evaluation of the location estimation method on the datasets presented in the paper to facilitate the reproducibility of the results. It provides code for the Search within Cell (SwC) scheme for the accurate location prediction, and the calculation of the Prediction Density (PD) that indicates image localizability.

Prerequisites

  • Python 3
  • PyTorch
  • Torchvision

Preparation

Installation

  • Clone this repo:
git clone https://github.com/mever-team/visloc-estimation
cd visloc-estimation
  • Install all the dependencies by
pip install -r requirements.txt

Background collection

  • Download and store the features of the background collection needed for SwC inference from here or by
wget https://mever.iti.gr/visloc/back_coll_features.hdf5

Evaluation datasets

Evaluation

  • To evaluate the approach, run the evaluation.py script given the dataset you wand to evaluate on, the image_folder directory of the dataset images, and the background path of the background collection features
python evaluation.py  --dataset im2gps3k --image_folder <path_to_images> --background ./back_coll_features.hdf5
  • The script above calculates the geolocation accuracy for the provided evaluation_radius. It provides results for the entire dataset and the dataset split of localizable and non-localizable based on the provided PD value.

  • Change the values of top_k and eps to parametrize DBSCAN clustering of the SwC process.

  • Change the values of conf_thres and conf_scale to parametrize the PD that determines which images are considered localizable and non-localizable.

Inference

  • You can also use the code to predict the location of a single image

  • Run the inference.py script given the image_path of an image stored locally or the image_url of an image from the web

python inference.py --image_url 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/200px-Tour_Eiffel_Wikimedia_Commons.jpg'

Citation

If you use this code for your research, please consider citing our papers:

@inproceedings{kordopatis2021leveraging,
  title={Leveraging efficientnet and contrastive learning for accurate global-scale location estimation},
  author={Kordopatis-Zilos, Giorgos and Galopoulos, Panagiotis and Papadopoulos, Symeon and Kompatsiaris, Ioannis},
  booktitle={Proceedings of the International Conference on Multimedia Retrieval},
  year={2021}
}

@inproceedings{panagiotopoulos2022leveraging,
  title={Leveraging Selective Prediction for Reliable Image Geolocation},
  author={Panagiotopoulos, Apostolos and Kordopatis-Zilos, Giorgos and Papadopoulos, Symeon},
  booktitle={Proceedings of the International Conference on MultiMedia Modeling},
  year={2022},
}

visloc-estimation's People

Contributors

gkordo avatar kleinmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

davidfaget

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.