• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repository contains all necessary meta information, results and source files to reproduce the results in the publication Eric Müller-Budack, Kader Pustu-Iren, Ralph Ewerth: "Geolocation Estimation of Photos using a Hierarchical Model and Scene Classification", In: European Conference on Computer Vision (ECCV), Munich, 2018.

Geolocation Estimation of Photos using a Hierarchical Model and Scene Classification

Conference

This is the official GitHub page for the paper (Link):

Eric Müller-Budack, Kader Pustu-Iren, Ralph Ewerth: "Geolocation Estimation of Photos using a Hierarchical Model and Scene Classification". In: European Conference on Computer Vision (ECCV), Munich, Springer, 2018, 575-592.

News

12th December 2020 - PyTorch version: We release a PyTorch implementation and provide weights of a pre-trained base(M, f*) model with underlying ResNet50 architecture.

17th February 2020 - original_tf branch: Since our code is not compatible with TensorFlow 2 and relies on a Caffe model for scene classification, we have added a Dockerfile to simplify the installation. In addition, we have modified the inference script. It is now able to automatically generate the reported results in the paper for the testing datasets.

Contents

  • Web Demo
  • Reproduce Paper Results: A seperate branch (original_tf() where all information and pre-trained models are provided to reproduce the original results of the paper.
  • PyTorch Implementation: A re-implemented version of the base(M, f*) model in PyTorch including code for training, validation, testing, and inference.
  • Citation
  • License

Demo

A graphical demonstration where you can compete against the deep learning approach presented in the publication can be found on: https://labs.tib.eu/geoestimation

This demo additionally supports uploading and analyzing your own images. A simplified offline version is located in this repository: https://tibhannover.github.io/GeoEstimation/

Reproduce Paper Results

We provide the original TensorFlow 1.14 implementation based on a ResNet101 to reproduce the results reported in the paper in the original_tf branch.

PyTorch Implementation

We have updated our code in PyTorch including scripts for training, inference and test. We have retrained the base(M, f*) model using a ResNet50 architecture and it achieved comparable results despite its lower complexity.

Contents

Inference

To use the pre-trained model by default, first download the model checkpoint by running:

mkdir -p models/base_M
wget https://github.com/TIBHannover/GeoEstimation/releases/download/pytorch/epoch.014-val_loss.18.4833.ckpt -O models/base_M/epoch=014-val_loss=18.4833.ckpt
wget https://github.com/TIBHannover/GeoEstimation/releases/download/pytorch/hparams.yaml -O models/base_M/hparams.yaml

Inference with pre-trained model:

python -m classification.inference --image_dir resources/images/im2gps/

Available argparse parameter:

--checkpoint CHECKPOINT
    Checkpoint to already trained model (*.ckpt)
--hparams HPARAMS     
    Path to hparams file (*.yaml) generated during training
--image_dir IMAGE_DIR
    Folder containing images. Supported file extensions: (*.jpg, *.jpeg, *.png)
--gpu                 
    Use GPU for inference if CUDA is available, default to true
--batch_size BATCH_SIZE
--num_workers NUM_WORKERS
    Number of workers for image loading and pre-processing

Example output that is also stored in a CSV file:

img_id                                             p_key      pred_class  pred_lat   pred_lng 
Tokyo_00070_439717934_3d0fd200f1_180_97324495@N00  hierarchy  5367        41.4902    -81.7032
429881745_35a951f032_187_37718182@N00              hierarchy  8009        37.1770    -3.5877
104123223_7410c654ba_19_19355699@N00               hierarchy  7284        32.7337    -117.1520

Reproduce Results

Test on Already Trained Model

The (list of) image files for testing can be found on the following links:

Download and extract the two testsets (Im2GPS, Im2GPS3k) in resources/images/<dataset_name> and run the evaluation script with the provided meta data, i.e., the ground-truth coordinate for each image. When using the default paramters, make sure that the pre-trained model is available.

# download im2gps testset
mkdir resources/images/im2gps
wget http://graphics.cs.cmu.edu/projects/im2gps/gps_query_imgs.zip -O resources/images/im2gps.zip
unzip resources/images/im2gps.zip -d resources/images/im2gps/

wget https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/meta/im2gps_places365.csv -O resources/images/im2gps_places365.csv
wget https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/meta/im2gps3k_places365.csv -O resources/images/im2gps3k_places365.csv
python -m classification.test

Available argparse paramters:

--checkpoint CHECKPOINT
    Checkpoint to already trained model (*.ckpt)
--hparams HPARAMS     
    Path to hparams file (*.yaml) generated during training
--image_dirs IMAGE_DIRS [IMAGE_DIRS ...]
    Whitespace separated list of image folders to evaluate
--meta_files META_FILES [META_FILES ...]
    Whitespace separated list of respective meta data (ground-truth GPS positions). Required columns: IMG_ID,LAT,LON
--gpu
    Use GPU for inference if CUDA is available, default to True
--precision PRECISION
    Full precision (32), half precision (16)
--batch_size BATCH_SIZE
--num_workers NUM_WORKERS
    Number of workers for image loading and pre-processing

Results on the Im2GPS and Im2GPS3k test sets: The reported accuracies (in percentage) is the fraction of images localized within the given radius (in km) using the GCD distance. Note, that we used the full MP-16 training dataset and all 25600 images for validation, thus the results will differ when not all images are available.

Im2GPS:

Model 1 25 200 750 2500
base(M, c) 9.3 31.6 49.8 67.1 78.9
base(M, m) 13.9 34.6 48.1 68.4 79.3
base(M, f) 15.6 39.2 48.9 65.8 78.5
base(M, f*) 14.8 37.6 48.9 68.4 78.9
base(M, f*) (original) 15.2 40.9 51.5 65.4 78.5

Im2GPS3k:

Model 1 25 200 750 2500
base(M, c) 6.2 24.3 36.3 51.7 67.0
base(M, m) 8.3 26.2 35.7 51.4 66.5
base(M, f) 9.9 27.3 36.2 51.2 66.4
base(M, f*) 10.1 28.0 36.9 51.1 67.0
base(M, f*) (original) 9.7 27.0 35.6 49.2 66.0
ISN(M, f*, S3) (original) 10.5 28.0 36.6 49.7 66.0

Training from Scratch

We provide a complete training script which is written in PyTorch Lightning and report all hyper-paramters used for the provided model. Furthermore, a script is given to download and pre-process the images that are used for training and validiation.

  1. Download training and validation images
    • We provide a script to download the images given a list of URLs
    • Due to no longer publicly available images, the size of the dataset might be smaller than the original.
    • We also store the images in chunks using MessagePack to speed-up the training process (similar to multiple TFRecord files)
  2. Given multiple s2 partitionings (e.g. coarse, middle, fine from the paper), the respective classes are assigned to each image on both datasets.
  3. Training and hyper-paramters: All hyper-paramters can be configured in configs/baseM.yml as well as paramters from PyTorch Lightning Trainer class.

Necessary steps:

# download and preprocess images
wget https://github.com/TIBHannover/GeoEstimation/releases/download/v1.0/mp16_urls.csv -O resources/mp16_urls.csv
wget https://github.com/TIBHannover/GeoEstimation/releases/download/pytorch/yfcc25600_urls.csv -O resources/yfcc25600_urls.csv 
python download_images.py --output resources/images/mp16 --url_csv resources/mp16_urls.csv --shuffle
python download_images.py --output resources/images/yfcc25600 --url_csv resources/yfcc25600_urls.csv --shuffle --size_suffix ""

# assign cell(s) for each image using the original meta information
wget https://github.com/TIBHannover/GeoEstimation/releases/download/v1.0/mp16_places365.csv -O resources/mp16_places365.csv
wget https://github.com/TIBHannover/GeoEstimation/releases/download/pytorch/yfcc25600_places365.csv -O resources/yfcc25600_places365.csv
python partitioning/assign_classes.py
# remove images that were not downloaded 
python filter_by_downloaded_images.py

# train geo model from scratch
python -m classification.train_base --config config/baseM.yml

Geographical S2 Cell Partitioning

The geographical cell labels are extracted using the S2 geometry library and can be visualized on http://s2.sidewalklabs.com/regioncoverer/. Create a partitioning using the following command for a given dataset (as CSV file) which contains an image id, latitude and longitude. We provide the partitionings that are used in the paper below.

python partitioning/create_cells.py [-h] [-v] --dataset DATASET --output OUTPUT --img_min IMG_MIN --img_max IMG_MAX [--lvl_min LVL_MIN]
                       [--lvl_max LVL_MAX]
# Optional arguments:
#   -h, --help         show this help message and exit
#   -v, --verbose      verbose output
#   --dataset DATASET  Path to dataset csv file
#   --output OUTPUT    Path to output directory
#   --img_min IMG_MIN  Minimum number of images per geographical cell
#   --img_max IMG_MAX  Maximum number of images per geographical cell
#   --lvl_min LVL_MIN  Minimum partitioning level (default = 2)
#   --lvl_max LVL_MAX  Maximum partitioning level (default = 30)
#   --column_img_path  CSV input column name for image id / path
#   --column_lat       CSV input column name latitude
#   --column_lng       CSV input column name longitude

Requirements

All requirements are listed in the environment.yml. We recomment to use conda to install all required packages in an individual environment.

# clone this repo
git clone https://github.com/TIBHannover/GeoEstimation.git && cd GeoEstimation
# install dependencies
conda env create -f environment.yml 
conda activate geoestimation-github-pytorch
# download pre-calculated parititonings
mkdir -p resources/s2_cells
wget https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/geo-cells/cells_50_5000.csv -O resources/s2_cells/cells_50_5000.csv
wget https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/geo-cells/cells_50_2000.csv -O resources/s2_cells/cells_50_2000.csv
wget https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/geo-cells/cells_50_1000.csv -O resources/s2_cells/cells_50_1000.csv

Citation

@inproceedings{muller2018geolocation,
  author    = {Müller-Budack, Eric and Pustu-Iren, Kader and Ewerth, Ralph},
  title     = {Geolocation Estimation of Photos Using a Hierarchical Model and Scene
               Classification},
  booktitle = {Computer Vision - {ECCV} 2018 - 15th European Conference, Munich,
               Germany, September 8-14, 2018, Proceedings, Part {XII}},
  series    = {Lecture Notes in Computer Science},
  volume    = {11216},
  pages     = {575--592},
  publisher = {Springer},
  year      = {2018},
  url       = {https://doi.org/10.1007/978-3-030-01258-8\_35},
  doi       = {10.1007/978-3-030-01258-8\_35},
}

Licence

This work is published under the GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007. For details please check the LICENSE file in the repository.

More Repositories

1

MSVA

Deep learning model for supervised video summarization called Multi Source Visual Attention (MSVA)
Python
40
star
2

cross-modal_entity_consistency

This repository contains the dataset and source files to reproduce the results in the publication Müller-Budack et al. 2021: "Multimodal news analytics using measures of cross-modal entity and context consistency", In: International Journal on Multimedia Information Retrieval (IJMIR), Vol. 10, Art. no. 2, 2021.
Python
24
star
3

UnsupervisedVideoSummarization

Source code for the paper "Unsupervised Video Summarization via Multi-source Features" published at ICMR 2021
Python
20
star
4

formula_gan

Unsupervised Training Data Generation of Handwritten Formulas using Generative Adversarial Networks with Self-Attention
Python
15
star
5

2018-07-09-FAIR-Data-and-Software

Website of our Carpentries-based workshop from July 2018 (former contact: @katrinleinweber)
Python
11
star
6

BacDiveR

Inofficial R client for the DSMZ's Bacterial Diversity Metadatabase (former contact: @katrinleinweber). https://api.bacdive.dsmz.de/client_examples seems to be the official alternatives.
R
10
star
7

impactViz

Wizzard for open scientometric indicators
JavaScript
8
star
8

edu-sharing-box

Edu-sharing automatisiert in einer virtuellen Box installieren
Jinja
7
star
9

rosi-registry

Registry for Scientometric Data Sources
HTML
6
star
10

MM_Claims

Official code repository for the paper: Gullal Singh Cheema, Sherzod Hakimov, Abdul Sittar, Eric Müller-Budack, Christian Otto, and Ralph Ewerth. 2022. “MM-Claims: A Dataset for Multimodal Claim Detection in Social Media.“ In Findings of the Association for Computational Linguistics: NAACL 2022, pages 962–979, Seattle, United States.
Python
6
star
11

iart-semi-pose

Python
5
star
12

MSC2020_SKOS

HTML
5
star
13

tibava

5
star
14

FAIR-studyGroup

FAIR data and software for students, scientists and librarians at TIB, LUH, etc. (contact: @katrinleinweber)
JavaScript
5
star
15

VisE

This repository contains all necessary meta information, results and source files to reproduce the results in the publication Eric Müller-Budack, Matthias Springstein, Sherzod Hakimov, Kevin Mrutzek, and Ralph Ewerth: "Ontology-driven Event Type Classification in Images". In: IEEE Winter Conference on Applications of Computer Vision (WACV), IEEE, 2021.
Python
5
star
16

orkg-backend

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-backend. Please contribute there.
Kotlin
4
star
17

mm-locate-news

Python
4
star
18

llama_index_mediawiki-service

llama_index_mediawiki-service is a container-virtualised service that aims to run a local Large Language Model (LLM) to assist wiki users.
Python
4
star
19

annif_automated_indexing_at_tib

Shell
4
star
20

orkg-nlp-pypi

Read-only mirror of https://gitlab.com/TIBHannover/orkg/nlp/orkg-nlp-pypi Please contribute there
Python
4
star
21

open-science-guide-of-guides

A Book: The Open Science Guide of Guides
HTML
4
star
22

VIVA

VIsual Information Retrieval in Video Archives
Python
4
star
23

ojsGeo

OJS Geoplugin
JavaScript
4
star
24

orkg-lsuc-jn

Jupyter notebook for ORKG life sciences use case
Jupyter Notebook
4
star
25

orkg-frontend

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-frontend. Please contribute there.
JavaScript
4
star
26

MM-FakeNews-Detection

Python
3
star
27

Generation_R

Generation R - exploring new ways to research. A service of the Leibniz Research Alliance Science 2.0
3
star
28

ConfIDent_schema

The data schema for the ConfIDent project.
Python
3
star
29

markdown-documents-template

Shell
3
star
30

iart

An Interactive Analysis- and Retrieval-Tool for the Support of Image-Oriented Research Processes
Shell
3
star
31

multimodal-misogyny-detection-mami-2022

Multimodal Misogyny Detection - SemEval 2022 - MAMI Challenge
Python
2
star
32

iconclass-classification

Python
2
star
33

ckanext-dwgviewer

A drawing (AutoCAD) file viewer for ckan
Python
2
star
34

orkg-similarity

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-similarity. Please contribute there.
Python
2
star
35

diaspora

Digital Approaches for the Synthesis of Poorly Accessible Biodiversity Information (BacDive & Semantics)
JavaScript
2
star
36

Interpretable-Multimodal-Hate-Speech

Python
2
star
37

ckanext-email-notification

Python
2
star
38

ckanext-multiuploader

CKAN extension for uploading multiple resources at once.
Python
2
star
39

open-publishing

Open Publishing BIM-224, SoSe 2022
HTML
1
star
40

orkg-pages-template

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-pages-template. Please contribute there.
JavaScript
1
star
41

ckanext-videoviewer

A video Viewer extension for ckan
Python
1
star
42

docker-smw-crc1153

Build a Semantic MediaWiki docker image (on top of docker-openresearch-stack) for SFB-INF 1153.
Makefile
1
star
43

2020-02-13-LSE-Hannover

Python
1
star
44

digitale-publikationen-im-kulturbereich-umfrageergebnisse

Digitale Publikationen im Kulturbereich: Beispiele und Eigenschaften – Umfrageergebnisse aus der NFDI4Culture Community
HTML
1
star
45

mmg-newsphoto

Python
1
star
46

visualize-image-class-distribution

To visualize the class distribution in interactive manner specially for images
HTML
1
star
47

export_ie_from_rosetta

Export digitally preserved data from Ex Libris Rosetta via SOAP API
Perl
1
star
48

semantic-glossar

Semantic Glossar software pipeline
Jupyter Notebook
1
star
49

optimeta-plugin-shared

OPTIMETA OJS Plugin - Shared Library for Citations and Geo Plugins
PHP
1
star
50

2019-10-08-LSE-Hannover

Python
1
star
51

SimpleBatchDownloader

Java
1
star
52

PromptImageEvent

Python
1
star
53

LSK-CKAN-Box

Vagrant Box + Ansible for setting up CKAN with extensions
Jinja
1
star
54

docs-master

Central storage of reusable (AsciiDoc) documentation snippets.
1
star
55

semantic-mediawiki-box

Semantic MediaWiki automatisiert in einer virtuellen Box installieren
PHP
1
star
56

ckanext-semtag

Semantic Tags extension for CKAN
1
star
57

oersi-backend

Read-only mirror of https://gitlab.com/oersi/oersi-backend
Java
1
star
58

ogt-web-map

Web map about places of Gestapo terror (1933-1945) in present-day Lower Saxony.
Vue
1
star
59

terminology-metadata

Terminology metadata recommendations by TIB
HTML
1
star
60

ADA-manual

Manual for book publishing with the ADA-Pipeline
HTML
1
star
61

orkg-predicates-clustering

Read-only mirror of https://gitlab.com/TIBHannover/orkg/nlp/experiments/orkg-predicates-clustering. Please contribute there
Jupyter Notebook
1
star
62

ADA-Reference-Publication

A reference publication to establish requirements and standards for the ADA publishing pipeline that uses software Fidus Writer, Vivlioystyle, and GitHub/Lab Git and Pages.
HTML
1
star
63

orkg-templates-recommendation

Read-only mirror of https://gitlab.com/TIBHannover/orkg/nlp/experiments/orkg-templates-recommendation. Please contribute there
Python
1
star
64

orkg-simcomp-api

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-simcomp/orkg-simcomp-api. Please contribute there.
1
star
65

orkg-nlp-api

read-only mirror of https://gitlab.com/TIBHannover/orkg/nlp/orkg-nlp-api. Please contribute there.
Python
1
star
66

TIBLokalsystematiken

1
star
67

library-profile-service

Java
1
star
68

Rapid-Collaborative-Health-Publishing

project to pull together the different parts that make up the public health service textbook framework for books sprints and OER
1
star
69

confIDent-dataScraping

collection of scripts to get event metadata from different data donators
Python
1
star
70

PICA-kulatur

Aus WinIBW-Downloads von PICA-Daten mehrfach vorhandene Exemplare herausfiltern (z.B. zur Makulatur alter Dubletten). Vormalig verantwortlich: @katrinleinweber
Shell
1
star
71

orkg-abstracts

Read-only mirror of https://gitlab.com/TIBHannover/orkg/orkg-abstracts. Please contribute there.
Python
1
star
72

ORKG-QA-Dataset

A question answering dataset built on the ORKG data
Python
1
star
73

oer-github-tutorial

How to create OER with GitHub
1
star
74

docker-ckan

Deploying CKAN (including PostgreSQL, Solr, Redis and Nginx) using Docker Compose
Dockerfile
1
star