|
|
|
@ -23,26 +23,21 @@ class ModelProcessor: |
|
|
|
# argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [] |
|
|
|
# argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [] |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
|
|
|
|
|
|
|
|
parser.add_argument( |
|
|
|
|
|
|
|
"--id", |
|
|
|
|
|
|
|
required=True, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#""" |
|
|
|
#""" |
|
|
|
parser.add_argument( |
|
|
|
parser.add_argument( |
|
|
|
"--base_path", |
|
|
|
"--mesh_path", |
|
|
|
type=str, |
|
|
|
type=str, |
|
|
|
required=True, |
|
|
|
required=True, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
parser.add_argument( |
|
|
|
parser.add_argument( |
|
|
|
"--mesh_path", |
|
|
|
"--sparse_dir", |
|
|
|
type=str, |
|
|
|
type=str, |
|
|
|
required=True, |
|
|
|
required=True, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
parser.add_argument( |
|
|
|
parser.add_argument( |
|
|
|
"--sparse_dir", |
|
|
|
"--output_path", |
|
|
|
type=str, |
|
|
|
type=str, |
|
|
|
required=True, |
|
|
|
required=True, |
|
|
|
) |
|
|
|
) |
|
|
|
@ -51,12 +46,9 @@ class ModelProcessor: |
|
|
|
# print("ModelProcessor Init", args.input_file, self.pose_path) |
|
|
|
# print("ModelProcessor Init", args.input_file, self.pose_path) |
|
|
|
args = parser.parse_args() |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
|
|
|
self.id = args.id |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.asset_dir = args.base_path |
|
|
|
|
|
|
|
self.mesh_path = args.mesh_path |
|
|
|
self.mesh_path = args.mesh_path |
|
|
|
# self.pose_path = f"{self.asset_dir}/sparse/" |
|
|
|
|
|
|
|
self.pose_path = args.sparse_dir |
|
|
|
self.pose_path = args.sparse_dir |
|
|
|
|
|
|
|
self.asset_dir = args.output_path |
|
|
|
if not os.path.exists(self.pose_path): |
|
|
|
if not os.path.exists(self.pose_path): |
|
|
|
raise FileNotFoundError(f"Camera data not found: {self.pose_path}") |
|
|
|
raise FileNotFoundError(f"Camera data not found: {self.pose_path}") |
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +60,6 @@ class ModelProcessor: |
|
|
|
|
|
|
|
|
|
|
|
def load_model(self): |
|
|
|
def load_model(self): |
|
|
|
"""加载并初始化3D模型""" |
|
|
|
"""加载并初始化3D模型""" |
|
|
|
# model_path = f"{self.asset_dir}/repair.ply" |
|
|
|
|
|
|
|
model_path = self.mesh_path |
|
|
|
model_path = self.mesh_path |
|
|
|
if not os.path.exists(model_path): |
|
|
|
if not os.path.exists(model_path): |
|
|
|
raise FileNotFoundError(f"Model file not found: {model_path}") |
|
|
|
raise FileNotFoundError(f"Model file not found: {model_path}") |
|
|
|
|