rithwiks commited on
Commit
7de150a
·
2 Parent(s): b10fe46 a2784d6

Merge branch 'main' of https://huggingface.co/datasets/AstroCompress/SBI-16-2D into main

Browse files
Files changed (1) hide show
  1. README.md +27 -23
README.md CHANGED
@@ -21,50 +21,54 @@ pip install datasets astropy
21
 
22
  There are two datasets: `tiny` and `full`, each with `train` and `test` splits. The `tiny` dataset has 2 2D images in the `train` and 1 in the `test`. The `full` dataset contains all the images in the `data/` directory.
23
 
24
- ## Use from Huggingface Directly
25
 
26
- To directly use from this data from Huggingface, you'll want to log in on the command line before starting python:
27
 
28
  ```bash
29
- huggingface-cli login
30
  ```
31
 
32
- or
33
-
34
  ```
35
- import huggingface_hub
36
- huggingface_hub.login(token=token)
37
  ```
38
 
39
- Then in your python script:
40
 
41
  ```python
42
  from datasets import load_dataset
43
- dataset = load_dataset("AstroCompress/SBI-16-2D", "tiny")
44
  ds = dataset.with_format("np")
45
  ```
46
 
47
- ## Local Use
48
-
49
- Alternatively, you can clone this repo and use directly without connecting to hf:
50
 
51
- ```bash
52
- git clone https://huggingface.co/datasets/AstroCompress/SBI-16-2D
53
  ```
54
 
55
- Then `cd SBI-16-3D` and start python like:
56
 
57
- ```python
58
- from datasets import load_dataset
59
- dataset = load_dataset("./SBI_16_2D.py", "tiny", data_dir="./data/")
60
- ds = dataset.with_format("np")
 
 
61
  ```
62
 
63
- Now you should be able to use the `ds` variable like:
64
 
65
- ```python
66
- ds["test"][0]["image"].shape # -> (TBD)
 
67
  ```
68
 
69
- Note of course that it will take a long time to download and convert the images in the local cache for the `full` dataset. Afterward, the usage should be quick as the files are memory-mapped from disk.
70
 
 
 
 
 
 
 
21
 
22
  There are two datasets: `tiny` and `full`, each with `train` and `test` splits. The `tiny` dataset has 2 2D images in the `train` and 1 in the `test`. The `full` dataset contains all the images in the `data/` directory.
23
 
24
+ ## Local Use (RECOMMENDED)
25
 
26
+ Alternatively, you can clone this repo and use directly without connecting to hf:
27
 
28
  ```bash
29
+ git clone https://huggingface.co/datasets/AstroCompress/SBI-16-2D
30
  ```
31
 
32
+ To pull all data files:
 
33
  ```
34
+ git lfs pull
 
35
  ```
36
 
37
+ Then `cd SBI-16-3D` and start python like:
38
 
39
  ```python
40
  from datasets import load_dataset
41
+ dataset = load_dataset("./SBI-16-2D.py", "tiny", data_dir="./data/")
42
  ds = dataset.with_format("np")
43
  ```
44
 
45
+ Now you should be able to use the `ds` variable like:
 
 
46
 
47
+ ```python
48
+ ds["test"][0]["image"].shape # -> (TBD)
49
  ```
50
 
51
+ Note of course that it will take a long time to download and convert the images in the local cache for the `full` dataset. Afterward, the usage should be quick as the files are memory-mapped from disk.
52
 
53
+ ## Use from Huggingface Directly
54
+
55
+ To directly use from this data from Huggingface, you'll want to log in on the command line before starting python:
56
+
57
+ ```bash
58
+ huggingface-cli login
59
  ```
60
 
61
+ or
62
 
63
+ ```
64
+ import huggingface_hub
65
+ huggingface_hub.login(token=token)
66
  ```
67
 
68
+ Then in your python script:
69
 
70
+ ```python
71
+ from datasets import load_dataset
72
+ dataset = load_dataset("AstroCompress/SBI-16-2D", "tiny")
73
+ ds = dataset.with_format("np")
74
+ ```