pooya-mohammadi / yolov5-gradcam

Visualizing Yolov5's layers using GradCam
MIT License
281 stars 47 forks source link

why the truck's heatmap does not show anything? #3

Closed mengjingyouling closed 2 years ago

mengjingyouling commented 2 years ago

why the truck's heatmap does not show anything?

pooya-mohammadi commented 2 years ago

Hi @mengjingyouling Unfortunately, I don't have the answer as well. I checked the code several times and tested it on several images, but mysteriously it does not return a visual heatmap for the truck!

mengjingyouling commented 2 years ago

      hi,I trained a model with my own data set. The model can detect cranes and fireworks. Cranes can't be visualized, but fireworks can. The crane can be detected normally, and the map can reach 85%.       What an interesting phenomenon. Share with you.       Thanks again.

------------------ 原始邮件 ------------------ 发件人: "pooya-mohammadi/yolov5-gradcam" @.>; 发送时间: 2022年2月22日(星期二) 下午4:24 @.>; @.**@.>; 主题: Re: [pooya-mohammadi/yolov5-gradcam] why the truck's heatmap does not show anything? (Issue #3)

Hi @mengjingyouling Unfortunately, I don't have the answer as well. I checked the code several times and tested it on several images, but mysteriously it does not return a visual heatmap for the truck!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

mengjingyouling commented 2 years ago

@pooya-mohammadi Tried some other truck images, which can display the heatmap normally. The truck occupies a larger size in these pictures. Is it related to the size of the object that needs to be identified?

mengjingyouling commented 2 years ago

@pooya-mohammadi I did some experiments to further verify my point . The car / truck in the upper right corner of the dog.jpg image is cropped out and used as a new image dog_new alone. Then to run the code to do heatmap visualization. As a result, you can see that the visual code is running normally. But, it seems that the corresponding position of the heatmap is not perfect.

pooya-mohammadi commented 2 years ago

@mengjingyouling Tnx for your interest in the project. Let me check your hypothesis. I will let you know once it's done.

mengjingyouling commented 2 years ago

@pooya-mohammadi Is it the function Box.fill_ outer_box caused the problem?

Since the original image will be scaled to 640, it leads to inaccurate position correspondence.

mengjingyouling commented 2 years ago

@pooya-mohammadi I did some experiments. Useing model23 layer parameter,the truck in dog.jpg show no heat map. But in shallow layers, such as model 3 there are some heat maps. Can it be understood that the recognition of trucks is determined by shallow features?THX.

pooya-mohammadi commented 2 years ago

@mengjingyouling I don't think so because in the images you emailed me the truck had a clear heatmap like the others which means that layer is capable of generating visible gradients and heatmaps for trucks