Rendering-at-ZJU / weight-sharing-kernel-prediction-denoising

Source code for "Real-time Monte Carlo Denoising with Weight Sharing Kernel Prediction Network" (EGSR 2021)
MIT License
16 stars 3 forks source link

the datasets can not be found #2

Open t-khaos opened 1 year ago

t-khaos commented 1 year ago

您好,BMFR的Dataset链接都已经失效,请问还有Dataset的相关资源可以分享出来否,感谢!

hmfann commented 1 year ago

你好,可以参考 https://github.com/xmeng525/RealTimeDenoisingNeuralBilateralGrid 这个项目里分享的数据集链接,是同一个数据集

t-khaos commented 1 year ago

感谢回复!


发件人: Hangming Fan @.> 发送时间: 2023年7月12日 10:51 收件人: Rendering-at-ZJU/weight-sharing-kernel-prediction-denoising @.> 抄送: Justian @.>; Author @.> 主题: Re: [Rendering-at-ZJU/weight-sharing-kernel-prediction-denoising] the datasets can not be found (Issue #2)

你好,可以参考 https://github.com/xmeng525/RealTimeDenoisingNeuralBilateralGrid 这个项目里分享的数据集链接,是同一个数据集

― Reply to this email directly, view it on GitHubhttps://github.com/Rendering-at-ZJU/weight-sharing-kernel-prediction-denoising/issues/2#issuecomment-1631772060, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU6J6IXXEYGX5JXMNUN2Z23XPYGJNANCNFSM6AAAAAAZHSHYSA. You are receiving this because you authored the thread.Message ID: @.***>

Aluomolo commented 4 months ago

你好,可以参考 https://github.com/xmeng525/RealTimeDenoisingNeuralBilateralGrid 这个项目里分享的数据集链接,是同一个数据集

你好,按这里面下载的数据集,想在这个项目里尝试跑下发现缺少depth数据

pyexr.exr.ExrError: File 'dataset/classroom/depth/depth0.exr' is not an EXR file.
hmfann commented 4 months ago

depth 数据可以从 postion buffer 和 camera matrics 计算,可以参考下列代码:

scene_names = ["sponza", "classroom", "living-room", "san-miguel", "sponza-glossy", "sponza-moving-light"]
scene_name = scene_names[5]
camera_matrices = np.zeros((60, 4, 4))
with open(os.path.join("dataset", "cameras", scene_name+".h"), "r") as file:
    camera_idx = 0
    row_idx = 0
    for line in file.readlines():
        floats = re.findall(r'-?\d+.\d+', line)
        if len(floats) > 0:
            camera_matrices[camera_idx, row_idx] = np.array(floats, dtype=np.float32)
            row_idx += 1
        if row_idx == 4:
            camera_idx += 1
            row_idx = 0

world_positions = []
for i in tqdm(range(60)):
    world_positions.append(pyexr.read(os.path.join("dataset", scene_name, "inputs", "world_position"+str(i)+".exr")))
H, W = world_positions[0].shape[:2]

depth_buffers = []
world_position = np.ones(4)
# for i in tqdm(range(60)):
for i in range(60):
    depth_buffer = np.zeros((H, W, 1))
    for h_i in range(H):
        for w_i in range(W):
            world_position[:3] = world_positions[i][h_i, w_i]
            depth_buffer[h_i, w_i] = np.dot(world_position, camera_matrices[i][:, 2]) / np.dot(world_position, camera_matrices[i][:, 3])

    print(i, depth_buffer.max(), depth_buffer.min())
    depth_buffer = (depth_buffer - depth_buffer.min()) / (depth_buffer.max() - depth_buffer.min())
    depth_buffers.append(np.concatenate((depth_buffer, depth_buffer, depth_buffer), axis=2))
    pyexr.write(os.path.join("dataset", scene_name, "depth", "depth"+str(i)+".exr"), depth_buffers[i])