|
|
|
@ -88,6 +88,7 @@ def rander_image_and_check(args): |
|
|
|
pid = args.pid |
|
|
|
pid = args.pid |
|
|
|
pid_file_dir = os.path.join(args.input,pid) |
|
|
|
pid_file_dir = os.path.join(args.input,pid) |
|
|
|
if not os.path.exists(pid_file_dir): |
|
|
|
if not os.path.exists(pid_file_dir): |
|
|
|
|
|
|
|
print(f"不存在{pid_file_dir}") |
|
|
|
return |
|
|
|
return |
|
|
|
obj_file_list = [aa for aa in os.listdir(pid_file_dir) if aa.endswith(".obj")] |
|
|
|
obj_file_list = [aa for aa in os.listdir(pid_file_dir) if aa.endswith(".obj")] |
|
|
|
if len(obj_file_list)==0: |
|
|
|
if len(obj_file_list)==0: |
|
|
|
@ -231,10 +232,9 @@ def rander_image_and_check(args): |
|
|
|
os.makedirs(os.path.join(args.output, args.len_type, |
|
|
|
os.makedirs(os.path.join(args.output, args.len_type, |
|
|
|
f'{pid}_{args.resolution_x}x{args.resolution_y}_{args.ps_column}', camera_id), |
|
|
|
f'{pid}_{args.resolution_x}x{args.resolution_y}_{args.ps_column}', camera_id), |
|
|
|
exist_ok=True) |
|
|
|
exist_ok=True) |
|
|
|
png_name = f"{pid}_{column + 1}.png" |
|
|
|
png_name = f"{pid}_pic.png" |
|
|
|
png_out_path = os.path.join(args.output, args.len_type, |
|
|
|
png_out_path = os.path.join(args.output,png_name) |
|
|
|
f'{pid}_{args.resolution_x}x{args.resolution_y}_{args.ps_column}', |
|
|
|
print(f"图片输出地址-{png_out_path}") |
|
|
|
camera_id, png_name) |
|
|
|
|
|
|
|
bpy.context.scene.render.filepath = png_out_path |
|
|
|
bpy.context.scene.render.filepath = png_out_path |
|
|
|
bpy.context.scene.render.image_settings.file_format = 'PNG' |
|
|
|
bpy.context.scene.render.image_settings.file_format = 'PNG' |
|
|
|
|
|
|
|
|
|
|
|
@ -268,7 +268,7 @@ def get_args(): |
|
|
|
argparser.add_argument('-r_x', '--resolution_x', type=int, default='768', help='render resolution_x') |
|
|
|
argparser.add_argument('-r_x', '--resolution_x', type=int, default='768', help='render resolution_x') |
|
|
|
argparser.add_argument('-r_y', '--resolution_y', type=int, default='1024', help='render resolution_y') |
|
|
|
argparser.add_argument('-r_y', '--resolution_y', type=int, default='1024', help='render resolution_y') |
|
|
|
argparser.add_argument('-s', '--sample', type=int, default='512', help='render sample') |
|
|
|
argparser.add_argument('-s', '--sample', type=int, default='512', help='render sample') |
|
|
|
argparser.add_argument('-e', '--Env_Texture_path', type=str, default='/data/datasets/hdrs/studio_small_08_2k.exr', |
|
|
|
argparser.add_argument('-e', '--Env_Texture_path', type=str, default='D://make2/tools/pic_for_obj/hdrs/studio_small_08_2k.exr', |
|
|
|
help='enviroment texture path') |
|
|
|
help='enviroment texture path') |
|
|
|
args = argparser.parse_args() |
|
|
|
args = argparser.parse_args() |
|
|
|
|
|
|
|
|
|
|
|
@ -301,6 +301,7 @@ def rander_image_run(args): |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
args = get_args() |
|
|
|
args = get_args() |
|
|
|
|
|
|
|
print(args) |
|
|
|
rander_image_run(args) |
|
|
|
rander_image_run(args) |
|
|
|
#python image_rander_small.py -pid 234161 -i /data/datasets_20t/obj_rander/ -o /data/datasets_20t/render_images/ |
|
|
|
#python image_rander_small.py -pid 234161 -i /data/datasets_20t/obj_rander/ -o /data/datasets_20t/render_images/ |
|
|
|
# python image_rander_small.py -pid 5924 -i /data/datasets_20t/obj_rander/ -o /data/datasets_20t/render_images/ |
|
|
|
# python image_rander_small.py -pid 5924 -i /data/datasets_20t/obj_rander/ -o /data/datasets_20t/render_images/ |
|
|
|
|