Skip to content

Commit 9d54184

Browse files
committed
Including OS codename info in install scripts
1 parent a072b0b commit 9d54184

File tree

7 files changed

+30
-1413
lines changed

7 files changed

+30
-1413
lines changed

modules/ObjectDetectionYOLOv5-6.2/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fi
7979

8080
# OpenCV needs a specific version for macOS 11
8181
# https://github.com/opencv/opencv-python/issues/777#issuecomment-1879553756
82-
if [ "$os_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
82+
if [ "$os_code_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
8383
installPythonPackagesByName "opencv-python==4.6.0.66" "OpenCV 4.6.0.66 for macOS 11.x"
8484
fi
8585

src/SDK/Python/src/codeproject_ai_sdk/module_runner.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ def get_requirements_filepath(self) -> str:
12791279
# then GPU, then CPU. With a query at each step for OS and architecture.
12801280

12811281
filename = ""
1282-
os_name = self.system_info.os.lower()
1282+
os = self.system_info.os.lower()
12831283
arch = self.system_info.cpu_arch.lower()
12841284

12851285
if self.system_info.system == 'Raspberry Pi':
@@ -1302,34 +1302,34 @@ def get_requirements_filepath(self) -> str:
13021302

13031303
if self.system_info.hasTorchCuda:
13041304
# TODO: Get the specific CUDA version and then add tests for .cudaMajor, .cudaMajor_Minor
1305-
if os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.{arch}.cuda.txt")):
1306-
filename = f"requirements.{os_name}.{arch}.cuda.txt"
1307-
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.cuda.txt")):
1308-
filename = f"requirements.{os_name}.cuda.txt"
1305+
if os.path.exists(os.path.join(self.module_path, f"requirements.{os}.{arch}.cuda.txt")):
1306+
filename = f"requirements.{os}.{arch}.cuda.txt"
1307+
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os}.cuda.txt")):
1308+
filename = f"requirements.{os}.cuda.txt"
13091309
elif os.path.exists(os.path.join(self.module_path, f"requirements.cuda.txt")):
13101310
filename = f"requirements.cuda.txt"
13111311

13121312
if self.system_info.hasTorchROCm:
1313-
if os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.{arch}.rocm.txt")):
1314-
filename = f"requirements.{os_name}.{arch}.rocm.txt"
1315-
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.rocm.txt")):
1316-
filename = f"requirements.{os_name}.rocm.txt"
1313+
if os.path.exists(os.path.join(self.module_path, f"requirements.{os}.{arch}.rocm.txt")):
1314+
filename = f"requirements.{os}.{arch}.rocm.txt"
1315+
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os}.rocm.txt")):
1316+
filename = f"requirements.{os}.rocm.txt"
13171317
elif os.path.exists(os.path.join(self.module_path, f"requirements.rocm.txt")):
13181318
filename = f"requirements.rocm.txt"
13191319

13201320
if not filename:
1321-
if os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.{arch}.gpu.txt")):
1322-
filename = f"requirements.{os_name}.{arch}.gpu.txt"
1323-
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.gpu.txt")):
1324-
filename = f"requirements.{os_name}.gpu.txt"
1321+
if os.path.exists(os.path.join(self.module_path, f"requirements.{os}.{arch}.gpu.txt")):
1322+
filename = f"requirements.{os}.{arch}.gpu.txt"
1323+
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os}.gpu.txt")):
1324+
filename = f"requirements.{os}.gpu.txt"
13251325
elif os.path.exists(os.path.join(self.module_path, f"requirements.gpu.txt")):
13261326
filename = f"requirements.gpu.txt"
13271327

13281328
if not filename:
1329-
if os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.{arch}.txt")):
1330-
filename = f"requirements.{os_name}.{arch}.txt"
1331-
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os_name}.txt")):
1332-
filename = f"requirements.{os_name}.txt"
1329+
if os.path.exists(os.path.join(self.module_path, f"requirements.{os}.{arch}.txt")):
1330+
filename = f"requirements.{os}.{arch}.txt"
1331+
elif os.path.exists(os.path.join(self.module_path, f"requirements.{os}.txt")):
1332+
filename = f"requirements.{os}.txt"
13331333
elif os.path.exists(os.path.join(self.module_path, f"requirements.txt")):
13341334
filename = f"requirements.txt"
13351335

src/SDK/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ "$os" = "linux" ]; then
6969
else
7070
if [ "${verbosity}" = "quiet" ]; then
7171

72-
if [ "$os_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
72+
if [ "$os_code_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
7373
writeLine "** Installing System.Drawing support. On macOS 11 this could take a looong time" "$color_warn"
7474
else
7575
write "Installing System.Drawing support "

src/demos/clients/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ setupPython
3030

3131
# OpenCV needs a specific version for macOS 11
3232
# https://github.com/opencv/opencv-python/issues/777#issuecomment-1879553756
33-
if [ "$os_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
33+
if [ "$os_code_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
3434
installPythonPackagesByName "opencv-python==4.6.0.66" "OpenCV 4.6.0.66 for macOS 11.x"
3535
fi
3636

src/demos/modules/PythonSimple/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121

2222
# OpenCV needs a specific version for macOS 11
2323
# https://github.com/opencv/opencv-python/issues/777#issuecomment-1879553756
24-
if [ "$os_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
24+
if [ "$os_code_name" = "Big Sur" ]; then # macOS 11.x on Intel, kernal 20.x
2525
installPythonPackagesByName "opencv-python==4.6.0.66" "OpenCV 4.6.0.66 for macOS 11.x"
2626
fi
2727

0 commit comments

Comments
 (0)