Skip to content

Commit b117a03

Browse files
committed
fix uv install script
1 parent 9bab60b commit b117a03

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ line-length = 88
7979
[tool.isort]
8080
profile = "black"
8181
skip_gitignore = true
82-
known_third_party = "PIL,pytorch_msssim,torchvision,torch"
82+
known_third_party = "PIL,torchvision,torch"
8383

8484
[tool.uv.sources]
8585
compressai = { workspace = true }

scripts/install_uv.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ mkdir -p ${MODELS_WEIGHT_DIR}
7171
## Make sure we have up-to-date pip and wheel
7272
uv add --upgrade pip wheel
7373

74+
if [ "${CUDA_VERSION}" == "" ] && [ "${CPU}" == "False" ]; then
75+
CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p')
76+
if [ ${CUDA_VERSION} == "" ]; then
77+
echo "error with cuda, check your system, source env_cuda.sh or specify cuda version as argument."
78+
fi
79+
fi
7480
if [ -z "$CUDA_VERSION" ] || [ "$CPU" == "True" ]; then
7581
echo "installing on cpu"
7682
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
@@ -99,13 +105,6 @@ if [ "${MODEL,,}" == "detectron2" ] || [ ${MODEL} == "all" ]; then
99105
echo
100106
git -c advice.detachedHead=false checkout 175b2453c2bc4227b8039118c01494ee75b08136
101107

102-
if [ "${CUDA_VERSION}" == "" ] && [ "${CPU}" == "False" ]; then
103-
CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p')
104-
if [ ${CUDA_VERSION} == "" ]; then
105-
echo "error with cuda, check your system, source env_cuda.sh or specify cuda version as argument."
106-
fi
107-
fi
108-
109108
# '!' egating set -e when patching has been applied already
110109
! patch -p1 --forward <${SCRIPT_DIR}/0001-detectron2-fpn-bottom-up-separate.patch
111110

@@ -169,7 +168,7 @@ if [ "${MODEL,,}" == "jde" ] || [ ${MODEL} == "all" ]; then
169168

170169
# '!' negating set -e when patching has been applied already
171170
! patch -p1 --forward <../0001-compatible-with-numpy-1.24.1.patch
172-
uv pip install -e .
171+
uv pip install --no-build-isolation -e .
173172

174173
# clone
175174
if [ -z "$(ls -A ${MODELS_SOURCE_DIR}/Towards-Realtime-MOT)" ]; then
@@ -281,7 +280,7 @@ if [ "${MODEL,,}" == "mmpose" ] || [ ${MODEL} == "all" ]; then
281280
echo
282281

283282
uv pip install -U openmim
284-
uv run mim install "mmcv==2.0.1"
283+
uv run --no-sync mim install "mmcv==2.0.1"
285284

286285
# clone
287286
if [ -z "$(ls -A ${MODELS_SOURCE_DIR}/mmpose)" ]; then
@@ -295,8 +294,8 @@ if [ "${MODEL,,}" == "mmpose" ] || [ ${MODEL} == "all" ]; then
295294

296295
cd ${MODELS_SOURCE_DIR}/mmpose
297296
# miminum requirments - no onnx, etc.
298-
uv pip install -r requirements.txt
299-
uv pip install -v -e .
297+
uv pip install --no-build-isolation -r requirements/build.txt -r requirements/runtime.txt
298+
uv pip install --no-build-isolation -e .
300299

301300
uv run mim install mmdet==3.1.0
302301

0 commit comments

Comments
 (0)