Skip to content

Commit e3868f8

Browse files
author
ChrisMaunder
committed
Corrections for macOS on Apple Silicaon
1 parent 1081307 commit e3868f8

File tree

3 files changed

+53
-44
lines changed

3 files changed

+53
-44
lines changed

Installers/Dev/utils.sh

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,37 @@ function isDarkMode () {
173173
fi
174174
}
175175

176+
function errorNoPython () {
177+
writeLine
178+
writeLine
179+
writeLine "----------------------------------------------------------------------" $color_primary
180+
writeLine "Error: Python not installed" $color_error
181+
writeLine
182+
writeLine
183+
184+
quit
185+
}
186+
187+
function spin () {
188+
189+
local pid=$1
190+
191+
spin[0]='-'
192+
spin[1]='\\'
193+
spin[2]='|'
194+
spin[3]='/'
195+
196+
while kill -0 $pid 2> /dev/null; do
197+
for i in "${spin[@]}"
198+
do
199+
echo -ne "$i\b"
200+
sleep 0.1
201+
done
202+
done
203+
204+
echo -ne ' \b'
205+
}
206+
176207
# Outputs a line, including linefeed, to the terminal using the given foreground
177208
# / background colors
178209
#
@@ -552,28 +583,28 @@ function installPythonPackages () {
552583

553584
requirementsFilename=""
554585

555-
if /i "!enableGPU!" == "true" (
586+
if [ "!enableGPU!" == "true" ]; then
556587
if [ "$hasCUDA" == "true" ]; then
557-
if [ ! -f "${requirementsDir}/requirements.${platform}.cuda.txt" ]; then
588+
if [ -f "${requirementsDir}/requirements.${platform}.cuda.txt" ]; then
558589
requirementsFilename="requirements.${platform}.cuda.txt"
559-
elif [ ! -f "${requirementsDir}/requirements.cuda.txt" ]; then
590+
elif [ -f "${requirementsDir}/requirements.cuda.txt" ]; then
560591
requirementsFilename="requirements.cuda.txt"
561592
fi
562593
fi
563594

564595
if [ "$requirementsFilename" == "" ]; then
565-
if [ ! -f "${requirementsDir}/requirements.${platform}.gpu.txt" ]; then
596+
if [ -f "${requirementsDir}/requirements.${platform}.gpu.txt" ]; then
566597
requirementsFilename="requirements.${platform}.gpu.txt"
567-
elif [ ! -f "${requirementsDir}/requirements.gpu.txt" ]; then
598+
elif [ -f "${requirementsDir}/requirements.gpu.txt" ]; then
568599
requirementsFilename="requirements.gpu.txt"
569600
fi
570601
fi
571602
fi
572603

573604
if [ "$requirementsFilename" == "" ]; then
574-
if [ ! -f "${requirementsDir}/requirements.${platform}.txt" ]; then
605+
if [ -f "${requirementsDir}/requirements.${platform}.txt" ]; then
575606
requirementsFilename="requirements.${platform}.txt"
576-
elif [ ! -f "${requirementsDir}/requirements.txt" ]; then
607+
elif [ -f "${requirementsDir}/requirements.txt" ]; then
577608
requirementsFilename="requirements.txt"
578609
fi
579610
fi
@@ -582,10 +613,15 @@ function installPythonPackages () {
582613
requirementsPath="${requirementsDir}/${requirementsFilename}"
583614
fi
584615

585-
if [ "$requirementsFilename" == "" ] || [ ! -f "$requirementsPath" ]; then
616+
if [ "$requirementsFilename" == "" ]; then
586617
writeLine "No suitable requirements.txt file found." $color_warn
587618
return
588-
)
619+
fi
620+
621+
if [ ! -f "$requirementsPath" ]; then
622+
writeLine "Can't find ${requirementsPath} file." $color_warn
623+
return
624+
fi
589625

590626
virtualEnv="${analysisLayerPath}/bin/${platform}/${pythonName}/venv"
591627

@@ -731,37 +767,6 @@ function installPythonPackages () {
731767
fi
732768
}
733769

734-
function errorNoPython () {
735-
writeLine
736-
writeLine
737-
writeLine "----------------------------------------------------------------------" $color_primary
738-
writeLine "Error: Python not installed" $color_error
739-
writeLine
740-
writeLine
741-
742-
quit
743-
}
744-
745-
function spin () {
746-
747-
local pid=$1
748-
749-
spin[0]='-'
750-
spin[1]='\\'
751-
spin[2]='|'
752-
spin[3]='/'
753-
754-
while kill -0 $pid 2> /dev/null; do
755-
for i in "${spin[@]}"
756-
do
757-
echo -ne "$i\b"
758-
sleep 0.1
759-
done
760-
done
761-
762-
echo -ne ' \b'
763-
}
764-
765770
function getFromServer () {
766771

767772
# eg packages_for_gpu.zip
@@ -793,7 +798,7 @@ function getFromServer () {
793798

794799
pushd "${downloadPath}/${moduleDir}/" >/dev/null 2>/dev/null
795800
mv * "${modulePath}/${moduleAssetsDir}/"
796-
popd
801+
popd >/dev/null 2>/dev/null
797802
fi
798803
fi
799804
}

src/AnalysisLayer/Vision/intelligencelayer/Vision.pyproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<DependentUpon>..\modulesettings.json</DependentUpon>
3737
<Link>modulesettings.macos.json</Link>
3838
</Content>
39+
<Content Include="..\modulesettings.macos-arm.json">
40+
<DependentUpon>..\modulesettings.json</DependentUpon>
41+
<Link>modulesettings.macos-arm.json</Link>
42+
</Content>
3943
<Content Include="..\modulesettings.windows.json">
4044
<DependentUpon>..\modulesettings.json</DependentUpon>
4145
<Link>modulesettings.windows.json</Link>

src/AnalysisLayer/Vision/modulesettings.macos-arm.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
"FaceProcessing": {
66
"EnvironmentVariables": {
77
"CPAI_PORT": 5500,
8-
"DATA_DIR": "/Library/Application Support/CodeProject/SenseAI"
8+
"DATA_DIR": "/Library/Application Support/CodeProject/AI"
99
}
1010
},
1111
"SceneClassification": {
1212
"EnvironmentVariables": {
1313
"CPAI_PORT": 5500,
14-
"DATA_DIR": "/Library/Application Support/CodeProject/SenseAI"
14+
"DATA_DIR": "/Library/Application Support/CodeProject/AI"
1515
}
1616
},
1717
"VisionObjectDetection": {
1818
"EnvironmentVariables": {
1919
"CPAI_PORT": 5500,
20-
"DATA_DIR": "/Library/Application Support/CodeProject/SenseAI"
20+
"DATA_DIR": "/Library/Application Support/CodeProject/AI"
2121
}
2222
}
2323
}

0 commit comments

Comments
 (0)