Code repository for "Free View Synthesis", ECCV 2020.

Overview

Free View Synthesis

Code repository for "Free View Synthesis", ECCV 2020.

Setup

Install the following Python packages in your Python environment

- numpy (1.19.1)
- scikit-image (0.15.0)
- pillow (7.2.0)
- pytorch (1.6.0)
- torchvision (0.7.0)

Clone the repository and initialize the submodule

git clone https://github.com/intel-isl/FreeViewSynthesis.git
cd FreeViewSynthesis
git submodule update --init --recursive

Finally, build the Python extension needed for preprocessing

cd ext/preprocess
cmake -DCMAKE_BUILD_TYPE=Release .
make 

Tested with Ubuntu 18.04 and macOS Catalina. If you do not have a C++17 compatible compiler, you can change the code as descibed here.

Run Free View Synthesis

Make sure you adapted the paths in config.py to point to the downloaded data!

You can download the pre-trained models here

# in FreeViewSynthesis directory
wget https://storage.googleapis.com/isl-datasets/FreeViewSynthesis/experiments.tar.gz
tar xvzf experiments.tar.gz
# there should now be net*params files in exp/experiments/*/

Then run the evaluation via

python exp.py --net rnn_vgg16unet3_gruunet4.64.3 --cmd eval --iter last --eval-dsets tat-subseq --eval-scale 0.5

This will run the pretrained network on the four Tanks and Temples sequences.

To train the network from scratch you can run

python exp.py --net rnn_vgg16unet3_gruunet4.64.3 --cmd retrain

Data

We provide the preprocessed Tanks and Temples dataset as we used it for training and evaluation here. Our new recordings can be downloaded in a preprocessed version from here.

We used COLMAP for camera registration, multi-view stereo and surface reconstruction on full resolution. The packages above contain the already undistorted and registered images. In addition, we provide the estimated camera calibrations, rendered depthmaps used for warping, and closest source image information.

In more detail, a single folder ibr3d_*_scale (where scale is the scale factor with respect to the original images) contains:

  • im_XXXXXXXX.[png|jpg] the downsampled images used as source images, or as target images.
  • dm_XXXXXXXX.npy the rendered depthmaps based on the COLMAP surface reconstruction.
  • Ks.npy contains the 3x3 intrinsic camera matrices, where Ks[idx] corresponds to the depth map dm_{idx:08d}.npy.
  • Rs.npy contains the 3x3 rotation matrices from the world coordinate system to camera coordinate system.
  • ts.npy contains the 3 translation vectors from the world coordinate system to camera coordinate system.
  • count_XXXXXXXX.npy contains the overlap information from target images to source images. I.e., the number of pixels that can be mapped from the target image to the individual source images. np.argsort(np.load('count_00000000.npy'))[::-1] will give you the sorted indices of the most overlapping source images.

Use np.load to load the numpy files.

We use the Tanks and Temples dataset for training except the following scenes that are used for evaluation.

  • train/Truck [172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196]
  • intermediate/M60 [94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]
  • intermediate/Playground [221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252]
  • intermediate/Train [174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248]

The numbers below the scene name indicate the indices of the target images that we used for evaluation.

Citation

Please cite our paper if you find this work useful.

@inproceedings{Riegler2020FVS,
  title={Free View Synthesis},
  author={Riegler, Gernot and Koltun, Vladlen},
  booktitle={European Conference on Computer Vision},
  year={2020}
}

Video

Free View Synthesis Video

