Skip to content

Commit af0217e

Browse files
committed
Update PyTorch and dependency versions in pyproject.toml and README
- Add Python version-specific PyTorch and torchvision dependencies - Update MMCV find-links to torch2.1.0 - Remove Detectron2 and Super-Gradients installation instructions - Update package versions for Ultralytics and YOLOv5 - Simplify installation instructions for different frameworks
1 parent 5e109a4 commit af0217e

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

README.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ Object detection and instance segmentation are by far the most important applica
9797

9898
- `MMDetection` + `SAHI` walkthrough: <a href="https://colab.research.google.com/github/obss/sahi/blob/main/demo/inference_for_mmdetection.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="sahi-mmdetection"></a>
9999

100-
- `Detectron2` + `SAHI` walkthrough: <a href="https://colab.research.google.com/github/obss/sahi/blob/main/demo/inference_for_detectron2.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="sahi-detectron2"></a>
101-
102100
- `TorchVision` + `SAHI` walkthrough: <a href="https://colab.research.google.com/github/obss/sahi/blob/main/demo/inference_for_torchvision.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="sahi-torchvision"></a>
103101

104102
<a href="https://huggingface.co/spaces/fcakyon/sahi-yolox"><img width="600" src="https://user-images.githubusercontent.com/34196005/144092739-c1d9bade-a128-4346-947f-424ce00e5c4f.gif" alt="sahi-yolox"></a>
@@ -126,39 +124,35 @@ pip install sahi
126124
conda install -c conda-forge shapely
127125
```
128126

129-
- Install your desired version of pytorch and torchvision (cuda 11.3 for detectron2, cuda 11.7 for rest):
127+
- Install your desired version of pytorch and torchvision:
130128

131129
```console
132-
conda install pytorch=1.10.2 torchvision=0.11.3 cudatoolkit=11.3 -c pytorch
130+
pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu126
133131
```
134132

133+
(torch 2.1.2 is required for mmdet support):
134+
135135
```console
136-
conda install pytorch=1.13.1 torchvision=0.14.1 pytorch-cuda=11.7 -c pytorch -c nvidia
136+
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu121
137137
```
138138

139139
- Install your desired detection framework (yolov5):
140140

141141
```console
142-
pip install yolov5==7.0.13
142+
pip install yolov5==7.0.14
143143
```
144144

145145
- Install your desired detection framework (ultralytics):
146146

147147
```console
148-
pip install ultralytics==8.3.50
148+
pip install ultralytics==8.3.86
149149
```
150150

151151
- Install your desired detection framework (mmdet):
152152

153153
```console
154154
pip install mim
155-
mim install mmdet==3.0.0
156-
```
157-
158-
- Install your desired detection framework (detectron2):
159-
160-
```console
161-
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
155+
mim install mmdet==3.3.0
162156
```
163157

164158
- Install your desired detection framework (huggingface):
@@ -167,12 +161,6 @@ pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113
167161
pip install transformers timm
168162
```
169163

170-
- Install your desired detection framework (super-gradients):
171-
172-
```console
173-
pip install super-gradients==3.3.1
174-
```
175-
176164
</details>
177165

178166
### Framework Agnostic Sliced/Standard Prediction

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sahi = "sahi.cli:app"
4141

4242
[tool.uv]
4343
find-links = [
44-
"https://download.openmmlab.com/mmcv/dist/cpu/torch2.3.0/index.html"
44+
"https://download.openmmlab.com/mmcv/dist/cpu/torch2.1.0/index.html"
4545
]
4646
default-groups = ["dev", "ci"]
4747

@@ -55,8 +55,11 @@ dev = [
5555
]
5656
ci = [
5757
# pytorch should be present for all python versions
58-
"torch==2.3.1+cpu",
59-
"torchvision==0.18.1+cpu",
58+
"torch==2.6.0+cpu;python_version>='3.12'",
59+
"torchvision==0.21.0+cpu;python_version>='3.12'",
60+
# mmdet is supported for python < 3.12
61+
"torch==2.1.2+cpu;python_version<'3.12'",
62+
"torchvision==0.16.2+cpu;python_version<'3.12'",
6063
"mmengine;python_version<'3.12'",
6164
"mmcv==2.1.0;python_version<'3.12'",
6265
"mmdet==3.3.0;python_version<'3.12'",

0 commit comments

Comments
 (0)