chufengt / ALM-pedestrian-attribute

Code for the paper "Improving Pedestrian Attribute Recognition With Weakly-Supervised Multi-Scale Attribute-Specific Localization", ICCV 2019, http://arxiv.org/abs/1910.04562.
Apache License 2.0
188 stars 66 forks source link

Visualization of attributes #32

Closed abhigoku10 closed 3 years ago

abhigoku10 commented 3 years ago

@chufengt thanks for sharing the code i have few queries, i am able to get the attributes correctly but want to visualize the attributes detected or classified, i followed your reference of #29 #31 which go to one of the examples but not able to obtain the results as the feature size of sub_feature of stn is (1,768,32,16) and the image size if of (1,3,256,128) which feature to visualization ??

chufengt commented 3 years ago

You can directly apply the theta computed for sub_feature (32,16) to the full image (256,128), since the STN operation is scale-agnostic.

abhigoku10 commented 3 years ago

THanks for the response , based on the input i returned the theta_i values from the model and used the below code grid = F.affine_grid(output[6][10], torch.Size((1,3,256,128)),align_corners=None) x = F.grid_sample(input, grid,padding_mode='border') x= x.detach().cpu().numpy() and ploted the output which i am currently getting like this image is there any error in my code/ understanding

chufengt commented 3 years ago

output[6][10] is theta? there is a 'green' region centered in the input. have you checked the input? is it a black image?

abhigoku10 commented 3 years ago

@chufengt yes output[6][10] is the theta value and the th einput is correct , after few modification now i am able to get the output for corresponding pred_3b and its theta_3b , but one query which theta value to use for main_pred is it theta_3b/4d/5b Thanks for the response

chufengt commented 3 years ago

We didn't use the ALM module for main_pred, thus there is no theta for main_pred.

Actually, main_pred is in a typical multi-label classification manner, all attributes using the same full-image feature.