Skip to content

Commit 97657ee

Browse files
committed
add demo code
1 parent b2b9e44 commit 97657ee

27 files changed

+3440
-1
lines changed

License.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2020 Robin Rombach and Patrick Esser and Björn Ommer
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
OR OTHER DEALINGS IN THE SOFTWARE./

README.md

+80-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
[Björn Ommer](https://hci.iwr.uni-heidelberg.de/Staff/bommer)<br/>
88
\* equal contribution
99

10+
[arXiv](https://arxiv.org/abs/2104.07652) | [BibTeX](#bibtex)
11+
1012
### Interactive Scene Exploration Results
1113

1214
[RealEstate10K](https://google.github.io/realestate10k/):<br/>
@@ -17,4 +19,81 @@ Videos: [short (2min)](assets/realestate_short.mp4) / [long (12min)](assets/real
1719
<a href="assets/acid_short.mp4">![acid](assets/acid_preview.gif)</a><br/>
1820
Videos: [short (2min)](assets/acid_short.mp4) / [long (9min)](assets/acid_long.mp4)
1921

20-
Code coming soon.
22+
### Demo
23+
24+
#### Installation
25+
26+
The demo requires building a PyTorch extension. If you have a sane development
27+
environment with PyTorch, g++ and nvcc, you can simply
28+
29+
```
30+
pip install git+https://github.com/CompVis/geometry-free-view-synthesis#egg=geometry-free-view-synthesis
31+
```
32+
33+
If you run into problems and have a GPU with compute capability below 8, you
34+
can also use the provided conda environment:
35+
36+
```
37+
git clone https://github.com/CompVis/geometry-free-view-synthesis
38+
conda env create -f geometry-free-view-synthesis/environment.yaml
39+
conda activate geofree
40+
pip install geometry-free-view-synthesis/
41+
```
42+
43+
#### Running
44+
45+
After [installation](#installation), running
46+
47+
```
48+
braindance.py
49+
```
50+
51+
will start the demo on [a sample scene](http://walledoffhotel.com/rooms.html).
52+
Explore the scene interactively using the `WASD` keys to move and `arrow keys` to
53+
look around. Once positioned, hit the `space bar` to render the novel view with
54+
GeoGPT.
55+
56+
You can move again with WASD keys. Mouse control can be activated with the m
57+
key. Run `braindance.py <folder to select image from/path to image>` to run the
58+
demo on your own images. By default, it uses the `re-impl-nodepth` (trained on
59+
RealEstate without explicit transformation and no depth input) which can be
60+
changed with the `--model` flag. The corresponding checkpoints will be
61+
downloaded the first time they are required. Specify an output path using
62+
`--video path/to/vid.mp4` to record a video.
63+
64+
```
65+
> braindance.py -h
66+
usage: braindance.py [-h] [--model {re_impl_nodepth,re_impl_depth}] [--video [VIDEO]] [path]
67+
68+
What's up, BD-maniacs?
69+
70+
key(s) action
71+
=====================================
72+
wasd move around
73+
arrows look around
74+
m enable looking with mouse
75+
space render with transformer
76+
q quit
77+
78+
positional arguments:
79+
path path to image or directory from which to select image. Default example is used if not specified.
80+
81+
optional arguments:
82+
-h, --help show this help message and exit
83+
--model {re_impl_nodepth,re_impl_depth}
84+
pretrained model to use.
85+
--video [VIDEO] path to write video recording to. (no recording if unspecified).
86+
```
87+
88+
## BibTeX
89+
90+
```
91+
@misc{rombach2021geometryfree,
92+
title={Geometry-Free View Synthesis: Transformers and no 3D Priors},
93+
author={Robin Rombach and Patrick Esser and Björn Ommer},
94+
year={2021},
95+
eprint={2104.07652},
96+
archivePrefix={arXiv},
97+
primaryClass={cs.CV}
98+
}
99+
```

environment.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: geofree
2+
channels:
3+
- pytorch
4+
- defaults
5+
- conda-forge
6+
dependencies:
7+
- python=3.8.5
8+
- pip=20.3
9+
- cudatoolkit=10.1
10+
- cudatoolkit-dev=10.1.243 # for nvcc
11+
- gcc_linux-64=7.3.0 # for nvcc compatibility
12+
- gxx_linux-64=7.3.0 # for nvcc compatibility
13+
- pytorch=1.7.1
14+
- torchvision=0.8.2
15+
- numpy=1.19.2

geofree/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from geofree.util import pretrained_models

geofree/examples/__init__.py

Whitespace-only changes.

geofree/examples/artist.jpg

170 KB
Loading

0 commit comments

Comments
 (0)