File size: 2,158 Bytes
7c23acd c1fc23d 7c23acd c1fc23d 3f12256 a50a7d7 3f12256 a80d3cb a50a7d7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # US Segmentation Dataset
The dataset is a collection of openly available ultrasound datasets.
The individual datasets are stored as zip files in the `zip` directory. The utility for extraction all of them will be provided later.
## Instructions for uploading new datasets
1. Download the dataset from the source
2. Convert the dataset into a zip format if required
3. Upload the zip file corresponding anatomy folder in the `zip` directory using the command: `hf upload [repo_id] [local_path] [path_in_repo] --repo-type dataset --commit-message "add-dataset: <dataset_name>"`
eg: `hf upload us-segmentator/us-segmentation-dataset local_path_to_zip_file.zip zips/<anatomy_name>/<zip_file_name>.zip --repo-type dataset --commit-message "add-dataset: <dataset_name>"`
## Instructions for downloading the dataset
### CLI
1. Make sure you have git lfs installed
2. Run the following command:
```bash
git lfs install
```
3. Run the following command:
```bash
hf download us-segmentator/us-segmentation-dataset --repo-type dataset --local-dir local_path_to_download_directory
```
4. The dataset will be downloaded to the local directory.
> Note: The dataset can be downloaded without the --local-dir argument, but it will be downloaded the huggingface cache directory.
### Python
Use the `huggingface_hub` library to download specific files programmatically:
```python
from huggingface_hub import hf_hub_download
file_path = hf_hub_download(
repo_id="us-segmentator/us-segmentation-dataset",
filename="zips/<anatomy_name>/<zip_file_name>.zip",
repo_type="dataset",
local_dir="local_path_to_download_directory"
)
print(f"File downloaded to: {file_path}")
```
## Pulling non-LFS changes only
If you are only pulling repository updates like `README.md`, scripts, or other small files (and want to skip downloading large LFS zip datasets during pull), use:
Use case: This is useful when you are contributing documentation/code changes and do not need the dataset zip files on your machine.
### Linux/macOS
```bash
GIT_LFS_SKIP_SMUDGE=1 git pull
```
### Windows (PowerShell)
```powershell
$env:GIT_LFS_SKIP_SMUDGE=1
git pull
```
|