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 apply it to my own dataset? #34

Open
ghost opened this issue Nov 6, 2020 · 3 comments
Open

How to apply it to my own dataset? #34

ghost opened this issue Nov 6, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 6, 2020

I tried to apply it to my own dataset, but it didn't work because unmarked data had to be enhanced twice. Thank you very much for who can help me

@sakumashirayuki
Copy link

what is your problem? I suggest write your own dataset class to read your images. Here is the dataset class read images from a path

class YourDatasetName(Dataset):
    def __init__(self, root_dir, transform=None):
        self.root_dir = root_dir
        self.transform = transform
        self.image_lists = os.listdir(root_dir)

    def __len__(self):
        return len(self.image_lists)

    def __getitem__(self, item):
        image_path = os.path.join(self.root_dir, self.image_lists[item])
        image = Image.open(image_path)
        image = image.convert('RGB')
        if self.transform:
            img_tensor_1 = self.transform(image)
            img_tensor_2 = self.transform(image)
        return img_tensor_1, img_tensor_2

@ghost
Copy link
Author

ghost commented Dec 9, 2020

Thank you for your help. Under your inspiration, I solved this problem. Thank you very much

@thiyagu145
Copy link

@sakumashirayuki
Have you tried training in a multi gpu setting with DP/DDP?

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