Giter VIP home page Giter VIP logo

loc2vec's Introduction

Loc2Vec Pytorch Mixed Precision Implementation

This project is inspired by this excellent blogpost: https://www.sentiance.com/2018/05/03/venue-mapping/

Read my blog post for implementation details and choices made

Note: This implementation requires FP16 support. If your GPU does not have that, just disable it with amp.init(enable=False) in trainer.py. You might also have to change the batch size in config.py.

How to generate tiles from openstreetmap data

Elaborate instructions are provided in the Readme file.

Alternatively, you can blindly use load.sh file after changing the path to the pbf file to create the file server. lat2tile.py has a quick utility function to generate all the tiles for the US-west region. You can generate a list of urls using the following. Once you have the following and download the tiles.

# download the us-west-latest.osm.pbf and change the path in load.sh
sh load.sh
python lat2tile.py > urls.txt

# start the server
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -d overv/openstreetmap-tile-server run
cat urls.txt | xargs -P 10 -n 1 wget -nH -nc -x

Environment setup (for pytorch and amp) and start training

conda env create -f  environment.yml
conda activate loc2vec
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .
cd ..
python loc2vec

Credits

Wanna Help?

First thanks! Below are a few things to implement. If you are a GIS expert, we can brainstorm a few ideas for collaboration. Open a issue and we can discuss there.

TODO:

  • Profile and remove CPU bottleneck
  • Add a conda environment file to make it self contained
  • Add ability to suspend and resume from training
  • Ability to save checkpoint even mid-epoch based on number of hard triplets
  • Add support for Fast.ai, esp Stocastic weight averaging & One cycle learning

Results

PCA

PCA

TSNE

TSNE

Nearest Neighbors (first column is the query image)

PCA

Interpolation in Embedding Space

TSNE

loc2vec's People

Contributors

surya501 avatar jonzarecki avatar

Watchers

James Cloos avatar

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.