onurxtasar commited on
Commit
4ffc70a
·
verified ·
1 Parent(s): cb6ea0d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -13,7 +13,7 @@ size_categories:
13
 
14
  # Overview
15
 
16
- This is the public synthetic test set for controllable shadow generation created by Jasper Research Team. It has 3 tracks: softness control, horizontal direction control and vertical direction control.
17
 
18
  Example renders from the dataset below:
19
 
@@ -25,3 +25,34 @@ Horizontal direction control:
25
 
26
  Vertical direction control:
27
  ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6368c710e68400b192fffb9d/UnkTWbftwMlTdoECQRWsW.jpeg)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  # Overview
15
 
16
+ This is the public synthetic test set for controllable shadow generation created by Jasper Research Team. We created this dataset using [Blender](https://www.blender.org/). It has 3 tracks: softness control, horizontal direction control and vertical direction control.
17
 
18
  Example renders from the dataset below:
19
 
 
25
 
26
  Vertical direction control:
27
  ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6368c710e68400b192fffb9d/UnkTWbftwMlTdoECQRWsW.jpeg)
28
+
29
+ # Usage
30
+ The dataset is formatted to be used with [WebDataset](https://huggingface.co/docs/hub/datasets-webdataset).
31
+
32
+ ```python
33
+ import matplotlib.pyplot as plt
34
+ import webdataset as wds
35
+
36
+ # Create a data iterator
37
+ url = f"pipe:curl -s -L https://huggingface.co/datasets/jasperai/controllable-shadow-generation-benchmark/blob/main/controllable-shadow-generation-benchmark.tar"
38
+ data_iter = iter(wds.WebDataset(url))
39
+
40
+ # Sample from the dataset
41
+ data = next(data_iter)
42
+
43
+ # Visualize the image, object mask, and object shadow
44
+ _, axs = plt.subplots(1, 3, figsize=(15, 5))
45
+ axs[0].imshow(data['image.png'])
46
+ axs[0].set_title('Image')
47
+ axs[1].imshow(data['mask.png'])
48
+ axs[1].set_title('Mask')
49
+ axs[2].imshow(data['shadow.png'])
50
+ axs[2].set_title('Shadow')
51
+
52
+ # Print the metadata
53
+ print(data['metadata.json'])
54
+
55
+ ```
56
+
57
+
58
+