-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Dataloaders Tutorial image-grid and visualization questions #444
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
Comments
For the 3rd query, the following change to the def _load_mesh(self, model_path) -> Tuple:
verts, faces, aux = load_obj(
model_path,
create_texture_atlas=self.load_textures,
load_textures=self.load_textures,
texture_atlas_size=self.texture_resolution,
)
+ textures = None
if self.load_textures:
textures = aux.texture_atlas
# Some meshes don't have textures. In this case
# create a white texture map
- if textures is None:
- textures = verts.new_ones(
- faces.verts_idx.shape[0],
- self.texture_resolution,
- self.texture_resolution,
- 3,
- )
+ if textures is None:
+ textures = verts.new_ones(
+ faces.verts_idx.shape[0],
+ self.texture_resolution,
+ self.texture_resolution,
+ 3,
+ )
return verts, faces.verts_idx, textures Unfortunately, I'm not sure if this would break other things :( |
@albertotono Any update for the visualization questions? This kind of results seems wrong. I have encounter the similar problem. |
@albertotono Hello, I also want to learn this tutorial https://pytorch3d.org/tutorials/dataloaders_ShapeNetCore_R2N2, can you share your dataset, I can't download it online, thank you very much. |
for 1B, you need to change the voxels_rel_path to the r2n2 voxel folder name you downloaded for the r2n2 dataset when you initiate the R2N2 instance like this r2n2_dataset = R2N2("train", SHAPENET_PATH, R2N2_PATH, SPLITS_PATH, return_voxels=True,voxels_rel_path = "ShapeNetVox32") |
I have 3 questions for the in https://pytorch3d.org/tutorials/dataloaders_ShapeNetCore_R2N2 tutorial,
A.
it returns
I am able to visualize if I do an extra step,
r2n2_renderings = r2n2_renderings["images"]
the same with the batch.
B.
and at the end for visualizing the voxels
I got this
maybe they are correlated
I would like to share also some images to make sure they are correct.
If so why are they rendered in this way?
Now it takes from shapenet_base.py that if it doesn't have a texture, it will return white. But what if I want to return all images without texture?!
I tried to modify
to
shapenet_dataset = ShapeNetCore(SHAPENET_PATH, load_textures=False)
and r2n2_dataset = R2N2("train", SHAPENET_PATH, R2N2_PATH, SPLITS_PATH, return_voxels=True, load_textures=False)
but I got this error later
UnboundLocalError: local variable 'textures' referenced before assignment
when I run this
and the texture displays in their colors not white.
Thanks again for the help and availability in advance
The text was updated successfully, but these errors were encountered: