chenyilun95 / tf-cpn

Cascaded Pyramid Network for Multi-Person Pose Estimation (CVPR 2018)
MIT License
793 stars 197 forks source link

why making the boarder for image in image process? #2

Closed lilhope closed 6 years ago

lilhope commented 6 years ago

Hi,I'm quite a newer for human pose estimate, and your work helps me a lot. I'm confused that why you make boarder for the image in the image process, like this code:

bimg = cv2.copyMakeBorder(img, add, add, add, add, borderType=cv2.BORDER_CONSTANT,
                              value=cfg.pixel_means.reshape(-1))

It seems to avoid the region with human beyond the image size(e.g. xmin < 0), you pad the image before cropping the region with human. Did I understand it correctly? If so, crop first then pad the cropped image is another choice?
Thanks in advance.

chenyilun95 commented 6 years ago

Yes, you can crop first and pad. Make sure the image doesn't change its aspect ratio.

lilhope commented 6 years ago

Thanks,and did you use the resnet-v1 or resnet-v2 as the model backbone?

chenyilun95 commented 6 years ago

Network backbone is based on resnet_v1 in the model zoo of slim. Note that network is modified a bit (lib/nets/basemodel.py) to fit the original feature map size yet with the same initialized weights. (related issue: https://github.com/tensorflow/models/issues/1418)