|
23 | 23 | from src.depthmap_generation import ModelHolder |
24 | 24 | from src import backbone |
25 | 25 |
|
| 26 | +try: |
| 27 | + # 3d-photo-inpainting imports |
| 28 | + from inpaint.mesh import write_mesh, read_mesh, output_3d_photo |
| 29 | + from inpaint.networks import Inpaint_Color_Net, Inpaint_Depth_Net, Inpaint_Edge_Net |
| 30 | + from inpaint.utils import path_planning |
| 31 | + from inpaint.bilateral_filtering import sparse_bilateral_filtering |
| 32 | +except Exception as e: |
| 33 | + print('Impaint import failed. Impaint will not work.') |
| 34 | + import traceback |
| 35 | + traceback.print_exc() |
| 36 | + |
26 | 37 | global video_mesh_data, video_mesh_fn |
27 | 38 | video_mesh_data = None |
28 | 39 | video_mesh_fn = None |
@@ -84,6 +95,7 @@ def core_generation_funnel(outpath, inputimages, inputdepthmaps, inputnames, inp |
84 | 95 |
|
85 | 96 | # TODO: ideally, run_depthmap should not save meshes - that makes the function not pure |
86 | 97 | print(SCRIPT_FULL_NAME) |
| 98 | + print(f'Backbone: {backbone.USED_BACKBONE.name}') |
87 | 99 |
|
88 | 100 | backbone.unload_sd_model() |
89 | 101 |
|
@@ -351,10 +363,6 @@ def get_uniquefn(outpath, basename, ext, suffix=''): |
351 | 363 |
|
352 | 364 |
|
353 | 365 | def run_3dphoto(device, img_rgb, img_depth, inputnames, outpath, gen_inpainted_mesh_demos, vid_ssaa, vid_format): |
354 | | - from inpaint.mesh import write_mesh |
355 | | - from inpaint.networks import Inpaint_Color_Net, Inpaint_Depth_Net, Inpaint_Edge_Net |
356 | | - from inpaint.bilateral_filtering import sparse_bilateral_filtering |
357 | | - |
358 | 366 | mesh_fi = '' |
359 | 367 | try: |
360 | 368 | print("Running 3D Photo Inpainting .. ") |
@@ -504,8 +512,6 @@ def run_3dphoto(device, img_rgb, img_depth, inputnames, outpath, gen_inpainted_m |
504 | 512 |
|
505 | 513 | def run_3dphoto_videos(mesh_fi, basename, outpath, num_frames, fps, crop_border, traj_types, x_shift_range, |
506 | 514 | y_shift_range, z_shift_range, video_postfix, vid_dolly, vid_format, vid_ssaa): |
507 | | - from inpaint.mesh import read_mesh, output_3d_photo |
508 | | - from inpaint.utils import path_planning |
509 | 515 | import vispy |
510 | 516 | try: |
511 | 517 | if platform.system() == 'Windows': |
|
0 commit comments