Comments
  • Make

    Make

    Hello,thank you for sharing the source code. But When I executed the "make" command,such a error occured: /ext/preprocess/preprocess.cpp:272:74: error: converting to ‘std::tuple<pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16>}; <template-parameter-2-2> = void; _Elements = {pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16>}]’ {n_views, 1, patch_height, patch_width})};

    is there some wrong in preprocess.cpp?

    opened by Jonlysun 10
  • has no attribute 'get_sampling_map'

    has no attribute 'get_sampling_map'

    Hi, Thank you very much for sharing your code. But when I run your code, the following error occurs:

    /FreeViewSynthesis/exp/dataset.py", line 165, in base_getitem sampling_maps, valid_depth_masks, valid_map_masks = ext.preprocess.get_sampling_map( AttributeError: module 'ext.preprocess' has no attribute 'get_sampling_map'

    Hope you can help answer, thank you.

    opened by shuochen365 9
  • Prepare customized dataset

    Prepare customized dataset

    Hi Riegler, thank you for this great work in view synthesis. It is really appreciated that you have provided you preprocessed dataset and training/eval code. May I know how to preprocess our customized dataset (a few images) so that we can apply this method directly on it?

    opened by lzhangbj 7
  • Change the camera parameters, but get the same output

    Change the camera parameters, but get the same output

    Hi @griegler, When I try to modify the Ks.npy/Rs.npy/ts.npy for synthesis new view images, the output results are always the same as the original camera parameters' output, hope you can help, thanks~

    opened by visonpon 6
  • IndexError while running exp.py

    IndexError while running exp.py

    while running

    python exp.py --net rnn_vgg16unet3_gruunet4.64.3 --cmd eval --iter last --eval-dsets tat-subseq --eval-scale 0.5
    

    I get the error: IndexError: index 221 is out of bounds for axis 0 with size 0

    Screenshot from 2020-12-12 16-33-24

    I modified my path to point Playground dataset in config and commented truck, M60 and train eval tracks.

    opened by avani17101 4
  • Percetual Loss

    Percetual Loss

    for midx, mod in enumerate(self.vgg): es = mod(es)

    for i,mod in enumerate(vgg): ... if i == 3: ... print(mod) ... ReLU(inplace=True)

    I can't understand this,why?

    opened by nicksunyang 3
  • How to change the dense outputs put from colmap into those in dataset.

    How to change the dense outputs put from colmap into those in dataset.

    Hi! When I tried to test my own image data, I was blocked for the gap between dense file output by Colmap and the downloaded dataset. It seems to be hard for me to make this translation. Could you give me some hits for it? For example, a script. Sincerely thanks. The output of the colmap is as following. image The official output describe can be found here: +── images │ +── image1.jpg │ +── image2.jpg │ +── ... +── sparse │ +── cameras.txt │ +── images.txt │ +── points3D.txt +── stereo │ +── consistency_graphs │ │ +── image1.jpg.photometric.bin │ │ +── image2.jpg.photometric.bin │ │ +── ... │ +── depth_maps │ │ +── image1.jpg.photometric.bin │ │ +── image2.jpg.photometric.bin │ │ +── ... │ +── normal_maps │ │ +── image1.jpg.photometric.bin │ │ +── image2.jpg.photometric.bin │ │ +── ... │ +── patch-match.cfg │ +── fusion.cfg +── fused.ply +── meshed-poisson.ply +── meshed-delaunay.ply +── run-colmap-geometric.sh +── run-colmap-photometric.sh

    opened by tianyilt 3
  • how to set tat_root in config.py

    how to set tat_root in config.py

    Hi, thanks for your great work. I just want to eval the result by python exp.py --net rnn_vgg16unet3_gruunet4.64.3 --cmd eval --iter last --eval-dsets tat-subseq --eval-scale 0.5 in exp folder. I'm confused about the following code in config.py:

    # TODO: adjust path
    tat_root = Path("/path/to/colmap_tat/")
    

    And I notice that config.tat_root was used in exp.py

        def get_train_set_tat(self, dset):
            dense_dir = config.tat_root / dset / "dense"
            print(dense_dir,'------------------------------------------------------------')
            ibr_dir = dense_dir / f"ibr3d_pw_{self.train_scale:.2f}"
            dset = self.get_pw_dataset(
                name=f'tat_{dset.replace("/", "_")}',
                ibr_dir=ibr_dir,
                im_size=None,
                pad_width=16,
                patch=(self.train_patch, self.train_patch),
                n_nbs=self.train_n_nbs,
                nbs_mode=self.train_nbs_mode,
                train=True,
            )
            return dset
    

    I'm curious about why exp.py will load tat_train_sets when I try to eval the result with the given pretrained model. It seems that the path list in

    tat_train_sets = [
        "training/Barn",
        "training/Caterpillar",
        "training/Church",
        "training/Courthouse",
        "training/Ignatius",
        "training/Meetingroom",
        "intermediate/Family",
        "intermediate/Francis",
        "intermediate/Horse",
        "intermediate/Lighthouse",
        "intermediate/Panther",
        "advanced/Auditorium",
        "advanced/Ballroom",
        "advanced/Museum",
        "advanced/Temple",
        "advanced/Courtroom",
        "advanced/Palace",
    ]
    

    isn't exist in this rep.

    opened by tianyilt 3
  • Reconstructed mesh from COLMAP

    Reconstructed mesh from COLMAP

    Hi,

    Thanks for sharing the preprocessed dataset.

    I am wondering if you still have the reconstructed meshes for the dataset produced by COLMAP? Would it be possible to share them?

    Thanks a lot.

    opened by yongsiang-fb 2
  • Proxy-geometry generation pipeline

    Proxy-geometry generation pipeline

    Hi, This is great work!! Thank you for making your code public :)

    I'm trying to use your proxy-geometry generation pipeline using the scripts in co/colmap.py but am not a 100% sure I'm doing it right. Is this how you generated the meshes in your paper? Thanks in advance!

    colmap = Colmap(...)
    colmap.sparse_reconstruction_unknown_calib()
    colmap.dense_reconstruction()
    colmap.delaunay_meshing()
    
    opened by shubham-goel 2
  • Why is image coordinate multiplied by 2 when generating sampling_maps

    Why is image coordinate multiplied by 2 when generating sampling_maps

    opened by CurtisFu 2
  • DTU groundtruth meshes

    DTU groundtruth meshes

    Hi,

    Thanks for the wonderful work. I was wondering about how you obtained your DTU ground truth meshes. Was it the same way you obtained them for tanks and temples? If yes, would it be possible to share them?

    Thanks in advance

    opened by Shubhendu-Jena 0
  • method to generate camera path

    method to generate camera path

    Hi @griegler, thanks for your generous share, I have succeeded to generate some new view images using your scripts. but I also curious about how to generate some random camera path like pitch angle instead of just interpolate the original camera(def interpolate_waypoints) path so that the new views are more abundant and variable. thanks~

    opened by visonpon 0
  • fix format_err_str function in mytorch.py

    fix format_err_str function in mytorch.py

    Hey, Thanks for your help and I succeed in run it. But there may exist some little bug. I try to fix this error type: list has no attribute ravel. The error raises if we run the following: python exp.py --net rnn_vgg16unet3_gruunet4.64.3 --cmd eval --iter last --eval-dsets tat-subseq --eval-scale 0.5 Only np array has attribute ravel. But isinstance(v, (np.ndarray, list)) make list operate list.ravel which will cause error.

    Sorry for me can't provide the snapshot because I get off work and forget to save.

    opened by tianyilt 0
