Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use custom datasets #3

Open
pianoforte23 opened this issue Jan 6, 2022 · 1 comment
Open

How to use custom datasets #3

pianoforte23 opened this issue Jan 6, 2022 · 1 comment

Comments

@pianoforte23
Copy link

Hello,
Could you give me more detailed guidelines for using custom datasets?
I tried to follow your guidelines, but I was confused about how to set these fields:
image

I also wonder should I make all of these files in the 'dtu_dataset.py' following above fields?
self.campos = np.load(self.data_dir + "/in_camOrgs.npy")
self.camat = np.load(self.data_dir + "/in_camAts.npy")
self.focal = np.load(self.data_dir + "/in_camFocal.npy")
self.princpt = np.load(self.data_dir + "/in_camPrincpt.npy")
self.extrinsics = np.load(self.data_dir + "/in_camExtrinsics.npy")
self.point_cloud = trimesh.load(self.data_dir + "/pcd_down_unit.ply")
I guessed "pcd_down_unit.ply" is a polygon file of point clouds, but I don't know how to make other files.

I'd really appreciate it if you reply to my question.

@fbxiang
Copy link
Owner

fbxiang commented Jan 6, 2022

I believe the point_cloud is not used at all so you can ignore that.
For gt_mask, you simply provide 0 for background and 1 for foreground(the object you are capturing)
near and far are the "clipping range", so points will only be sampled at distances between near and far from the campos.
raydir indicate the camera ray directions.
gt_image is the ground truth pixel color (used to build the loss)
background_color is the background color. For example, you can set it to black if you set the background pixels of the gt_image to black.
You can inspect the shape of the demo code to see how to create these tensors, and they should be intuitive.

All the campos, camat, focal etc are specific to the dtu_dataset.py used to compute the required fields. (they are actually using some unconventional format). So if you are constructing your own dataset, I would say you should ignore these fields as your input probably has a different format. You probably want to compute the ray origin and directions on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants