xiangjieSui / ScanDMM

[2023-CVPR] ScanDMM: A Deep Markov Model of Scanpath Prediction for 360-degree Images
18 stars 2 forks source link

data_process.py #2

Open qmengyu opened 10 months ago

qmengyu commented 10 months ago

Hello,

I have a question about the following code:

In the file "data_process.py," the variable self.images_path should specify a list of rotated images, and the resulting file_name should be in the format "cubemap_0000_2.png." However, in self.test_set, the values are ['cubemap_0000.png', 'cubemap_0006.png', 'cubemap_0009.png']. So, is the condition checking file_name against self.test_set incorrect?

def run(self):
    ''
    ' PATH PREPARE '
    for file_name in os.listdir(self.images_path):
        if ".png" in file_name:
            if file_name in self.test_set:
                self.images_test_list.append(os.path.join(self.images_path, file_name))
            else:
                self.images_train_list.append(os.path.join(self.images_path, file_name))
xiangjieSui commented 10 months ago

Hello,

We rotated the images in training set only for data augmentation.

qmengyu commented 10 months ago

"self.images_path" should specify the original list of images, right? Then why is the program taking every 6th image below?

def get_train_set(self):

    all_files = [os.path.join(self.gaze_path, self.images_train_list[i].split('/')[-1].split('.')[0][:-2] + '.pck')
                 for i in range(0, len(self.images_train_list), 6)]
xiangjieSui commented 10 months ago

"self.images_path" should specify the original list of images, right? Then why is the program taking every 6th image below?

def get_train_set(self):

    all_files = [os.path.join(self.gaze_path, self.images_train_list[i].split('/')[-1].split('.')[0][:-2] + '.pck')
                 for i in range(0, len(self.images_train_list), 6)]

Because an image is rotated 6 times, that is, 0° (original image), 60°,...300°, I traverse with an interval of 6 to avoid repeated retrieval of the same image. Please note that I assume that you have already done rotated image processing. You can check these details simply by debugging.

qmengyu commented 10 months ago

So, should "self.images_path" specify the path of the original images or the path of the rotated images? This seems contradictory.

xiangjieSui commented 10 months ago

So, should "self.images_path" specify the path of the original images or the path of the rotated images? This seems contradictory.

Thank you for you point out this. Please put the rotated images and remaining test images in the same file. Then the code can work smoothly.