dangweili / pedestrian-attribute-recognition-pytorch

A simple baseline for pedestrian attribute recognition in surveillance scenarios
334 stars 81 forks source link

Directly resize input image to 224x224 ? #18

Closed handong1587 closed 5 years ago

handong1587 commented 5 years ago

I can see in your paper you first resize images to 256x256 then crop 227xx227: paper

In addition, the images are resized to 256×256 first. After that, they are randomly mirrored and cropped to 227×227 to add the training data

However in your code you directly resize input images to 224x224.

Code snippet from ./script/experiment/train.sh:

python ./script/experiment/train_deepmar_resnet50.py \
    ....
    --resize="(224,224)" \

Did I miss anything? Because I thought random-crop might work better in some classification tasks.

dangweili commented 5 years ago

@handong1587 For resnet50, I didn't try data augmentation of random crop. I also agree with you that random-crop might work better. Maybe you can try it.

handong1587 commented 5 years ago

Thanks for your reply!

kclch commented 5 years ago

@I would like to ask if I use data augmentation of random crop, how should I do it in "./script/experiment/train.sh:" Python ./script/experiment/train_deepmar_resnet50.py \      ....      --resize="(224,224)" \" How to amend? Thank you

dangweili commented 5 years ago

It does not support random crop now. It is easy to extend the random crop augmentation. You can add the config parameter and implement it in image transform function at line 201-205 and 225-228 at script/experiment/train_deepmar_resnet50.py

kclch commented 5 years ago

@dangweili Hello, I tried random cropping while training, by modifying the"script/experiment/train_deepmar_resnet50.py" at line 201-205 and 225-228: image image,but I got the error: imagePlease guide me