Owner
Intelligent Systems Lab Org
Intelligent Systems Lab Org
Code for our paper at ECCV 2020: Post-Training Piecewise Linear Quantization for Deep Neural Networks

PWLQ Updates 2020/07/16 - We are working on getting permission from our institution to release our source code. We will release it once we are granted

null 54 Dec 15, 2022
Code for the paper: Adversarial Training Against Location-Optimized Adversarial Patches. ECCV-W 2020.

Adversarial Training Against Location-Optimized Adversarial Patches arXiv | Paper | Code | Video | Slides Code for the paper: Sukrut Rao, David Stutz,

Sukrut Rao 32 Dec 13, 2022
Code for the paper "Improving Vision-and-Language Navigation with Image-Text Pairs from the Web" (ECCV 2020)

Improving Vision-and-Language Navigation with Image-Text Pairs from the Web Arjun Majumdar, Ayush Shrivastava, Stefan Lee, Peter Anderson, Devi Parikh

Arjun Majumdar 44 Dec 14, 2022
Code for ECCV 2020 paper "Contacts and Human Dynamics from Monocular Video".

Contact and Human Dynamics from Monocular Video This is the official implementation for the ECCV 2020 spotlight paper by Davis Rempe, Leonidas J. Guib

Davis Rempe 207 Jan 5, 2023
Code for Towards Streaming Perception (ECCV 2020) :car:

