GithubHelp home page GithubHelp logo

Comments (7)

Algolzw avatar Algolzw commented on July 24, 2024

你好,可以尝试使用matplotlib并设置cmap='jet' .

from dcls-sr.

joe880923 avatar joe880923 commented on July 24, 2024

作者您好,我儲存R特徵圖的code是這樣
test = self.channel_1(f2) #將R特徵圖channel做1*1con讓channel為1
test = np.squeeze(test, axis=2)
ndarr = test.detach().squeeze().cpu().numpy()
ndarr = (ndarr * 255).clip(0, 255).astype(np.uint8)
print("ndarr-------------------", ndarr.shape)
print("ndarr dtype-------------------", ndarr.dtype)
print("ndarr min/max-----------------", ndarr.min(), ndarr.max())
ndarr = ndarr.astype(np.uint8)
ndarr_transposed = np.transpose(ndarr, (0, 1)) # 对于二维数组,不需要改变轴的顺序

    plt.imshow(ndarr_transposed, cmap='jet')
    plt.savefig('feature_map.png')
    plt.show()

儲存的結果長這樣是正確的嗎?
image

image

image

感覺應該正常不會長這樣,再麻煩您跟我說一下,謝謝!

from dcls-sr.

Algolzw avatar Algolzw commented on July 24, 2024

看起来不对= =。你为什么要加一个1x1卷积让channel为1呢?可以直接只取第一个(或者前N个)通道的特征不?

from dcls-sr.

joe880923 avatar joe880923 commented on July 24, 2024

我原本的理解是如果只使用第一個channel的話會導致資訊流失,依照您給的建議有嘗試過使用第1個channel來測試,如下:
first_channel = f2[0, :1, :, :]
test = np.squeeze(first_channel, axis=0)
ndarr = test.detach().squeeze().cpu().numpy()
ndarr = (ndarr * 255).clip(0, 255).astype(np.uint8)
plt.imshow(ndarr, cmap='jet')
plt.savefig('feature_map.png')
plt.show()

印出的結果為
image

image

好像更加的不太對的樣子,不太確定我哪邊理解有問題或操作,再麻煩您給我點指導,謝謝您!

from dcls-sr.

Algolzw avatar Algolzw commented on July 24, 2024

你这是学习后的模型吗还是random weights?可以多打印几个feature通道看看呢,理论上有些通道信息比较多。

from dcls-sr.

joe880923 avatar joe880923 commented on July 24, 2024

作者您好,我是使用已經訓練完後的權重檔案去印出圖片,作者您說的多印幾個是指我針對第一個通道、第二個通道、第三個通道打印出來分別儲存起來的意思嗎?

from dcls-sr.

Algolzw avatar Algolzw commented on July 24, 2024

是的,有的通道信息应该会多一点

from dcls-sr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.