Wi-sc / ViewFusion

Code of ViewFusion
Apache License 2.0
40 stars 4 forks source link

correct definition of RealDataset class #6

Open alohia opened 1 week ago

alohia commented 1 week ago

Hi, as per this constructor: class RealDataset(Dataset): def init(self, data_dir='/home/ubuntu/workspace/zero123/3drec/data/real_images/'): self.meta = [] for model_name in os.listdir(data_dir): meta_dict = { "model_name": model_name.split('.')[0], "inference_index": 0, "inference_image_path": f"{data_dir}/{model_name}", } self.meta.append(meta_dict)

    self.transform = transforms.Compose([
        transforms.Resize((256, 256)),
        transforms.ToTensor(),
    ])

This indicates that there should be some sub-folders within the real_images directory, whereas actually it only has images. Can you please let me know what should be the model_name here?

image

Wi-sc commented 1 week ago

Hi @alohia , sorry for the confusion. I forget to clean this part. "inference_image_path": f"{data_dir}/{model_name}" should be the image path, such as "./3drec/data/real_images/batman_2_rgba.png". The model_name actually should be the image name *.png.

alohia commented 1 week ago

Based on this code, it looks like the real_images directory (which is data_dir) should have a list of directories:

        for model_name in os.listdir(data_dir):
            meta_dict = {
                "model_name": model_name.split('.')[0],
                "inference_index": 0,
                "inference_image_path": f"{data_dir}/{model_name}",
            }
            self.meta.append(meta_dict)

Can you please tell what should be the list of directories and what should the model_name be?

alohia commented 1 week ago

If we look at other files like generate_360_multi_view_autoregressive.py, then RealDataset has a different definition with additional variables like env_index and inference_mask_path. Should there be a consistent definition of the RealDataset class?