Skip to content

Commit

Permalink
Add (optional) extras dependencies (facebookresearch#183)
Browse files Browse the repository at this point in the history
Add (optional) extras dependencies for dense tasks (mmcv and mmsegmentation) to conda and pip requirements.
  • Loading branch information
patricklabatut authored Aug 31, 2023
1 parent 81b2b64 commit 3a7bf1c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ conda activate dinov2
pip install -r requirements.txt
```

For dense tasks (depth estimation and semantic segmentation), there are additional dependencies (specific versions of `mmcv` and `mmsegmentation`) which are captured in the `extras` dependency specifications:

*[conda](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html)* **(Recommended)**:

```shell
conda env create -f conda-extras.yaml
conda activate dinov2-extras
```

*[pip](https://pip.pypa.io/en/stable/getting-started/)*:

pip install -r requirements.txt -r requirements-extras.txt

## Data preparation

### ImageNet-1k
Expand Down
24 changes: 24 additions & 0 deletions conda-extras.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: dinov2-extras
channels:
- defaults
- pytorch
- nvidia
- xformers
- conda-forge
dependencies:
- python=3.9
- pytorch::pytorch=2.0.0
- pytorch::pytorch-cuda=11.7.0
- pytorch::torchvision=0.15.0
- omegaconf
- torchmetrics=0.10.3
- fvcore
- iopath
- xformers::xformers=0.0.18
- pip
- pip:
- git+https://github.com/facebookincubator/submitit
- --extra-index-url https://pypi.nvidia.com
- cuml-cu11
- mmcv-full==1.5.0
- mmsegmentation==0.27.0
2 changes: 2 additions & 0 deletions requirements-extras.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mmcv-full==1.5.0
mmsegmentation==0.27.0
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_package_version() -> str:
requirements, extra_indices = get_requirements()
version = get_package_version()
dev_requirements, _ = get_requirements(HERE / "requirements-dev.txt")
extras_requirements, _ = get_requirements(HERE / "requirements-extras.txt")


setup(
Expand All @@ -66,10 +67,11 @@ def get_package_version() -> str:
"": ["*.yaml"],
},
install_requires=requirements,
dependency_links=extra_indices,
extras_require={
"dev": dev_requirements,
"extras": extras_requirements,
},
dependency_links=extra_indices,
install_package_data=True,
license="Apache",
license_files=("LICENSE",),
Expand Down

0 comments on commit 3a7bf1c

Please sign in to comment.