Skip to content

Commit 6c8042a

Browse files
committed
install: refactor cttc mode in function
1 parent 9c1e9bc commit 6c8042a

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

scripts/install.sh

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,29 +122,13 @@ detect_env() {
122122
}
123123

124124
main () {
125-
# --- FCM CTTC Installation ---
126-
if [[ "${FCM_CTTC}" == "True" ]]; then
127-
echo "🚀 FCM CTTC Mode Enabled: Enforcing strict versions for all models."
128-
TORCH_VERSION="2.0.0"
129-
# Correct torchvision version for torch 2.0.0
130-
TORCHVISION_VERSION="0.15.1"
131-
CUDA_VERSION="11.8"
132-
MODEL="detectron2 jde yolox"
133-
CPU="False"
134-
135-
# Verify CUDA version
136-
DETECTED_CUDA=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p')
137-
if [[ "${DETECTED_CUDA}" != "${CUDA_VERSION}" ]]; then
138-
echo "[ERROR] FCM CTTC Mode requires CUDA v${CUDA_VERSION}, but detected v${DETECTED_CUDA}."
139-
echo "Please ensure that your environment has CUDA v${CUDA_VERSION} installed."
140-
exit 1
141-
fi
142-
echo "CUDA version check passed for FCM CTTC Mode."
143-
fi
144-
# --- End FCM CTTC Mode Logic ---
145125

146126
detect_env
147127

128+
if [[ "${FCM_CTTC}" == "True" ]]; then
129+
run_install_fcm_cttc
130+
fi
131+
148132
if [[ "${NO_PREPARE}" == "False" ]]; then
149133
run_prepare
150134
else
@@ -162,6 +146,24 @@ main () {
162146
fi
163147
}
164148

149+
run_install_fcm_cttc() {
150+
echo "🚀 FCM CTTC Mode Enabled: Enforcing strict versions for all models."
151+
TORCH_VERSION="2.0.0"
152+
# Correct torchvision version for torch 2.0.0
153+
TORCHVISION_VERSION="0.15.1"
154+
CTTC_CUDA_VERSION="11.8"
155+
MODEL="detectron2 jde yolox"
156+
CPU="False"
157+
158+
# Verify CUDA version
159+
if [[ "${CUDA_VERSION}" != "${CTTC_CUDA_VERSION}" ]]; then
160+
echo "[ERROR] FCM CTTC Mode requires CUDA ${CTTC_CUDA_VERSION}, but detected ${CUDA_VERSION}."
161+
echo "Please ensure that your environment has CUDA ${CTTC_CUDA_VERSION} installed."
162+
exit 1
163+
fi
164+
exit 1
165+
}
166+
165167
run_prepare() {
166168
detect_env
167169
mkdir -p "${MODELS_SOURCE_DIR}"
@@ -493,7 +495,7 @@ download_weights () {
493495
echo "Downloading model weights for ${model}..."
494496
echo
495497

496-
FILTER="^[0-9a-fA-F]* ${model}/"
498+
FILTER="[0-9a-fA-F]* ${model}/"
497499
FILTERED_WEIGHTS=$(echo "$WEIGHTS" | grep "${FILTER}")
498500

499501
echo "${FILTERED_WEIGHTS}" | while read -r entry; do

0 commit comments

Comments
 (0)