sAP — Code for Towards Streaming Perception ECCV Best Paper Honorable Mention Award Feb 2021: Announcing the Streaming Perception Challenge (CVPR 2021

Martin Li 85 Dec 22, 2022
Code for paper ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization in the Loop.

Who Left the Dogs Out? Evaluation and demo code for our ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization

Benjamin Biggs 29 Dec 28, 2022
PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network"

HAN PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network" This repository is for HAN introduced in the

五维空间 140 Nov 23, 2022
Source code for "Progressive Transformers for End-to-End Sign Language Production" (ECCV 2020)

Progressive Transformers for End-to-End Sign Language Production Source code for "Progressive Transformers for End-to-End Sign Language Production" (B

null 58 Dec 21, 2022
[ECCV 2020] Reimplementation of 3DDFAv2, including face mesh, head pose, landmarks, and more.

Stable Head Pose Estimation and Landmark Regression via 3D Dense Face Reconstruction Reimplementation of (ECCV 2020) Towards Fast, Accurate and Stable

Remilia Scarlet 221 Dec 30, 2022
1st Place Solution to ECCV-TAO-2020: Detect and Represent Any Object for Tracking

Instead, two models for appearance modeling are included, together with the open-source BAGS model and the full set of code for inference. With this code, you can achieve around mAP@23 with TAO test set (based on our estimation).

null 79 Oct 8, 2022
git《Learning Pairwise Inter-Plane Relations for Piecewise Planar Reconstruction》(ECCV 2020) GitHub:

Learning Pairwise Inter-Plane Relations for Piecewise Planar Reconstruction Code for the ECCV 2020 paper by Yiming Qian and Yasutaka Furukawa Getting

null 37 Dec 4, 2022
dataset for ECCV 2020 "Motion Capture from Internet Videos"

Motion Capture from Internet Videos Motion Capture from Internet Videos Junting Dong*, Qing Shuai*, Yuanqing Zhang, Xian Liu, Xiaowei Zhou, Hujun Bao

ZJU3DV 98 Dec 7, 2022
《Unsupervised 3D Human Pose Representation with Viewpoint and Pose Disentanglement》(ECCV 2020) GitHub: [fig9]

Unsupervised 3D Human Pose Representation [Paper] The implementation of our paper Unsupervised 3D Human Pose Representation with Viewpoint and Pose Di

null 42 Nov 24, 2022
SNE-RoadSeg in PyTorch, ECCV 2020

SNE-RoadSeg Introduction This is the official PyTorch implementation of SNE-RoadSeg: Incorporating Surface Normal Information into Semantic Segmentati

null 242 Dec 20, 2022
[ECCV 2020] Gradient-Induced Co-Saliency Detection

Gradient-Induced Co-Saliency Detection Zhao Zhang*, Wenda Jin*, Jun Xu, Ming-Ming Cheng ⭐ Project Home » The official repo of the ECCV 2020 paper Grad

Zhao Zhang 35 Nov 25, 2022
PyTorch implementation of ECCV 2020 paper "Foley Music: Learning to Generate Music from Videos "

Foley Music: Learning to Generate Music from Videos This repo holds the code for the framework presented on ECCV 2020. Foley Music: Learning to Genera

Chuang Gan 30 Nov 3, 2022
Sign Language Translation with Transformers (COLING'2020, ECCV'20 SLRTP Workshop)

transformer-slt This repository gathers data and code supporting the experiments in the paper Better Sign Language Translation with STMC-Transformer.

Kayo Yin 107 Dec 27, 2022
IAST: Instance Adaptive Self-training for Unsupervised Domain Adaptation (ECCV 2020)

This repo is the official implementation of our paper "Instance Adaptive Self-training for Unsupervised Domain Adaptation". The purpose of this repo is to better communicate with you and respond to your questions. This repo is almost the same with Another-Version, and you can also refer to that version.

CVSM Group -  email: czhu@bupt.edu.cn 84 Dec 12, 2022
Boundary-preserving Mask R-CNN (ECCV 2020)

BMaskR-CNN This code is developed on Detectron2 Boundary-preserving Mask R-CNN ECCV 2020 Tianheng Cheng, Xinggang Wang, Lichao Huang, Wenyu Liu Video

Hust Visual Learning Team 178 Nov 28, 2022