Giter Site home page Giter Site logo

posenet-pytorch's Introduction

Posenet implementation in PyTorch

This is an ongoing PyTorch implementation for PoseNet, developed based on Pix2Pix code.

Prerequisites

  • Linux
  • Python 3.5.2
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

  • Install PyTorch and dependencies from http://pytorch.org
  • Install Torch vision from the source.
  • Clone this repo:
git clone https://github.com/hazirbas/posenet-pytorch
cd posenet-pytorch
pip install -r requirements.txt

PoseNet train/test

  • Download a Cambridge Landscape dataset (e.g. KingsCollege) under datasets/ folder.
  • Compute image mean
python util/compute_image_mean.py --dataroot datasets/KingsCollege --height 256 --width 455 --save_resized_imgs
  • Train a model:
python train.py --dataroot ./datasets/KingsCollege --name posenet/KingsCollege/beta500 --beta 500 --gpu 0
  • To view training errors and loss plots, set --display_id 1, run python -m visdom.server and click the URL http://localhost:8097. Checkpoints are saved under ./checkpoints/posenet/KingsCollege/beta500/.
  • Test the model:
python test.py --dataroot ./datasets/KingsCollege --name posenet/KingsCollege/beta500 --gpu 0

The test errors will be saved to a text file under ./results/posenet/KingsCollege/beta500/.

Initialize model with pretrained googlenet on Places dataset

If you would like to initialize the model with pretrained weights, download the places-googlenet.pickle file under pretrained_models/ folder:

wget https://vision.in.tum.de/webarchive/hazirbas/posenet-pytorch/places-googlenet.pickle

Optimization scheme and loss weights

We use the training scheme defined in PoseLSTM. Best models are determined by the median error wrt position.

Dataset beta PoseNet Ours Model
King's College 500 1.92m 5.40° 1.34m 4.33° epoch495
Old Hospital 1500 2.31m 5.38° 2.58m 5.77° epoch455
Shop Façade 100 1.46m 8.08° 1.44m 8.26° epoch470
St Mary's Church 250 2.65m 8.48° 2.40m 9.56° epoch470

Citation

@inproceedings{PoseNet15,
  title={PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization},
  author={Alex Kendall, Matthew Grimes and Roberto Cipolla },
  journal={ICCV},
  year={2015}
}
@inproceedings{PoseLSTM17,
  author = {Florian Walch and Caner Hazirbas and Laura Leal-Taixé and Torsten Sattler and Sebastian Hilsenbeck and Daniel Cremers},
  title = {Image-based localization using LSTMs for structured feature correlation},
  month = {October},
  year = {2017},
  booktitle = {ICCV},
  eprint = {1611.07890},
  url = {https://github.com/NavVisResearch/NavVis-Indoor-Dataset},
}

Acknowledgments

Code is inspired by pytorch-CycleGAN-and-pix2pix.

posenet-pytorch's People

Contributors

alanyee avatar andersasa avatar andyli avatar guopzhao avatar jpmerc avatar junyanz avatar lambdawill avatar layumi avatar levirve avatar naruto-sasuke avatar phillipi avatar ruotianluo avatar ssnl avatar strob avatar taesungp avatar tariqahassan avatar tylercarberry avatar

Watchers

 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.