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

Adding custom directory for fitting model. #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions featup/datasets/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from torch.utils.data import Dataset
from featup.datasets.ImageNetSubset import ImageNetSubset
from featup.datasets.COCO import Coco
Expand Down Expand Up @@ -54,5 +55,11 @@ def get_dataset(dataroot, name, split, transform, target_transform, include_labe
"../sample-images/bird_right.jpg"],
transform=transform
)
elif name == "custom":
list_img = os.listdir(dataroot)
return SampleImage(
paths=[os.path.join(dataroot, path) for path in list_img],
transform=transform
)
else:
raise ValueError(f"Unknown dataset {name}")