Skip to content

[ICCV 2023] Make-It-3D: High-Fidelity 3D Creation from A Single Image with Diffusion Prior

fix DPT bugs

junshutangd13cd14e7850
diff --git a/main.py b/main.py
index e375cc1..c953d78 100644
--- a/main.py
+++ b/main.py
@@ -200,12 +200,10 @@ if __name__ == '__main__':
mode="bicubic",
align_corners=True,
) # [1, 1, 512, 512] [80~150]
- DPT.util.io.write_depth_name(os.path.join(opt.workspace, opt.text.replace(" ", "_") + '_depth'), depth_prediction.squeeze().cpu().numpy(), bits=2)
+ DPT.util.io.write_depth(os.path.join(opt.workspace, opt.text.replace(" ", "_") + '_depth'), depth_prediction.squeeze().cpu().numpy(), bits=2)
disparity = imageio.imread(os.path.join(opt.workspace, opt.text.replace(" ", "_") + '_depth.png')) / 65535.
disparity = median_filter(disparity, size=5)
depth = 1. / np.maximum(disparity, 1e-2)
-
- depth = DPT.util.io.resize_img_cv(depth, ds_factor=1)
depth_prediction = torch.tensor(depth, device=device)
depth_mask = torch.tensor(depth_mask, device=device)
@@ -214,8 +212,6 @@ if __name__ == '__main__':
depth_prediction = ((depth_prediction - 1.0) / (depth_prediction.max() - 1.0)) * 0.9 + 0.1
# save_image(ori_imgs, os.path.join(opt.workspace, opt.text.replace(" ", "_") + '_ref.png'))
-
-
model = NeRFNetwork(opt)
trainer = Trainer('df', opt, model, depth_model, guidance,
ref_imgs=ref_imgs, ref_depth=depth_prediction,