Skip to content

Commit

Permalink
easyvolcap: update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Apr 5, 2024
1 parent f8e2907 commit 89e6a3b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
14 changes: 13 additions & 1 deletion configs/datasets/mobile_stage/dance3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ dataloader_cfg: # we see the term "dataloader" as one word?
masks_dir: bgmtv2
# bounds: [[-2.6625, -2.1826, -1.0188], [0.8725, 0.9999, 1.4587]] # thinner?
bounds: [[-10.0, -10.0, -3.0], [10.0, 10.0, 3.0]] # thinner?
# bounds: [[-15.0, -15.0, -5.0], [15.0, 15.0, 5.0]] # thinner?
near: 1.5 # large enough
far: 18.0 # large enough
far: 100.0 # large enough

vhull_thresh: 0.85 # 21 cameras?
count_thresh: 4 # more visibility
Expand All @@ -26,3 +27,14 @@ dataloader_cfg: # we see the term "dataloader" as one word?
val_dataloader_cfg:
dataset_cfg:
<<: *dataset_cfg

viewer_cfg:
camera_cfg:
# prettier-ignore
R: [[0.9900417923927307,-0.14077377319335938,0.0],[-0.02820173278450966,-0.19833874702453613,-0.9797297120094299],[0.13792024552822113,0.9699733257293701,-0.20033371448516846]]
# prettier-ignore
T: [[-0.13352864980697632],[-0.6429579854011536],[5.76825475692749]]
# prettier-ignore
K: [[1227.75,0.0,946.7529907226562],[0.0,1219.8775634765625,548.2080078125],[0.0,0.0,1.0]]
n: 2.5
# {"H":768,"W":1366,"K":[[1227.75,0.0,946.7529907226562],[0.0,1219.8775634765625,548.2080078125],[0.0,0.0,1.0]],"R":[[0.9900417923927307,-0.14077377319335938,0.0],[-0.02820173278450966,-0.19833874702453613,-0.9797297120094299],[0.13792024552822113,0.9699733257293701,-0.20033371448516846]],"T":[[-0.13352864980697632],[-0.6429579854011536],[5.76825475692749]],"n":1.5,"f":100.0,"t":0.7299925088882446,"v":0.0,"bounds":[[-10.0,-10.0,-3.0],[10.0,10.0,3.0]],"mass":0.10000000149011612,"moment_of_inertia":0.10000000149011612,"movement_force":1.0,"movement_torque":1.0,"movement_speed":1.0,"origin":[0.37696364521980286,-0.06292950361967087,-0.2327267974615097],"world_up":[0.0,0.0,1.0]}
4 changes: 2 additions & 2 deletions scripts/nerf/easyvolcap_to_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def convertRT(RT0):
@catch_throw
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--data_root', type=str, default='/mnt/data/home/xuzhen/projects/large_gaussian/demo/cameras/00')
parser.add_argument('--out_file', type=str, default='/mnt/data/home/xuzhen/projects/large_gaussian/demo/trajectories/path0.json')
parser.add_argument('--data_root', type=str, default='/mnt/remote/D002/home/xuzhen/projects/large_gaussian/demo/cameras/00')
parser.add_argument('--out_file', type=str, default='/mnt/remote/D002/home/xuzhen/projects/large_gaussian/demo/trajectories/path0.json')
parser.add_argument('--images_dir', type=str, default='images')
parser.add_argument('--img_ext', type=str, default='.png', help='Only used when not using a multi_frame_dataset for contructing file_path')
parser.add_argument('--image_file', type=str, default='000000.jpg', help='Only used when --multi_frame_dataset for contructing file_path')
Expand Down
6 changes: 3 additions & 3 deletions scripts/nerf/nerf_to_easyvolcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
@catch_throw
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--nerf_root', type=str, default='/mnt/data/home/xuzhen/projects/large_gaussian/hospital')
parser.add_argument('--volcap_root', type=str, default='/mnt/data/home/xuzhen/projects/large_gaussian/hospital')
parser.add_argument('--nerf_root', type=str, default='/mnt/data2/home/shuaiqing/Code/gaussian-splatting-origin/data/Campus/4')
parser.add_argument('--volcap_root', type=str, default='/mnt/data2/home/shuaiqing/Code/gaussian-splatting-origin/data/Campus/4')
parser.add_argument('--transforms_file', type=str, default='transforms_train.json')
parser.add_argument('--intri_file', type=str, default='cameras_train/00/intri.yml')
parser.add_argument('--extri_file', type=str, default='cameras_train/00/extri.yml')
Expand Down Expand Up @@ -66,7 +66,7 @@ def main():
)
log(yellow(f'Converted cameras saved to {blue(join(args.volcap_root, f"{{{args.intri_file},{args.extri_file}}}"))}'))

if args.organize_images and len(transforms.frames) and exists(transforms.frames[0].file_path):
if args.organize_images and len(transforms.frames) and exists(join(args.nerf_root, transforms.frames[0].file_path)):
run(f'python scripts/nerf/organize_images.py --nerf_root {args.nerf_root} --volcap_root {args.volcap_root} --transforms_file {args.transforms_file} --images_dir {args.images_dir}')

if args.transforms_file.endswith('_train.json') and \
Expand Down

0 comments on commit 89e6a3b

Please sign in to comment.