Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to Windows #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 -c pytorch
pip install -r requirements.txt
```
- Install [ImageMagick](https://www.imagemagick.org/).

On Linux:
```
sudo apt-get install imagemagick
```

On Windows [download it from the official site](https://imagemagick.org/script/download.php#windows) and make sure to check these two options during the installation: 1) Add application directory to your system path 2) Install legacy utilities.

- We use COLMAP to calculate poses and sparse depths. However, original COLMAP does not have fusion mask for each view. Thus, we add masks to COLMAP and denote it as a submodule. Please follow https://colmap.github.io/install.html to install COLMAP in `./colmap` folder (Note that do not cover colmap folder with the original version).

## Usage
Expand Down
13 changes: 10 additions & 3 deletions src/load_llff.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ def _minify(basedir, factors=[], resolutions=[]):
print('Minifying', r, basedir)

os.makedirs(imgdir)
check_output('cp {}/* {}'.format(imgdir_orig, imgdir), shell=True)

if os.name == 'nt':
check_output('copy "{}\" "{}"'.format(imgdir_orig.replace('/','\\'), imgdir.replace('/','\\')), shell=True)
else:
check_output('cp {}/* {}'.format(imgdir_orig, imgdir), shell=True)

ext = imgs[0].split('.')[-1]
args = ' '.join(['mogrify', '-resize', resizearg, '-format', 'png', '*.{}'.format(ext)])
print(args)
Expand All @@ -57,7 +60,11 @@ def _minify(basedir, factors=[], resolutions=[]):
os.chdir(wd)

if ext != 'png':
check_output('rm {}/*.{}'.format(imgdir, ext), shell=True)
if os.name == 'nt':
check_output('del "{}\*.{}"'.format(imgdir, ext), shell=True)
else:
check_output('rm {}/*.{}'.format(imgdir, ext), shell=True)

print('Removed duplicates')
print('Done')

Expand Down
11 changes: 9 additions & 2 deletions utils/pose_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ def minify(basedir, factors=[], resolutions=[]):
print('Minifying', r, basedir)

os.makedirs(imgdir)
check_output('cp {}/* {}'.format(imgdir_orig, imgdir), shell=True)
if os.name == 'nt':
check_output('copy "{}\" "{}"'.format(imgdir_orig, imgdir), shell=True)
else:
check_output('cp {}/* {}'.format(imgdir_orig, imgdir), shell=True)

ext = imgs[0].split('.')[-1]
args = ' '.join(['mogrify', '-resize', resizearg, '-format', 'png', '*.{}'.format(ext)])
Expand All @@ -202,7 +205,11 @@ def minify(basedir, factors=[], resolutions=[]):
os.chdir(wd)

if ext != 'png':
check_output('rm {}/*.{}'.format(imgdir, ext), shell=True)
if os.name == 'nt':
check_output('del "{}\*.{}"'.format(imgdir, ext), shell=True)
else:
check_output('rm {}/*.{}'.format(imgdir, ext), shell=True)

print('Removed duplicates')
print('Done')

Expand Down