Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 2.03 KB

README.md

File metadata and controls

54 lines (44 loc) · 2.03 KB

NDDR-CNN-PyTorch

PyTorch Implementation of NDDR-CNN

Usage

Requirements

  • PyTorch 1.1
  • NumPy
  • YACS
  • PIL
  • tensorboardX
  • argparse
  • tqdm

Setup

The above dependencies can be installed by the following commands via pip:

$ pip install torch torchvision numpy yacs pillow tensorboardX argparse tqdm

Dataset

Follow the instruction in the official repository to prepare the dataset. Then Download the converted PyTorch models from here, then create a weights directory and unzip the models inside.

When you are all set, you should have the following file structure:

datasets/nyu_v2/list
datasets/nyu_v2/nyu_train_val
weights/vgg_deeplab_lfov/tf_deeplab.pth
weights/nyu_v2/tf_finetune_seg.pth
weights/nyu_v2/tf_finetune_normal.pth

Training

All the arguments to train/eval an NDDR-CNN are shown in configs/defaults.py. The configuration files for different experiments are also provided in the configs directory. For example, to train an NDDR-CNN with VGG-16-shortcut architecture, simply call:

$ CUDA_VISIBLE_DEVICES=0 python train.py --config-file configs/vgg16_nddr_shortcut_sing.yaml

Evaluation

To evaluate an NDDR-CNN with VGG-16-shortcut architecture, call:

$ CUDA_VISIBLE_DEVICES=0 python eval.py --config-file configs/vgg16_nddr_shortcut_sing.yaml

Downloads

  • Preprocessed Dataset (link)
  • PyTorch weight initializations converted from TensorFlow pretrained models (link)
  • A rough script for converting TensorFlow model to PyTorch is available here

Reference: