Skip to content

Commit 230907e

Browse files
committed
fix: uv pip install jde and mmpose deps without overwriting torch
1 parent 1c65059 commit 230907e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

scripts/install_uv.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if [ "${MODEL,,}" == "detectron2" ] || [ ${MODEL} == "all" ]; then
9696

9797
# clone
9898
if [ -z "$(ls -A ${MODELS_SOURCE_DIR}/detectron2)" ]; then
99-
git clone https://github.com/facebookresearch/detectron2.git ${MODELS_SOURCE_DIR}/detectron2
99+
git clone --single-branch --branch main https://github.com/facebookresearch/detectron2.git ${MODELS_SOURCE_DIR}/detectron2
100100
fi
101101
cd ${MODELS_SOURCE_DIR}/detectron2
102102

@@ -108,7 +108,7 @@ if [ "${MODEL,,}" == "detectron2" ] || [ ${MODEL} == "all" ]; then
108108
# '!' egating set -e when patching has been applied already
109109
! patch -p1 --forward <${SCRIPT_DIR}/0001-detectron2-fpn-bottom-up-separate.patch
110110

111-
uv sync
111+
uv pip install --no-build-isolation -e .
112112

113113
# back to project root
114114
cd ${SCRIPT_DIR}/..
@@ -155,8 +155,7 @@ if [ "${MODEL,,}" == "jde" ] || [ ${MODEL} == "all" ]; then
155155

156156

157157
# install dependent packages
158-
uv add numpy motmetrics numba lap opencv-python munkres
159-
158+
uv pip install numpy motmetrics numba lap opencv-python munkres
160159
# install cython manually from source code with patch
161160
if [ -z "$(ls -A ${SCRIPT_DIR}/cython_bbox)" ]; then
162161
git clone https://github.com/samson-wang/cython_bbox.git ${SCRIPT_DIR}/cython_bbox
@@ -168,8 +167,10 @@ if [ "${MODEL,,}" == "jde" ] || [ ${MODEL} == "all" ]; then
168167

169168
# '!' negating set -e when patching has been applied already
170169
! patch -p1 --forward <../0001-compatible-with-numpy-1.24.1.patch
170+
171171
uv pip install --no-build-isolation -e .
172-
172+
173+
173174
# clone
174175
if [ -z "$(ls -A ${MODELS_SOURCE_DIR}/Towards-Realtime-MOT)" ]; then
175176
git clone https://github.com/Zhongdao/Towards-Realtime-MOT.git ${MODELS_SOURCE_DIR}/Towards-Realtime-MOT
@@ -186,14 +187,13 @@ if [ "${MODEL,,}" == "jde" ] || [ ${MODEL} == "all" ]; then
186187

187188
# '!' negating set -e when patching has been applied already
188189
! patch -p1 --forward <${SCRIPT_DIR}/0001-interface-with-compressai-vision.patch
189-
190+
190191
SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])")
191192
# COPY JDE files into site-package under virtual environment
192193
if [ "${SITE_PACKAGES}" == "" ]; then
193194
echo "error with python site-packages directory, check your system and 'which python'"
194195
echo "ERROR: Fail to install JDE"
195196
fi
196-
197197
mkdir -p ${SITE_PACKAGES}/jde
198198
cp models.py ${SITE_PACKAGES}/jde
199199
cp -r tracker ${SITE_PACKAGES}/jde/
@@ -274,6 +274,7 @@ if [ "${MODEL,,}" == "yolox" ] || [ ${MODEL} == "all" ]; then
274274
cd ${SCRIPT_DIR}/..
275275
fi
276276

277+
277278
if [ "${MODEL,,}" == "mmpose" ] || [ ${MODEL} == "all" ]; then
278279
echo
279280
echo "Installing MMPOSE (reference: https://github.com/open-mmlab/mmpose/tree/main)"
@@ -296,12 +297,8 @@ if [ "${MODEL,,}" == "mmpose" ] || [ ${MODEL} == "all" ]; then
296297
# miminum requirments - no onnx, etc.
297298
uv pip install --no-build-isolation -r requirements/build.txt -r requirements/runtime.txt
298299
uv pip install --no-build-isolation -e .
299-
300-
uv run mim install mmdet==3.1.0
301300

302-
# during the installation isort version might be overwritten.
303-
# hence make sure back to the isort=5.13.2
304-
uv run pip install isort==5.13.2
301+
uv run --no-sync mim install mmdet==3.1.0
305302

306303
if [ "${DOWNLOAD_WEIGHTS}" == "True" ]; then
307304
if [ -z "$(ls -A ${MODELS_WEIGHT_DIR}/mmpose)" ]; then

0 commit comments

Comments
 (0)