Skip to content

Commit 800dce9

Browse files
committed
install: with uv, prepare every model
1 parent 6e27932 commit 800dce9

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

‎scripts/install.sh‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ VISION_MODELS=(
2424
efficientvit_sam_xl1
2525
)
2626

27+
# Models referenced as path sources in pyproject.toml [tool.uv.sources].
28+
UV_PATH_SOURCE_MODELS=(
29+
detectron2
30+
jde
31+
yolox
32+
mmpose
33+
segment_anything
34+
sam2
35+
)
36+
2737
# Default versions
2838
TORCH_VERSION="2.0.0"
2939
TORCHVISION_VERSION="0.15.1"
@@ -247,10 +257,18 @@ run_prepare() {
247257
detect_env
248258
mkdir -p "${MODELS_SOURCE_DIR}"
249259

250-
echo "Selected Models to be prepared: ${MODEL}"
260+
local models_to_prepare="${MODEL,,}"
261+
if [[ "${PACKAGE_MANAGER}" == "uv" && "${models_to_prepare}" != "all" ]]; then
262+
# uv.lock is universal: `uv lock` / `uv sync` read every path source in
263+
# [tool.uv.sources], including models that are not installed, so all of
264+
# them must be present. Only the selected models get installed.
265+
models_to_prepare+=" ${UV_PATH_SOURCE_MODELS[*]}"
266+
fi
267+
268+
echo "Selected Models to be prepared: ${models_to_prepare}"
251269

252270
for model in "${VISION_MODELS[@]}"; do
253-
if [[ " ${MODEL,,} " != *" ${model} "* ]] && [[ "${MODEL,,}" != "all" ]]; then
271+
if [[ " ${models_to_prepare} " != *" ${model} "* ]] && [[ "${models_to_prepare}" != "all" ]]; then
254272
continue
255273
fi
256274
# JDE has a dependency on cython_bbox, so prepare it first.

0 commit comments

Comments
 (0)