chen-judge / RGBTCrowdCounting

Official Implement of CVPR 2021 paper “Cross-Modal Collaborative Representation Learning and a Large-Scale RGBT Benchmark for Crowd Counting”
65 stars 11 forks source link

可视化密度图分辨率80*60 #8

Open SDarknessZX opened 2 years ago

SDarknessZX commented 2 years ago

您好!我增加了代码,但是我发现您的这个BL模型的输出是分辨率80*60的,很小,您是直接通过双线性插值放大吗?还是怎么操作,还有这个输出是一个黑白颜色的,怎么变成彩色的呢?谢谢哥!

chen-judge commented 2 years ago

部分代码参考:

    import matplotlib.pyplot as plt

    fig, ax = plt.subplots()
    plt.axis('off')
    fig.set_size_inches(width / 100.0 / 3.0, height / 100.0 / 3.0)
    plt.gca().xaxis.set_major_locator(plt.NullLocator())
    plt.gca().yaxis.set_major_locator(plt.NullLocator())
    plt.subplots_adjust(top=1, bottom=0, left=0, right=1, hspace=0, wspace=0)
    plt.margins(0, 0)

    ax.imshow(target, aspect='equal')
    plt.savefig(os.path.join(save_path, name+'_Target'+'.png'), dpi=300)
    ax.imshow(output, aspect='equal')
    plt.savefig(os.path.join(save_path, name + '_pre'+'.png'), dpi=300)
    plt.close('all')

其中,output是density map,target是ground truth, height, width, _ = RGB.shape

chen-judge commented 2 years ago

matplotlib的不同版本保存的可视化色彩似乎也不一样,我用的是2.2.4版本

部分代码参考:

    import matplotlib.pyplot as plt

    fig, ax = plt.subplots()
    plt.axis('off')
    fig.set_size_inches(width / 100.0 / 3.0, height / 100.0 / 3.0)
    plt.gca().xaxis.set_major_locator(plt.NullLocator())
    plt.gca().yaxis.set_major_locator(plt.NullLocator())
    plt.subplots_adjust(top=1, bottom=0, left=0, right=1, hspace=0, wspace=0)
    plt.margins(0, 0)

    ax.imshow(target, aspect='equal')
    plt.savefig(os.path.join(save_path, name+'_Target'+'.png'), dpi=300)
    ax.imshow(output, aspect='equal')
    plt.savefig(os.path.join(save_path, name + '_pre'+'.png'), dpi=300)
    plt.close('all')

其中,output是density map,target是ground truth

7ran commented 1 year ago

您好!我增加了代码,但是我发现您的这个BL模型的输出是分辨率80*60的,很小,您是直接通过双线性插值放大吗?还是怎么操作,还有这个输出是一个黑白颜色的,怎么变成彩色的呢?谢谢哥!

您好,请问您方便提供密度图可视化代码吗?a17861126203@163.com

chen-judge commented 1 year ago

您好!我增加了代码,但是我发现您的这个BL模型的输出是分辨率80*60的,很小,您是直接通过双线性插值放大吗?还是怎么操作,还有这个输出是一个黑白颜色的,怎么变成彩色的呢?谢谢哥!

您好,请问您方便提供密度图可视化代码吗?a17861126203@163.com

这里已经提供了代码 https://github.com/chen-judge/RGBTCrowdCounting/issues/8#issuecomment-1014188822