Iulia Elisa commited on
Commit
d3d3873
1 Parent(s): ce956c5

updated huggingface readme

Browse files
Files changed (1) hide show
  1. README.md +19 -34
README.md CHANGED
@@ -67,51 +67,36 @@ Please check [Dataset Structure](Datasets-Structure.md) for a more detailed stru
67
 
68
  # Downloading the dataset
69
 
70
- ### *(Option 1)* Downloading the dataset **archive** from HuggingFace
71
 
72
- - using a python script:
73
-
74
- ```python
75
- import os
76
- import json
77
- import pandas as pd
78
- from huggingface_hub import hf_hub_download
79
-
80
- dataset_name = 'xami_dataset' # the dataset name of Huggingface
81
- images_dir = '.' # the output directory of the dataset images
82
 
83
- hf_hub_download(
84
- repo_id="iulia-elisa/XAMI-dataset", # the Huggingface repo ID
85
- repo_type='dataset',
86
- filename=dataset_name+'.zip',
87
- local_dir=images_dir
88
- );
89
 
90
- # Unzip file
91
- !unzip -q "xami_dataset.zip"
92
 
93
- # Read the train json annotations file
94
- annotations_path = os.path.join(images_dir, dataset_name, 'train/', '_annotations.coco.json')
95
 
96
- with open(annotations_path) as f:
97
- data_in = json.load(f)
98
 
99
- data_in['images'][0]
 
 
 
 
100
  ```
101
- or
102
 
103
- - using a CLI command:
104
  ```bash
105
- huggingface-cli download iulia-elisa/XAMI-dataset xami_dataset.zip --repo-type dataset --local-dir '/path/to/local/dataset/dir'
106
-
107
- ```
108
 
109
- ### *(Option 2)* Cloning the repository for more visualization tools
110
 
111
- ```bash
112
- # Github
113
- git clone https://github.com/ESA-Datalabs/XAMI-dataset.git
114
- cd XAMI-dataset
115
  ```
116
  <!--
117
  # Dataset Split with SKF (Optional)
 
67
 
68
  # Downloading the dataset
69
 
70
+ ### Clone the repository
71
 
72
+ ```bash
73
+ git clone https://github.com/ESA-Datalabs/XAMI-dataset.git
74
+ cd XAMI-dataset
75
+ conda env create -f requirements.yaml # create an environment with the package requirements
76
+ ```
 
 
 
 
 
77
 
78
+ Then
 
 
 
 
 
79
 
80
+ ### Download the dataset archive from HuggingFace
 
81
 
82
+ - using a python script (see [load_and_visualise_dataset.pynb](https://github.com/ESA-Datalabs/XAMI-dataset/blob/main/load_and_visualise_dataset.ipynb))
 
83
 
84
+ ```python
85
+ from xami_dataset import XAMIDataset
86
 
87
+ # Download the dataset
88
+ xami_dataset = XAMIDataset(
89
+ repo_id="iulia-elisa/XAMI-dataset",
90
+ dataset_name="xami_dataset",
91
+ data_path='./dest_dir')
92
  ```
 
93
 
94
+ - using a CLI command
95
  ```bash
96
+ DEST_DIR='/path/to/local/dataset/dir'
 
 
97
 
98
+ huggingface-cli download iulia-elisa/XAMI-dataset xami_dataset.zip --repo-type dataset --local-dir "$DEST_DIR" && unzip "$DEST_DIR/xami_dataset.zip" -d "$DEST_DIR" && rm "$DEST_DIR/xami_dataset.zip"
99
 
 
 
 
 
100
  ```
101
  <!--
102
  # Dataset Split with SKF (Optional)