diff --git a/docs/requirements.txt b/docs/requirements.txt index 9369548c67..eabf66afed 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -37,3 +37,4 @@ optuna opencv-python-headless onnx>=1.13.0 onnxruntime; python_version <= '3.10' +huggingface_hub diff --git a/docs/source/installation.md b/docs/source/installation.md index c3e7297da6..3a8f2b07d9 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -10,8 +10,8 @@ - [Uninstall the packages](#uninstall-the-packages) - [From conda-forge](#from-conda-forge) - [From GitHub](#from-github) - - [Option 1 (as a part of your system-wide module)](#option-1-as-a-part-of-your-system-wide-module) - - [Option 2 (editable installation)](#option-2-editable-installation) + - [Option 1 (as a part of your system-wide module):](#option-1-as-a-part-of-your-system-wide-module) + - [Option 2 (editable installation):](#option-2-editable-installation) - [Validating the install](#validating-the-install) - [MONAI version string](#monai-version-string) - [From DockerHub](#from-dockerhub) @@ -254,10 +254,10 @@ Since MONAI v0.2.0, the extras syntax such as `pip install 'monai[nibabel]'` is - The options are ``` -[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, cucim, openslide, pandas, einops, transformers, mlflow, clearml, matplotlib, tensorboardX, tifffile, imagecodecs, pyyaml, fire, jsonschema, ninja, pynrrd, pydicom, h5py, nni, optuna, onnx, onnxruntime] +[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, cucim, openslide, pandas, einops, transformers, mlflow, clearml, matplotlib, tensorboardX, tifffile, imagecodecs, pyyaml, fire, jsonschema, ninja, pynrrd, pydicom, h5py, nni, optuna, onnx, onnxruntime, huggingface_hub] ``` which correspond to `nibabel`, `scikit-image`, `pillow`, `tensorboard`, -`gdown`, `pytorch-ignite`, `torchvision`, `itk`, `tqdm`, `lmdb`, `psutil`, `cucim`, `openslide-python`, `pandas`, `einops`, `transformers`, `mlflow`, `clearml`, `matplotlib`, `tensorboardX`, `tifffile`, `imagecodecs`, `pyyaml`, `fire`, `jsonschema`, `ninja`, `pynrrd`, `pydicom`, `h5py`, `nni`, `optuna`, `onnx`, `onnxruntime`, respectively. +`gdown`, `pytorch-ignite`, `torchvision`, `itk`, `tqdm`, `lmdb`, `psutil`, `cucim`, `openslide-python`, `pandas`, `einops`, `transformers`, `mlflow`, `clearml`, `matplotlib`, `tensorboardX`, `tifffile`, `imagecodecs`, `pyyaml`, `fire`, `jsonschema`, `ninja`, `pynrrd`, `pydicom`, `h5py`, `nni`, `optuna`, `onnx`, `onnxruntime`, `huggingface_hub`, respectively. - `pip install 'monai[all]'` installs all the optional dependencies. diff --git a/monai/bundle/scripts.py b/monai/bundle/scripts.py index b3e1174b3f..7cabc0cc2b 100644 --- a/monai/bundle/scripts.py +++ b/monai/bundle/scripts.py @@ -57,6 +57,7 @@ Checkpoint, has_ignite = optional_import("ignite.handlers", IgniteInfo.OPT_IMPORT_VERSION, min_version, "Checkpoint") requests_get, has_requests = optional_import("requests", name="get") onnx, _ = optional_import("onnx") +huggingface_hub, _ = optional_import("huggingface_hub") logger = get_logger(module_name=__name__) diff --git a/requirements-dev.txt b/requirements-dev.txt index f02aa48ba9..3f2973d005 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -51,3 +51,4 @@ git+https://github.com/Project-MONAI/MetricsReloaded@monai-support#egg=MetricsRe onnx>=1.13.0 onnxruntime; python_version <= '3.10' typeguard<3 # https://github.com/microsoft/nni/issues/5457 +huggingface_hub diff --git a/setup.cfg b/setup.cfg index 0670b11eec..029ea08513 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,6 +79,7 @@ all = optuna onnx>=1.13.0 onnxruntime; python_version <= '3.10' + huggingface_hub nibabel = nibabel ninja = @@ -145,6 +146,8 @@ onnx = # # workaround https://github.com/Project-MONAI/MONAI/issues/5882 # MetricsReloaded = # MetricsReloaded @ git+https://github.com/Project-MONAI/MetricsReloaded@monai-support#egg=MetricsReloaded +huggingface_hub = + huggingface_hub [flake8] select = B,C,E,F,N,P,T4,W,B9