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

Some questions about the 'make_imnet_dataset' function #11

Open
LydJason opened this issue Feb 17, 2023 · 6 comments
Open

Some questions about the 'make_imnet_dataset' function #11

LydJason opened this issue Feb 17, 2023 · 6 comments

Comments

@LydJason
Copy link

Thank you very much for your great work!
I am trying to use the full dataset of IMnet and HSP to train ShapeFormer.
I discovered the make_imnet_dataset function in shapeformer/data/imnet_datasets/imnet_datasets.py write shape_vocab, vocab_idx, xbd and cat_id into the hdf5 file.
However, the code didn't write Ytg to the hdf5 file, which was provided in the processed dataset from google drive.
I was wondering maybe there are some other code that processes the original IMnet data to Ytg?
Thank you very much!

dataDict = {"shape_vocab": np.array(shape_vocabs, dtype="O"), "vocab_idx": np.array(

@QhelDIV
Copy link
Owner

QhelDIV commented Feb 17, 2023

You can have a check at the Imnet2Dataset class at the file ShapeFormer/shapeformer/data/imnet_datasets/imnet_datasets.py. There are some snippets to decompress the shape_vocab back to Ytg.
Basically shape_vocab and vocab_idx is the HSP's representation to compress the Ytg volume (256x256x256).
The compression is actually really good and the storage is much smaller.

@LydJason
Copy link
Author

I got it. Thank you very much!

@saladcat
Copy link

saladcat commented Mar 26, 2023

Thank you very much for your great work! I am trying to use the full dataset of IMnet and HSP to train ShapeFormer. I discovered the make_imnet_dataset function in shapeformer/data/imnet_datasets/imnet_datasets.py write shape_vocab, vocab_idx, xbd and cat_id into the hdf5 file. However, the code didn't write Ytg to the hdf5 file, which was provided in the processed dataset from google drive. I was wondering maybe there are some other code that processes the original IMnet data to Ytg? Thank you very much!

Thanks for your great works. Could you please provide the code for reducing the resolution from 256 to 64? I would like to keep my processing consistent with yours

@LydJason LydJason reopened this Mar 28, 2023
@dqj5182
Copy link

dqj5182 commented Nov 6, 2024

@QhelDIV I am also interested in code for reducing the resolution of Ytg from 256 to 64.

@QhelDIV
Copy link
Owner

QhelDIV commented Nov 6, 2024

Hi @saladcat and @dqj5182 , thanks for the interest! I am not sure if I can find the original code for this.
But this should be simple as it is a mean-pooling process. You can use this (untested) code to do this with the einops package.

# Assuming Ytg has a shape of (256, 256, 256)
Ytg_x64 = einops.reduce(Ytg, '(x k1) (y k2) (z k3) -> x y z', 'mean', k1=8, k2=8, k3=8)

@dqj5182
Copy link

dqj5182 commented Nov 6, 2024

Thanks for the clarification!

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

4 participants