-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
feature map visualization #3798
Comments
Now the code can read. |
@Zigars thanks for the feature suggestion and your example code. Can you please submit a PR with your implementation? We will then review the PR and try to get this merged to help everyone else plot features also. See https://docs.ultralytics.com/help/contributing/ to get started. Thanks! |
@glenn-jocher ok, I will do it. |
@Zigars great thanks! |
@Zigars good news 😃! Feature map visualization was added ✅ in PR #3804 by @Zigars today. This allows for visualizing feature maps from any part of the model from any function (i.e. detect.py, train.py, test.py). Feature maps are saved as *.png files in runs/features/exp directory. To turn on feature visualization set Lines 158 to 160 in 20d45aa
To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
@Zigars good news 😃! Your original issue may now be fixed ✅ in PR #3920. This is a complete revamp of feature visualization with many fixes and improvements. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
🚀 Feature
I find many people want get the feature map in model middle(include myself), but you did not give the specific method to visualization feature map. Also I find a previous issue and know how can I come true this. So I provide a feature_visualization function so that people can visualization feature map by using yolov5's code .
This is my effect picture :
Motivation
It's easy to use. just add feature_visualization function in utils/general.py or utils/plots.py:
and than add this in yolo.py:
My code is not so concise, but I think feature map visualization function can help people understand what does the convolution operation do intuitively.
Also I have a little confuse about Model function, I modified in yolo.py, but when I run detect.py, I also can get the feature map.
detect.py use
model = attempt_load(weights, map_location=device)
to load model, but I can't find the relationship with yolo.py and detect.py, I'm not familiar with this mechanism in the PyTorch code. maybe you can solve my confuse!Pitch
Alternatives
Additional context
The text was updated successfully, but these errors were encountered: