open-mmlab / mmfashion

Open-source toolbox for visual fashion analysis based on PyTorch
https://open-mmlab.github.io/
Apache License 2.0
1.27k stars 283 forks source link

test attribute predictor with a wrong result #78

Open kakaxi679 opened 4 years ago

kakaxi679 commented 4 years ago

I have download model from model zoo. VGG-16 Global Pooling, VGG-16 Landmark Pooling, ResNet-50 Global Pooling I put them to path checkpoint with name: vgg16_global_latest.pth, vgg16_landmark_latest.pth, model_best.pth. then i copy img for test, the test images and attributes are: img/Boxy_Shirt_Dress/img_00000003.jpg: boxy img/Boxy_Shirt_Dress/img_00000014.jpg: boxy striped img/Boxy_Shirt_Dress/img_00000025.jpg: boxy shirt

I copy the images to demo/images with name:img_00000003.jpg, img_00000014.jpg, img_00000025.jpg then i run these cmd: python demo/test_predictor.py --checkpoint checkpoint/vgg16_landmark_latest.pth --config configs/attribute_predict/global_predictor_vgg_attr.py --input demo/imgs/img_00000003.jpg the top5 result is : lace knit maxi sleeve shirt python demo/test_predictor.py --checkpoint checkpoint/vgg16_landmark_latest.pth --config configs/attribute_predict/global_predictor_vgg_attr.py --input demo/imgs/img_00000014.jpg the top5 result is : knit striped lace maxi sleeve python demo/test_predictor.py --checkpoint checkpoint/vgg16_landmark_latest.pth --config configs/attribute_predict/global_predictor_vgg_attr.py --input demo/imgs/img_00000025.jpg the top5 result is :lace knit maxi sleeve print

python demo/test_predictor.py --checkpoint checkpoint/model_best.pth --config configs/attribute_predict/global_predictor_resnet_attr.py --input demo/imgs/img_00000003.jpg the top5 result is : knit sleeve shirt striped lace python demo/test_predictor.py --checkpoint checkpoint/model_best.pth --config configs/attribute_predict/global_predictor_resnet_attr.py --input demo/imgs/img_00000014.jpg the top5 result is : striped stripe knit sleeve shirt python demo/test_predictor.py --checkpoint checkpoint/model_best.pth --config configs/attribute_predict/global_predictor_resnet_attr.py --input demo/imgs/img_00000025.jpg the top5 result is : maxi lace knit sleeve skinny

when i run: python demo/test_predictor.py --checkpoint checkpoint/vgg16_global_latest.pth --config configs/attribute_predict/global_predictor_vgg_attr.py --input demo/imgs/img_00000003.jpg, I got an error:The model and loaded state dict do not match exactly. unexpected key in source state_dict: roi_pool.linear.0.weight, roi_pool.linear.0.bias, concat.fc_fusion.weight, concat.fc_fusion.bias

I have two questions: 1.Did i run the cmd with the wrong params? if wrong how to run it ? 2.the model of VGG-16 Landmark Pooling, ResNet-50 Global Pooling used for attribute test seems not accurate, why?

Please help me, thank you.

GoelPratyush commented 4 years ago

I am also facing the same issue.

thebeyonder001 commented 4 years ago

me too did you solve it?

GoelPratyush commented 4 years ago

No

veralauee commented 4 years ago

We just update a more accurate attribute and category predictor. Please download it from model_zoo.md

First you need to download our re-labeled annotations(https://drive.google.com/drive/folders/19J-FY5NY7s91SiHpQQBo2ad3xjIB42iN?usp=sharing).

The script for this category and attributes prediction is python demo/test_cate_attr_predictor.py python test tools/test_cate_attr_predictor.py

GoelPratyush commented 4 years ago

I have cloned the repository again and download the re-labelled annotation. When I run the code: python3 demo/test_cate_attr_predictor.py \ --config configs/category_attribute_predict/global_predictor_vgg.py \ --checkpoint checkpoint/latest.pth I get this error: Traceback (most recent call last): File "demo/test_cate_attr_predictor.py", line 8, in from mmfashion.core import AttrPredictor, CatePredictor ImportError: cannot import name 'CatePredictor'

Thanks for your help.

veralauee commented 4 years ago

I have cloned the repository again and download the re-labelled annotation. When I run the code: python3 demo/test_cate_attr_predictor.py \ --config configs/category_attribute_predict/global_predictor_vgg.py \ --checkpoint checkpoint/latest.pth I get this error: Traceback (most recent call last): File "demo/test_cate_attr_predictor.py", line 8, in from mmfashion.core import AttrPredictor, CatePredictor ImportError: cannot import name 'CatePredictor'

Thanks for your help.

I cannot replicate your error. Maybe you can try "python setup.py install" again and then test.

GoelPratyush commented 4 years ago

Thank you that worked for me.

kartikwar commented 4 years ago

Followed the same steps suggested by @veralauee . While category predictions seem to change with input image, attribute predictions are same regardless of input images

veralauee commented 4 years ago

Followed the same steps suggested by @veralauee . While category predictions seem to change with input image, attribute predictions are same regardless of input images

Sorry, I cannot replicate your error. For demo/imgs/attr_pred_demo2.jpg, my attribute prediction results are [ Top3 Attribute Prediction ] cotton conventional crew_neckline [ Top5 Attribute Prediction ] cotton conventional crew_neckline no_dress solid

While for demo/imgs/01_3_back.jpg, the attribute prediction are [ Top3 Attribute Prediction ] no_dress conventional long_sleeve [ Top5 Attribute Prediction ] no_dress conventional long_sleeve crew_neckline cotton

Cuberick-Orion commented 3 years ago

Followed the same steps suggested by @veralauee . While category predictions seem to change with input image, attribute predictions are same regardless of input images

Sorry, I cannot replicate your error. For demo/imgs/attr_pred_demo2.jpg, my attribute prediction results are [ Top3 Attribute Prediction ] cotton conventional crew_neckline [ Top5 Attribute Prediction ] cotton conventional crew_neckline no_dress solid

While for demo/imgs/01_3_back.jpg, the attribute prediction are [ Top3 Attribute Prediction ] no_dress conventional long_sleeve [ Top5 Attribute Prediction ] no_dress conventional long_sleeve crew_neckline cotton

I can confirm this result on VGG-global.

Unfortunately, this is about the only model that I can run with decent performance.

All landmark-based (roi) and Resnet based models fail to generate meaningful predictions. Any help is appreciated.