pawlo2013 commited on
Commit
7d04284
1 Parent(s): b3a733b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -1
README.md CHANGED
@@ -15,4 +15,32 @@ dataset_info:
15
  # Dataset Card for "one_piece_dataset"
16
 
17
  <h1> This dataset contains 922 images taken from the one piece anime (128x128x3), with each row containing the coloured image and the sketch one. </h1>
18
- <img alt='example images' src="./combined.png"/ >
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  # Dataset Card for "one_piece_dataset"
16
 
17
  <h1> This dataset contains 922 images taken from the one piece anime (128x128x3), with each row containing the coloured image and the sketch one. </h1>
18
+ <img alt='example images' src="./combined.png"/ >
19
+
20
+ <h2> Example Setup (the images are not normalized) </h2>
21
+ <code>
22
+
23
+
24
+ transform = Compose([
25
+ transforms.Resize((128, 128)),
26
+ transforms.ToTensor(),
27
+ transforms.Lambda(lambda t: (t * 2) - 1)
28
+ ])
29
+
30
+ def train():
31
+
32
+ def transforms(examples):
33
+ examples["sketch_pixel_values"] = [transform(image.convert("RGB")) for image in examples["sketch"]]
34
+ examples["full_colour_pixel_values"] = [ transform(image.convert("RGB")) for image in examples["full_colour"]]
35
+ del examples["sketch"]
36
+ del examples["full_colour"]
37
+
38
+ return examples
39
+
40
+
41
+ dataset = load_dataset("pawlo2013/one_piece_dataset", split="train")
42
+
43
+ transformed_full_colour_dataset = dataset.with_transform(transforms)
44
+
45
+ dataloader = DataLoader(transformed_full_colour_dataset, batch_size=16, shuffle=True, num_workers=0)
46
+ </code>