mirror of
https://github.com/graphdeco-inria/gaussian-splatting
synced 2025-03-29 03:43:27 +00:00
run succeed
This commit is contained in:
parent
29b974ed47
commit
29de835916
@ -45,7 +45,8 @@ def render(viewpoint_camera, pc : GaussianModel, pipe, bg_color : torch.Tensor,
|
||||
sh_degree=pc.active_sh_degree,
|
||||
campos=viewpoint_camera.camera_center,
|
||||
prefiltered=False,
|
||||
debug=pipe.debug
|
||||
debug=pipe.debug,
|
||||
clamp_color=True
|
||||
)
|
||||
|
||||
rasterizer = GaussianRasterizer(raster_settings=raster_settings)
|
||||
|
@ -1,7 +1,7 @@
|
||||
Running:
|
||||
# Train with train/test split
|
||||
python train.py --source_path <path to COLMAP or NeRF Synthetic dataset> --model_path <保存路径> --eval
|
||||
python train.py --source_path /media/liuzhi/b4608ade-d2e0-430d-a40b-f29a8b22cb8c/Dataset/3DGS_Dataset/湘家荡 --model_path output/xiangjiadang --eval --resolution 1
|
||||
python train.py --source_path ../../Dataset/3DGS_Dataset/科技馆 --model_path output/kejiguan --eval --resolution 1
|
||||
|
||||
--source_path / -s:COLMAP 或合成 Synthetic NeRF data set的源目录的路径。COLMAP类型包含 images/, sparse/0
|
||||
--model_path / -m:训练模型的存储路径,默认为 output/<random>
|
||||
|
12
run_train_ours.py
Normal file
12
run_train_ours.py
Normal file
@ -0,0 +1,12 @@
|
||||
# python train.py --source_path ../../Dataset/3DGS_Dataset/凌公塘 --model_path output/linggongtang --eval --resolution 1
|
||||
# scene: {'科技馆': 'kejiguan', '万佛塔': 'wanfota', '植物': 'zhiwu', '凌公塘': 'linggongtang', '湘家荡': 'xiangjiadang', '寺平古宅': 'sipingguzhai'}
|
||||
# : {'科技馆': ['kejiguan', 'cuda'], '万佛塔': ['wanfota', 'cuda'], '植物': ['zhiwu', 'cuda'], '凌公塘': ['linggongtang', 'cpu'], '湘家荡': ['xiangjiadang', 'cpu'], '寺平古宅': ['sipingguzhai', 'cpu']}
|
||||
# device = cuda: 科技馆、万佛塔、植物
|
||||
# = cpu: 凌公塘、湘家荡、寺平古宅
|
||||
|
||||
import os
|
||||
|
||||
for cuda, scene in enumerate({'科技馆': ['kejiguan', 'cuda'], '湘家荡': ['xiangjiadang', 'cpu'], '凌公塘': ['linggongtang', 'cpu'], '寺平古宅': ['sipingguzhai', 'cpu'],}.items()):
|
||||
print('---------------------------------------------------------------------------------')
|
||||
one_cmd = f'python train.py --source_path ../../Dataset/3DGS_Dataset/{scene[0]} --model_path output/{scene[1][0]} --data_device "{scene[1][1]}" --resolution 1 --eval'
|
||||
os.system(one_cmd)
|
@ -109,8 +109,11 @@ def readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder):
|
||||
# 如果不是以上两种模型,抛出错误
|
||||
assert False, "Colmap camera model not handled: only undistorted datasets (PINHOLE or SIMPLE_PINHOLE cameras) supported!"
|
||||
|
||||
image_path = os.path.join(images_folder, os.path.basename(extr.name))
|
||||
image_path = os.path.join(images_folder, extr.name)
|
||||
image_name = os.path.basename(image_path).split(".")[0]
|
||||
|
||||
if not os.path.exists(image_path):
|
||||
continue
|
||||
image = Image.open(image_path)
|
||||
|
||||
cam_info = CameraInfo(uid=uid, R=R, T=T, FovY=FovY, FovX=FovX, image=image,
|
||||
@ -118,6 +121,7 @@ def readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder):
|
||||
cam_infos.append(cam_info)
|
||||
# 在读取完所有相机信息后换行
|
||||
sys.stdout.write('\n')
|
||||
print("valid Colmap camera size: {}".format(len(cam_infos)))
|
||||
|
||||
# 返回整理好的相机信息列表
|
||||
return cam_infos
|
||||
|
Loading…
Reference in New Issue
Block a user