GengDavid / pytorch-cpn

A PyTorch re-implementation of CPN (Cascaded Pyramid Network for Multi-Person Pose Estimation)
GNU General Public License v3.0
484 stars 98 forks source link

Fix Color Normalization Issue #9

Closed mingloo closed 6 years ago

mingloo commented 6 years ago

Hi @GengDavid,

I've found the self.pixel_means is changed in every iteration when calling __getitem__ due to modification of mean variable in color_normalize function. As a result, our expected color normalization will not take effect after several samples iterations because the mean value decreases to [0, 0, 0].

This issue infects both training and testing phase.

See detailed printed log below:

checking pixel means __init__: [122.7717 115.9465 102.9801] => loaded checkpoint 'checkpoint/epoch32checkpoint.pth.tar' (epoch 32) testing... checking pixel means __getitem__: [122.7717 115.9465 102.9801] checking pixel means __getitem__: [0.48145765 0.45469216 0.40384353] checking pixel means __getitem__: [0.00188807 0.00178311 0.0015837 ] checking pixel means __getitem__: [7.40419296e-06 6.99257450e-06 6.21058869e-06] checking pixel means __getitem__: [2.90360508e-08 2.74218608e-08 2.43552498e-08]

Please help to double check it.

GengDavid commented 6 years ago

@mingloo Thanks for contribution. I'm sorry to have this bug. This will result in training and testing without normalization after a few iterations. However, if I merge your code now, all pre-trained models will fail to use. I'm going to fine-tune all models, and I'll merge your PR as soon as I finish it. Thank again.

mingloo commented 6 years ago

@GengDavid No problem. Looking forward to your update.

mingloo commented 6 years ago

Hi @GengDavid if you start to retrain all these model, will you includes this changes https://github.com/GengDavid/pytorch-cpn/issues/7 as well?

GengDavid commented 6 years ago

Right. I've started fine-tune work with issue #7 included.

mingloo commented 6 years ago

@GengDavid Cool.

mingloo commented 6 years ago

@GengDavid Thanks 👍