-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pierre.delaunay
committed
Jun 6, 2024
1 parent
bc08a16
commit 2c1aafb
Showing
8 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
|
||
def download_celebA(): | ||
from datasets import load_dataset | ||
dataset = load_dataset( | ||
"student/celebA", | ||
revision="2d31e6555722815c74ea7c845b07c1063dd705e9", | ||
cache_dir="/tmp/milabench/cuda/results/data" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
download_celebA() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
|
||
|
||
def no_transform(args): | ||
return args | ||
|
||
|
||
def transform_images(transform_x, transform_y=no_transform): | ||
def _(args): | ||
print(args) | ||
return transform_x(args[0]), transform_y(args[1]) | ||
return _ | ||
|
||
|
||
def transform_celebA(transform_x): | ||
def _(args): | ||
print(args) | ||
return transform_x(args["image"]) | ||
return _ | ||
|
||
|
||
class TransformedDataset: | ||
def __init__(self, dataset, transforms=no_transform): | ||
self.dataset = dataset | ||
self.transforms = transforms | ||
|
||
def __len__(self): | ||
return len(self.dataset) | ||
|
||
def __getitem__(self, item): | ||
return self.transforms(self.dataset[item]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters