Skip to content

Commit

Permalink
update but not tested
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Tu committed Nov 14, 2022
1 parent ec80bbc commit 87ffa05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions BoostingMonocularDepth
Submodule BoostingMonocularDepth added at 95bdf0
2 changes: 1 addition & 1 deletion argument.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ load_ply: False
save_ply: True
inference_video: True
gpu_ids: 0
offscreen_rendering: True
offscreen_rendering: False
img_format: '.jpg'
depth_format: '.npy'
require_midas: True
Expand Down
11 changes: 9 additions & 2 deletions boostmonodepth_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import glob
import numpy as np
import imageio
import platform
from MiDaS.MiDaS_utils import write_depth

BOOST_BASE = 'BoostingMonocularDepth'
Expand All @@ -23,7 +24,10 @@ def run_boostmonodepth(img_names, src_folder, depth_folder):
for img_name in img_names:
base_name = os.path.basename(img_name)
tgt_name = os.path.join(BOOST_BASE, BOOST_INPUTS, base_name)
os.system(f'cp {img_name} {tgt_name}')
if platform.system() == 'Windows':
os.system(f'copy {img_name} {tgt_name}')
else:
os.system(f'cp {img_name} {tgt_name}')

# keep only the file name here.
# they save all depth as .png file
Expand Down Expand Up @@ -51,7 +55,10 @@ def clean_folder(folder, img_exts=['.png', '.jpg', '.npy']):
if len(glob.glob(paths_to_check)) == 0:
continue
print(paths_to_check)
os.system(f'rm {paths_to_check}')
if platform.system() == 'Windows':
os.system(f'del {paths_to_check}')
else:
os.system(f'rm {paths_to_check}')

def resize_depth(depth, width, height):
"""Resize numpy (or image read by imageio) depth map
Expand Down
10 changes: 5 additions & 5 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ python config.py
mkdir -p ./KenBurns/Input
mkdir -p ./KenBurns/Output

pip install vispy
pip install moviepy
pip install transforms3d
pip install networkx
pip install opencv-python
pip install vispy==0.6.4
pip install moviepy==1.0.3
pip install transforms3d==0.3.1
pip install networkx==2.3
pip install opencv-python==4.2.0.32
pip install pyqt5
pip install scipy==1.9.2
pip install pyyaml==6.0
Expand Down

0 comments on commit 87ffa05

Please sign in to comment.