Skip to content

Commit 2ca253b

Browse files
committed
update pyproject
1 parent b38071f commit 2ca253b

File tree

4 files changed

+4962
-1468
lines changed

4 files changed

+4962
-1468
lines changed

.gitlab-ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ stages:
1717
- bash scripts/install_uv.sh --no-install --no-weights --cpu
1818

1919
uv-install:
20-
image: python:3.10-buster
20+
image: python:3.10-bullseye
2121
stage: setup
2222
script:
2323
- curl -LsSf https://astral.sh/uv/install.sh | sh
@@ -30,7 +30,7 @@ uv-install:
3030
- docker
3131
ruff-lint:
3232
stage: static-analysis
33-
image: python:3.10-buster
33+
image: python:3.10-bullseye
3434
before_script:
3535
- *default-before-script
3636
- uv pip install -U pip wheel setuptools
@@ -42,22 +42,22 @@ ruff-lint:
4242

4343
pytest:
4444
stage: test
45-
image: python:3.10-buster
45+
image: python:3.10-bullseye
4646
before_script:
4747
- apt-get update -y
4848
- apt-get install -y libgl1-mesa-glx build-essential
4949
- *default-before-script
5050
- uv pip install -U pip wheel setuptools
51-
- bash scripts/install_uv.sh --no-weights --cpu
52-
- uv sync --group=dev --group=cpu
51+
- bash scripts/install_uv.sh --no-weights --cpu -m "detectron2,yolox,segment_anything,jde"
52+
- uv sync --group=dev
5353
script:
5454
- uv run --no-sync pytest
5555
tags:
5656
- docker
5757

5858
ruff-format:
5959
stage: static-analysis
60-
image: python:3.10-buster
60+
image: python:3.10-bullseye
6161
before_script:
6262
- *default-before-script
6363
- uv pip install -U pip wheel setuptools
@@ -69,7 +69,7 @@ ruff-format:
6969

7070
ruff-organize-imports:
7171
stage: static-analysis
72-
image: python:3.10-buster
72+
image: python:3.10-bullseye
7373
before_script:
7474
- *default-before-script
7575
- uv pip install -U pip wheel setuptools
@@ -81,7 +81,7 @@ ruff-organize-imports:
8181

8282
doc:
8383
stage: doc
84-
image: python:3.10-buster
84+
image: python:3.10-bullseye
8585
before_script:
8686
- *default-before-script
8787
- uv pip install -U pip wheel setuptools

pyproject.toml

