Update README.md
Browse files
README.md
CHANGED
|
@@ -139,20 +139,18 @@ This dataset is ready for commercial/non-commercial use.
|
|
| 139 |
```python
|
| 140 |
from datasets import load_dataset
|
| 141 |
|
| 142 |
-
# Load the
|
| 143 |
-
dataset = load_dataset("Dataseeds/DataSeeds-Sample-Dataset-DSD")
|
| 144 |
|
| 145 |
-
#
|
| 146 |
-
|
| 147 |
-
val_data = load_dataset("Dataseeds/DataSeeds-Sample-Dataset-DSD", split="validation")
|
| 148 |
|
| 149 |
-
#
|
| 150 |
-
|
| 151 |
-
image = sample["image"] # PIL Image object
|
| 152 |
title = sample["image_title"]
|
| 153 |
description = sample["image_description"]
|
| 154 |
segments = sample["segmented_objects"]
|
| 155 |
-
masks = sample["segmentation_masks"]
|
| 156 |
|
| 157 |
print(f"Title: {title}")
|
| 158 |
print(f"Description: {description}")
|
|
|
|
| 139 |
```python
|
| 140 |
from datasets import load_dataset
|
| 141 |
|
| 142 |
+
# Load the training split of the dataset
|
| 143 |
+
dataset = load_dataset("Dataseeds/DataSeeds.AI-Sample-Dataset-DSD", split="train")
|
| 144 |
|
| 145 |
+
# Access the first sample
|
| 146 |
+
sample = dataset[0]
|
|
|
|
| 147 |
|
| 148 |
+
# Extract the different features from the sample
|
| 149 |
+
image = sample["image"] # The PIL Image object
|
|
|
|
| 150 |
title = sample["image_title"]
|
| 151 |
description = sample["image_description"]
|
| 152 |
segments = sample["segmented_objects"]
|
| 153 |
+
masks = sample["segmentation_masks"] # The PIL Image object for the mask
|
| 154 |
|
| 155 |
print(f"Title: {title}")
|
| 156 |
print(f"Description: {description}")
|