Update README.md
Browse files
README.md
CHANGED
@@ -115,16 +115,18 @@ from datasets import load_dataset
|
|
115 |
from torch.utils.data import DataLoader
|
116 |
|
117 |
# Load the dataset from huggingface
|
118 |
-
|
|
|
|
|
119 |
|
120 |
# Accesses the first image and its first novice label
|
121 |
-
seismic_image =
|
122 |
-
novice_laebl =
|
123 |
|
124 |
# Covert into a Format Usable by Pytorch
|
125 |
-
|
126 |
|
127 |
-
dataloader = DataLoader(
|
128 |
for batch in dataloader:
|
129 |
print(batch)
|
130 |
```
|
|
|
115 |
from torch.utils.data import DataLoader
|
116 |
|
117 |
# Load the dataset from huggingface
|
118 |
+
cracks_train = load_dataset('gOLIVES/CRACKS', split='train')
|
119 |
+
cracks_test_1 = load_dataset('gOLIVES/CRACKS', split='test_1')
|
120 |
+
cracks_test_2 = load_dataset('gOLIVES/CRACKS', split='test_2')
|
121 |
|
122 |
# Accesses the first image and its first novice label
|
123 |
+
seismic_image = cracks_train[0]['Image']
|
124 |
+
novice_laebl = cracks_train[0]['novice01']
|
125 |
|
126 |
# Covert into a Format Usable by Pytorch
|
127 |
+
cracks_train = cracks_train.with_format("torch")
|
128 |
|
129 |
+
dataloader = DataLoader(cracks_train, batch_size=4)
|
130 |
for batch in dataloader:
|
131 |
print(batch)
|
132 |
```
|