machine-perception-robotics-group / ABN_CelebA_Chainer

ABN for facial attributes recognition
8 stars 1 forks source link

Attention map is useless in this code? #3

Open o0t1ng0o opened 4 years ago

o0t1ng0o commented 4 years ago

Hi, @Hiroshi-Fukui

Thanks you for sharing this code about the multi-task!

I tried this code for 12 facial attributes. But I found that the attention map is almost useless. Here are the attention maps which are generated by test.py.

Bald: 000000_Bald Bangs: 000000_Bangs Big Lips: 000000_Big_Lips Big Nose: 000000_Big_Nose Black Hair: 000000_Black_Hair Blond Hair: 000000_Blond_Hair Blurry: 000000_Blurry Brown Hair: 000000_Brown_Hair Input image: input

Is there any problem in your code? Could you please give me advice? Many thanks!

Hiroshi-Fukui commented 4 years ago

Thank you for this repo! First, let me confirm if I got it. Did you re-train our ABN with 12 facial attributes? and did you use the chainer==2.1.0, cupy==1.0.3 and Python2?

o0t1ng0o commented 4 years ago

Hi, @Hiroshi-Fukui I directly trained ABN with 12 facial attributes. I used chainer == 6.4.0, cupy==6.4.0 and Python3.6. So the model differs extremely when using different environment?

Hiroshi-Fukui commented 4 years ago

Yes, I only evaluated the old version of chainer , cupy, and python. sorry...

o0t1ng0o commented 4 years ago

@Hiroshi-Fukui So is it possible to implement in PyTorch?

o0t1ng0o commented 4 years ago

Hi, @Hiroshi-Fukui I failed to set up the environment. Could you please tell the version of CUDA, cuDNN, nccl, GPU driver and python?

Additionally, can I rewrite the code of multi-task learning based on your code repository (https://github.com/machine-perception-robotics-group/attention_branch_network) which is for image classification? Is it possible to come out the meaningful attention maps for different facial attributes?

Many thanks! I am looking forward to your feedback~

Hiroshi-Fukui commented 4 years ago

Sorry, I missed the new issues...

Sorry, I forget the versions of CUDA, cuDNN, nccl, GPU driver. The version of python is 2. But, you can get our chainer environment by docker pull fhiro0125/chainercv_07_.

Maybe, you can implement the ABN on facial attributes recognition using pytorch. I could implement using ABN image classification model (, but I can't open to the public it on GitHub).

o0t1ng0o commented 4 years ago

Thanks for your reply~

I tried to pull the environment. When I use this command docker pull fhiro0125/chainercv_07_, it comes the error invalid reference format. Is there any problem in this command?

o0t1ng0o commented 4 years ago

Hi, @Hiroshi-Fukui I successfully get your environment by docker pull fhiro0125/chainercv_07_1. But the attention maps are still the same as the images above. Could you please provide the pretrained model of chainer version?

Hiroshi-Fukui commented 4 years ago

Very sorry, I lost your message...

I modified this code after submitting the CVPR paper. I forget the modification, sorry...

Please try to add the two lines to test.py. I removed the normalizing process of an attention map.

min_att = 0
max_att = 30
...
item_attention = (item_attention - min_att) / (max_att - min_att)

When I add the lines, I can get the correct attention map like CVPR and arXiv papers. (Please adjust the value of max_att. In CelebA, 30 is the best value.)