INNER CODE UNIT · Python

depth

junshutang/Make-It-3D · main.py:208

        depth = 1. / np.maximum(disparity, 1e-2)
    
    depth_prediction = torch.tensor(depth, device=device)
    depth_mask = torch.tensor(depth_mask, device=device)
    # normalize estimated depth
    depth_prediction = depth_prediction * (~depth_mask) + torch.ones_like(depth_prediction) * (depth_mask)
    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, 
                        ref_mask=depth_mask, ori_imgs=ori_imgs, 
                        device=device, workspace=opt.workspace, optimizer=optimizer, ema_decay=None, fp16=opt.fp16, lr_scheduler=scheduler, use_checkpoint=opt.ckpt, eval_interval=opt.eval_interval, scheduler_update_every_step=True)
    

    if opt.test:
        test_loader = NeRFDataset(opt, device=device, type='test', H=opt.H, W=opt.W, size=33).dataloader()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…