Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SDarknessZX opened this issue Jan 17, 2022 · 4 comments
Open

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

SDarknessZX opened this issue Jan 17, 2022 · 4 comments

Comments

@SDarknessZX
Copy link

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

@chen-judge
Copy link
Owner

chen-judge commented Jan 17, 2022

部分代码参考:

    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
Copy link
Owner

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
Copy link

7ran commented Feb 22, 2023

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

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

@chen-judge
Copy link
Owner

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

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

这里已经提供了代码 #8 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants