zkawfanx / Atlantis

Atlantis: Enabling Underwater Depth Estimation with Stable Diffusion (CVPR2024, Highlight)
MIT License
67 stars 8 forks source link

关于在不同深度图数据集上训练及测试的细节问题 #12

Open wangyue7777 opened 2 days ago

wangyue7777 commented 2 days ago

您好,我看到论文中使用本方法生成的深度图数据集,或者其他公开的深度图数据集作为训练数据,训练了几个深度估计模型,并在几个水下真实场景的深度数据集上进行了测试。 我有一个细节问题想请教一下,不同深度数据集的设置可能不同,深度数据的范围也可能会有所差异,请问在训练和测试的时候需要对深度数据进行归一化之类的处理嘛? 非常感谢!

zkawfanx commented 1 day ago

论文实验中,是在所提出的Atlantis数据集上训练了4个深度模型,然后在Sea-thru和SQUID数据集上进行zero-shot的定量测试。

由于Atlantis训练所提供的深度为MiDaS估计的inverse relative depth,其没有scale和shift,需要在测试数据集上按照MiDaS论文中提到的方法估计scale和shift,然后将模型的预测结果对齐到该尺度,然后进行指标评价。

wangyue7777 commented 14 hours ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

非常感谢您的回复!我查找了MiDaS论文和代码,论文里的描述好像是对每张图计算中间值和方差作为scale和shift,但是MiDas的损失函数代码(ScaleAndShiftInvariantLoss)里使用了以下的方式计算:def compute_scale_and_shift(prediction, target, mask):    # system matrix: A = [[a_00, a_01], [a_10, a_11]]    a_00 = torch.sum(mask * prediction * prediction, (1, 2))    a_01 = torch.sum(mask * prediction, (1, 2))    a_11 = torch.sum(mask, (1, 2))    # right hand side: b = [b_0, b_1]    b_0 = torch.sum(mask * prediction * target, (1, 2))    b_1 = torch.sum(mask * target, (1, 2))    # solution: x = A^-1 . b = [[a_11, -a_01], [-a_10, a_00]] / (a_00 * a_11 - a_01 * a_10) . b    x_0 = torch.zeros_like(b_0)    x_1 = torch.zeros_like(b_1)    det = a_00 * a_11 - a_01 * a_01    valid = det.nonzero()    x_0[valid] = (a_11[valid] * b_0[valid] - a_01[valid] * b_1[valid]) / det[valid]    x_1[valid] = (-a_01[valid] * b_0[valid] + a_00[valid] * b_1[valid]) / det[valid]    return x_0, x_1所以想再跟您确认下,您使用的是代码里提供的方式进行的对齐嘛?谢谢!Best,

                            2504312627

                                ***@***.***

---- 回复的原邮件 ----

     发件人 

        ***@***.***>

     发送日期 

    2024年10月6日 19:27

     收件人 

        ***@***.***>

     抄送人 

        ***@***.***>
        ,

        ***@***.***>

     主题 

          Re: [zkawfanx/Atlantis] 关于在不同深度图数据集上训练及测试的细节问题 (Issue #12)

论文实验中,是在所提出的Atlantis数据集上训练了4个深度模型,然后在Sea-thru和SQUID数据集上进行zero-shot的定量测试。 由于Atlantis训练所提供的深度为MiDaS估计的inverse relative depth,其没有scale和shift,需要在测试数据集上按照MiDaS论文中提到的方法估计scale和shift,然后将模型的预测结果对齐到该尺度,然后进行指标评价。

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

zkawfanx commented 10 hours ago

There is a discussion in the MiDaS issue on the scale alignment to the metric depth, I think it will help a lot.