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

怎么在自己的数据集上生成dense label map呢? #7

Closed
wxshan opened this issue Jun 17, 2021 · 6 comments
Closed

怎么在自己的数据集上生成dense label map呢? #7

wxshan opened this issue Jun 17, 2021 · 6 comments

Comments

@wxshan
Copy link

wxshan commented Jun 17, 2021

怎么在自己的数据集上生成dense label map呢?

@zihangJiang
Copy link
Owner

Hi,
Assume you've got a pre-trained classifier like EfficientNet-B6 for your dataset, you can simply remove the final global average pooling layer (and may have to adjust the shape of the output feature map before you feed it to the classification head) to generate the dense label map.

@wxshan
Copy link
Author

wxshan commented Jun 18, 2021

If I save the feature vector of the picture as pt, how can I make the label of the small image correspond to the label of the whole image later?

@zihangJiang
Copy link
Owner

This is automatically done during training.

target_label = roi_align(
input=label_maps,
boxes=torch.cat(
[torch.arange(num_batches).view(num_batches,
1).float().to(device),
batch_coords.float() * label_maps.size(3) - 0.5], 1),
output_size=(label_size, label_size))

The label map will be cropped (according to the random crop box) and resized to the target shape.

@wxshan
Copy link
Author

wxshan commented Jun 18, 2021 via email

@zihangJiang
Copy link
Owner

You can reopen this issue if you have any further questions.

@neotopiaz
Copy link

Hi, Assume you've got a pre-trained classifier like EfficientNet-B6 for your dataset, you can simply remove the final global average pooling layer (and may have to adjust the shape of the output feature map before you feed it to the classification head) to generate the dense label map.

Hi Zihang @zihangJiang , thanks for your excellent work.
I'd like to ask how the score map are generated.
First we use a pretrained machine annotator like NFNet-F6, and as you say we remove the final global average pooling layer, we get the feature map of an input image. But how to transform the feature map to the dense score map, let's say 1000*patch_num for ImageNet? Sorry for my unfamiliarity with the NFNet-F6, will it automatically generate the patch label or there are some other technique to finish this?
Thanks for your reply.

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