Pixel2MeshPlusPlus icon indicating copy to clipboard operation
Pixel2MeshPlusPlus copied to clipboard

How to modify the code if I want to use four or even five views for training.

Open YufanJia opened this issue 4 years ago • 1 comments

Hi,@walsvid, thanks for your sharing! It' really an excellent idea. Since I'm new to all this, I don't know many things very well. I want to use four views to train the model, but I don't know how to modify it, if it's convenient, can you tell me how to do it? Regards.

YufanJia avatar Jul 18 '21 13:07 YufanJia

Hey, I'm not a maintainer of this project but I've looked at the source code quite a bit.

It really depends if you want to always use the same number of views or if it could vary. If you're set on always using four views, for example, the modifications aren't too exhaustive.

Regarding the model itself, the images are used by the GraphProjection and LocalGraphProjection layers. At lines 208 and 371 of layers.py, there is a parameter named view_number, you could simply change this from 3 to 4.

Next, you need to change how the data is fed into the model. I'll take for example the train_mvp2m.py file, but it's the same for train_p2mpp and their test equivalent.

Inside the placeholders, starting at line 30, you'd need to change the first dimension of img_inp and cameras from 3 to 4.

Finally, inside the dataloader.py file, well you'd need to change the code so that it outputs four images instead of three. It's not too complicated and well, by 'Ctrl+F'ing the number 3 inside this file you should be able to figure out where to make the changes.

Good luck!

topinfrassi01 avatar Aug 02 '21 18:08 topinfrassi01