zubair-irshad / CenterSnap

Pytorch code for ICRA'22 paper: "Single-Shot Multi-Object 3D Shape Reconstruction and Categorical 6D Pose and Size Estimation"
https://zubair-irshad.github.io/projects/CenterSnap.html
286 stars 47 forks source link

custom data #23

Closed peng25zhang closed 1 year ago

peng25zhang commented 1 year ago

@zubair-irshad Hi, sorry to bother you, I want to generate custom data, and I donot know how to cal scale_factors? (*norm.txt), please help

zubair-irshad commented 1 year ago

Hi @peng25zhang,

Can you say more about your data specs? You don't need *norm.txt file for a synthetic dataset but you need it for real dataset. This is how we load scale factors from norm.txt and this, this and this is how we eventually save it in our CenterSnap format to be later used for regression.

Note that we did not create the NOCS data ourself and merely use the data NOCS provided to process data in the correct format required by CenterSnap. We need norm.txt to calculate the sizes (i.e. W,H,L dimensions) of the canonical bounding box of each shape which we later regress along with R,T in CenterSnap model. One can get this size information if you have mesh/pointcloud available for that shape by normalizing the meshes/pointclouds of all instances within a category to fit in a unit bounding box and calculating scale as np.min and np.max for x,y and z dimensions.

Hope it helps!