Lines changed: 88 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description = "Evaluation pipelines for Video Compression for Machine Vision on
99
authors = [
1010
{ name = "CompressAI-Vision team", email = "[email protected]" },
1111
]
12-
license = {text = "BSD 3-Clause Clear License"}
1312
readme = "README.md"
1413
urls = { Homepage = "https://github.com/InterDigitalInc/CompressAI-Vision" }
1514
classifiers = [
@@ -19,26 +18,21 @@ classifiers = [
1918
"Programming Language :: Python :: 3.8",
2019
"Programming Language :: Python :: 3.9",
2120
]
22-
23-
requires-python = ">=3.8,<3.9"
24-
21+
requires-python = ">=3.8,<3.11"
2522
dependencies = [
26-
"compressai",
2723
"hydra-core",
2824
"lap>=0.5.12",
2925
"motmetrics>=1.4.0",
3026
"munkres>=1.1.4",
3127
"numba>=0.58.1",
32-
"numpy>=1.24.4",
28+
"numpy>=1.24.4,<2.0; python_version >= '3.8'",
3329
"omegaconf",
34-
"opencv-python>=4.12.0.88",
30+
"opencv-python>=4.8.1.78,<4.12.0",
3531
"pandas",
3632
"pillow>=9.0,<10.0",
3733
"pip>=25.0.1",
3834
"ptflops>=0.7.3",
3935
"Cython==3.0.8",
40-
"torch>=2.0.0",
41-
"torchvision>=0.15.1",
4236
"wheel>=0.45.1",
4337
"yuvio",
4438
]
@@ -74,7 +68,20 @@ cpu = [
7468
"torch>=2.0.0",
7569
"torchvision>=0.15.1",
7670
]
71+
cu118 = [
72+
"torch>=2.0.0",
73+
"torchvision>=0.15.1",
74+
]
75+
cu128 = [
76+
"torch>=2.7.0 ; python_version >= '3.9'",
77+
"torchvision>=0.22.0 ; python_version >= '3.9'",
78+
]
79+
80+
models-detectron2 = [
81+
"detectron2==0.6",
82+
]
7783
models-jde = [
84+
"cython-bbox", # Encourages local cython-bbox source.
7885
"jde",
7986
]
8087
models-mmpose = [
@@ -117,7 +124,23 @@ tutorials = [
117124
"ipywidgets",
118125
"jupyter",
119126
]
127+
cpu = [
128+
"torch>=2.0.0",
129+
"torchvision>=0.15.1",
130+
]
131+
cu118 = [
132+
"torch>=2.0.0",
133+
"torchvision>=0.15.1",
134+
]
135+
cu128 = [
136+
"torch>=2.7.0 ; python_version >= '3.9'",
137+
"torchvision>=0.22.0 ; python_version >= '3.9'",
138+
]
139+
models-detectron2 = [
140+
"detectron2==0.6",
141+
]
120142
models-jde = [
143+
"cython-bbox", # Encourages local cython-bbox source.
121144
"jde",
122145
]
123146
models-mmpose = [
@@ -146,8 +169,16 @@ skip_gitignore = true
146169
known_third_party = "PIL,torchvision,torch"
147170

148171
[tool.uv]
172+
conflicts = [
173+
[
174+
{ extra = "cpu" },
175+
{ extra = "cu118" },
176+
{ extra = "cu128" },
177+
],
178+
]
149179
no-build-isolation-package = [
150180
"chumpy", # build-system.requires: pip
181+
"detectron2", # build-system.requires: Cython, numpy, setuptools
151182
"mmpose", # build-system.requires: numpy, torch
152183
"xtcocotools", # build-system.requires: Cython, numpy
153184
"yolox", # build-system.requires: pycocotools, torch, yolox, ...
@@ -163,6 +194,30 @@ requires-dist = [
163194
"six",
164195
]
165196

197+
[[tool.uv.dependency-metadata]]
198+
name = "detectron2"
199+
version = "0.6"
200+
requires-dist = [
201+
# From https://github.com/facebookresearch/detectron2/blob/main/setup.py
202+
"Pillow>=7.1",
203+
"matplotlib",
204+
"pycocotools>=2.0.2",
205+
"termcolor>=1.1",
206+
"yacs>=0.1.8",
207+
"tabulate",
208+
"cloudpickle",
209+
"tqdm>4.29.0",
210+
"tensorboard",
211+
"fvcore>=0.1.5,<0.1.6",
212+
"iopath>=0.1.7,<0.1.10",
213+
"future",
214+
"pydot",
215+
"dataclasses; python_version<'3.7'",
216+
"omegaconf>=2.1",
217+
"hydra-core>=1.1",
218+
# "black==21.4b2",
219+
]
220+
166221

167222
[[tool.uv.dependency-metadata]]
168223
name = "mmpose"
@@ -226,16 +281,34 @@ name = "pytorch-cpu"
226281
url = "https://download.pytorch.org/whl/cpu"
227282
explicit = true
228283

229-
[tool.uv.overrides]
230-
jde = { path = "models/Towards-Realtime-MOT" }
231-
yolox = { path = "models/yolox" }
232-
segment_anything = { path = "models/segment_anything" }
284+
[[tool.uv.index]]
285+
name = "pytorch-cu118"
286+
url = "https://download.pytorch.org/whl/cu118"
287+
explicit = true
233288

234-
torch = { index = "pytorch-cpu" }
235-
torchvision = { index = "pytorch-cpu" }
289+
[[tool.uv.index]]
290+
name = "pytorch-cu128"
291+
url = "https://download.pytorch.org/whl/cu128"
292+
explicit = true
236293

237294
[tool.uv.sources]
238295
compressai = { workspace = true }
296+
cython-bbox = { path = "scripts/cython_bbox" }
297+
detectron2 = { path = "models/detectron2" }
298+
jde = { path = "models/Towards-Realtime-MOT" }
299+
mmpose = { path = "models/mmpose" }
300+
yolox = { path = "models/yolox" }
301+
segment_anything = { path = "models/segment_anything" }
302+
torch = [
303+
{ index = "pytorch-cpu", extra = "cpu" },
304+
{ index = "pytorch-cu118", extra = "cu118" },
305+
{ index = "pytorch-cu128", extra = "cu128" },
306+
]
307+
torchvision = [
308+
{ index = "pytorch-cpu", extra = "cpu" },
309+
{ index = "pytorch-cu118", extra = "cu118" },
310+
{ index = "pytorch-cu128", extra = "cu128" },
311+
]
239312

240313

241314
[tool.uv.workspace]

0 commit comments

Comments
 (0)