All Projects → fxia22 → Stn.pytorch

fxia22 / Stn.pytorch

Licence: other
pytorch version of spatial transformer networks

Projects that are alternatives of or similar to Stn.pytorch

Gr Satellites
GNU Radio decoders for several Amateur satellites
Stars: ✭ 472 (-1.87%)
Mutual labels:  jupyter-notebook
Practical rl
A course in reinforcement learning in the wild
Stars: ✭ 4,741 (+885.65%)
Mutual labels:  jupyter-notebook
Monk v1
Monk is a low code Deep Learning tool and a unified wrapper for Computer Vision.
Stars: ✭ 480 (-0.21%)
Mutual labels:  jupyter-notebook
Deeplearning.ai Natural Language Processing Specialization
This repository contains my full work and notes on Coursera's NLP Specialization (Natural Language Processing) taught by the instructor Younes Bensouda Mourri and Łukasz Kaiser offered by deeplearning.ai
Stars: ✭ 473 (-1.66%)
Mutual labels:  jupyter-notebook
Introtodeeplearning
Lab Materials for MIT 6.S191: Introduction to Deep Learning
Stars: ✭ 4,955 (+930.15%)
Mutual labels:  jupyter-notebook
Pretty Midi
Utility functions for handling MIDI data in a nice/intuitive way.
Stars: ✭ 477 (-0.83%)
Mutual labels:  jupyter-notebook
Tutorials
Stars: ✭ 471 (-2.08%)
Mutual labels:  jupyter-notebook
Python For Probability Statistics And Machine Learning
Jupyter Notebooks for Springer book "Python for Probability, Statistics, and Machine Learning"
Stars: ✭ 481 (+0%)
Mutual labels:  jupyter-notebook
Docs
TensorFlow documentation
Stars: ✭ 4,999 (+939.29%)
Mutual labels:  jupyter-notebook
Bayesian Analysis Recipes
A collection of Bayesian data analysis recipes using PyMC3
Stars: ✭ 479 (-0.42%)
Mutual labels:  jupyter-notebook
Co Learning Lounge
Welcome to the one point community-driven encyclopedia for anything in technology.
Stars: ✭ 473 (-1.66%)
Mutual labels:  jupyter-notebook
Jupytext
Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
Stars: ✭ 4,969 (+933.06%)
Mutual labels:  jupyter-notebook
Epipolarpose
Self-Supervised Learning of 3D Human Pose using Multi-view Geometry (CVPR2019)
Stars: ✭ 477 (-0.83%)
Mutual labels:  jupyter-notebook
Wfdb Python
Native Python WFDB package
Stars: ✭ 471 (-2.08%)
Mutual labels:  jupyter-notebook
Bayesian Stats Modelling Tutorial
How to do Bayesian statistical modelling using numpy and PyMC3
Stars: ✭ 480 (-0.21%)
Mutual labels:  jupyter-notebook
Thinkcomplexity2
Book and code for Think Complexity, 2nd edition
Stars: ✭ 471 (-2.08%)
Mutual labels:  jupyter-notebook
Tracking My Phone
🕵️‍♀️ 监视我的手机:数据都去哪儿了?
Stars: ✭ 476 (-1.04%)
Mutual labels:  jupyter-notebook
Practical Statistics For Data Scientists
Code repository for O'Reilly book
Stars: ✭ 475 (-1.25%)
Mutual labels:  jupyter-notebook
Jupyterhub Deploy Docker
Reference deployment of JupyterHub with docker
Stars: ✭ 479 (-0.42%)
Mutual labels:  jupyter-notebook
Nothotdog Classifier
What would you say if I told you there is a app on the market that tell you if you have a hotdog or not a hotdog.
Stars: ✭ 479 (-0.42%)
Mutual labels:  jupyter-notebook

PyTorch version of spatial transformer network

Ported from https://github.com/qassemoquab/stnbhwd according to pytorch tutorial. Now support CPU and GPU. To use the ffi you need to install the cffi package from pip.

Build and test

cd script
./make.sh #build cuda code, don't forget to modify -arch argument for your GPU computational capacity version
python build.py
python test.py

There is a demo in test_stn.ipynb

Modules

STN is the spatial transformer module, it takes a B*H*W*D tensor and a B*H*W*2 grid normalized to [-1,1] as an input and do bilinear sampling.

AffineGridGen takes a B*2*3 matrix and generate an affine transformation grid.

CylinderGridGen takes a B*1 theta vector and generate a transformation grid to remap equirectangular images along x axis.

DenseAffineGridGen takes a B*H*W*6 tensor and do affine transformation for each pixel. Example of convolutional spatial transformer can be found in test_conv_stn.ipynb.

An example of the landscape of the loss function of a simple STN with L1 Loss can be found in the demo.

Train hacks

  • set a learning rate multiplier, 1e-3 or 1e-4 would work fine.
  • add an auxiliary loss to regularized the difference of the affine transformation from identity mapping, to aviod sampling outside the original image.

Complex grid demo

STN is able to handle a complex grid, however, how to parameterize the grid is a problem.

image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].