akanazawa / cmr

Project repo for Learning Category-Specific Mesh Reconstruction from Image Collections
MIT License
474 stars 84 forks source link

Simple question about your implementation #9

Closed gsygsy96 closed 4 years ago

gsygsy96 commented 5 years ago

I have a simple question. In mesh_net.py Line289,290, you set img_H and img_W as :

Could you explain the reason?

shubhtuls commented 5 years ago

This was just a heuristic to ensure that the number of pixels in the UV texture image are of a similar order as number of texture samples across all faces. The code represents each face with 'opts.tex_size opts.tex_size' samples, so an image with height/width of 'np.sqrt(num_faces) opts.tex_size' would have similar number of pixels. The additional code enforces that the sizes are a power of 2, so it is easily predictable via an up-convolutional CNN.