Update README.md
Browse files
README.md
CHANGED
|
@@ -33,6 +33,12 @@ configs:
|
|
| 33 |
# Converting script
|
| 34 |
|
| 35 |
```py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
DATA_DIR = Path("/path/to/cached/hugging_face/datasets/for/MLDS-NUS/Experimental_Images")
|
| 38 |
# should end with something like "snapshots/fd299418e9435f8fd98956a3f0a7344d208cc142"
|
|
@@ -93,7 +99,13 @@ ds.push_to_hub("MLDS-NUS/polymer_re-upload")
|
|
| 93 |
|
| 94 |
# How to use
|
| 95 |
|
|
|
|
|
|
|
| 96 |
```py
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
hf_dataset = load_dataset("MLDS-NUS/polymer_re-upload")
|
| 98 |
hf_dataset = hf_dataset.with_format("numpy")["train"]
|
| 99 |
|
|
|
|
| 33 |
# Converting script
|
| 34 |
|
| 35 |
```py
|
| 36 |
+
import pickle
|
| 37 |
+
from pathlib import Path
|
| 38 |
+
|
| 39 |
+
import numpy as np
|
| 40 |
+
from datasets import Dataset
|
| 41 |
+
|
| 42 |
|
| 43 |
DATA_DIR = Path("/path/to/cached/hugging_face/datasets/for/MLDS-NUS/Experimental_Images")
|
| 44 |
# should end with something like "snapshots/fd299418e9435f8fd98956a3f0a7344d208cc142"
|
|
|
|
| 99 |
|
| 100 |
# How to use
|
| 101 |
|
| 102 |
+
Directly loading by [datasets](https://huggingface.co/docs/datasets/installation) is supported now!
|
| 103 |
+
|
| 104 |
```py
|
| 105 |
+
from datasets import load_dataset
|
| 106 |
+
import numpy as np
|
| 107 |
+
|
| 108 |
+
|
| 109 |
hf_dataset = load_dataset("MLDS-NUS/polymer_re-upload")
|
| 110 |
hf_dataset = hf_dataset.with_format("numpy")["train"]
|
| 111 |
|