Skip to content

Commit e98b7f6

Browse files
author
ChrisMaunder
committed
Updated to 1.6.8: side-load modules, Skia for better x-platform images, logging improvements
1 parent 0ebba72 commit e98b7f6

File tree

115 files changed

+4258
-1559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4258
-1559
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
/src/AnalysisLayer/ObjectDetectionNet/assets/
1414
/src/AnalysisLayer/Vision/assets
1515

16+
# Generate Wix files.
17+
*Files.wxs
18+
1619
/src/API/Server/FrontEnd/installconfig.json
1720

1821
# User-specific files
@@ -375,6 +378,12 @@ FodyWeavers.xsd
375378

376379
*.DS_Store
377380

378-
/demos/Python/Vision/detected
381+
/Installers/zlib123dllx64.zip
382+
/Installers/cudnn-windows-x86_64-8.5.0.96_cuda11-archive.zip
383+
/src/AnalysisLayer/Vision/datastore/faceembedding.db
379384
/src/AnalysisLayer/ObjectDetectionYolo/assets
385+
/src/AnalysisLayer/ObjectDetectionYolo/custom
386+
/src/AnalysisLayer/CustomObjectDetection/assets
380387
/src/AnalysisLayer/ObjectDetectionYolo/custom-models
388+
/demos/Python/Vision/detected
389+
/src/modules/ALPR/paddleocr

CodeProject.AI.sln

Lines changed: 79 additions & 1 deletion
Large diffs are not rendered by default.

Installers/Dev/clean.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if /i "%cleanBuild%" == "true" (
6363
call utils.bat WriteLine "Cleaning Build " "White" "Blue"
6464
call utils.bat WriteLine
6565

66-
call :CleanSubDirs ".\..\..\src" "bin" "\AnalysisLayer\bin\"
66+
call :CleanSubDirs ".\..\..\src" "bin" "\AnalysisLayer\bin"
6767
call :CleanSubDirs ".\..\..\src" "obj"
6868
call :CleanSubDirs ".\..\Windows" "bin"
6969
call :CleanSubDirs ".\..\Windows" "obj"

Installers/Dev/setup.dev.bat

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ set downloadDir=downloads
5959
:: The name of the dir holding the backend analysis services
6060
set analysisLayerDir=AnalysisLayer
6161

62+
:: The name of the dir holding the downloaded/sideloaded backend analysis services
63+
set sideloadModulesDir=modules
64+
6265
:: Absolute paths :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
6366
:: The absolute path to the root directory of CodeProject.AI
6467
set installBasePath=%cd%
@@ -69,6 +72,7 @@ cd %installBasePath%
6972

7073
:: The location of directories relative to the root of the solution directory
7174
set analysisLayerPath=%absoluteRootDir%\%srcDir%\%analysisLayerDir%
75+
set sideloadModulesPath=%absoluteRootDir%\%srcDir%\%sideloadModulesDir%
7276
set downloadPath=%absoluteRootDir%\Installers\%downloadDir%
7377

7478

@@ -143,7 +147,29 @@ for /f "delims=" %%D in ('dir /a:d /b "%analysisLayerPath%"') do (
143147
if exist "!modulePath!\install.dev.bat" (
144148

145149
REM Pad right to 60 chars
146-
set announcement=Processing !moduleDir! !spaces!
150+
set announcement=Processing pre-installed module !moduleDir! !spaces!
151+
set announcement=!announcement:~0,70!
152+
153+
call utils.bat WriteLine
154+
call utils.bat WriteLine "!announcement!" "White" "Blue"
155+
call utils.bat WriteLine
156+
157+
call "!modulePath!\install.dev.bat"
158+
)
159+
)
160+
)
161+
162+
:: Walk through the sideloaded / downloaded modules directory and call the setup script in each dir
163+
:: TODO: This should be just a simple for /d %%D in ("%sideloadModulesPath%") do (
164+
for /f "delims=" %%D in ('dir /a:d /b "%sideloadModulesPath%"') do (
165+
set moduleDir=%%~nxD
166+
set modulePath=!sideloadModulesPath!\!moduleDir!
167+
168+
if /i "!moduleDir!" NEQ "bin" (
169+
if exist "!modulePath!\install.dev.bat" (
170+
171+
REM Pad right to 60 chars
172+
set announcement=Processing side-loaded module !moduleDir! !spaces!
147173
set announcement=!announcement:~0,70!
148174

149175
call utils.bat WriteLine
@@ -155,6 +181,19 @@ for /f "delims=" %%D in ('dir /a:d /b "%analysisLayerPath%"') do (
155181
)
156182
)
157183

184+
185+
:: Demos
186+
set announcement=Processing Demos !spaces!
187+
set announcement=!announcement:~0,70!
188+
call utils.bat WriteLine
189+
call utils.bat WriteLine "!announcement!" "White" "Blue"
190+
call utils.bat WriteLine
191+
192+
set moduleDir=demos
193+
set modulePath=%absoluteRootDir%\!moduleDir!
194+
call "!modulePath!\install.dev.bat"
195+
196+
158197
call utils.bat WriteLine
159198
call utils.bat WriteLine "Modules installed" "Green"
160199

Installers/Dev/setup.dev.sh

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ downloadDir='downloads'
9393
# The name of the dir holding the backend analysis services
9494
analysisLayerDir='AnalysisLayer'
9595

96+
:: The name of the dir holding the downloaded/sideloaded backend analysis services
97+
sideloadModulesDir="modules"
98+
9699
# Absolute paths :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
97100
# The absolute path to the root directory of CodeProject.AI
98101
currentDir="$(pwd)"
@@ -102,6 +105,7 @@ cd $currentDir
102105

103106
# The location of directories relative to the root of the solution directory
104107
analysisLayerPath="${absoluteRootDir}/${srcDir}/${analysisLayerDir}"
108+
sideloadModulesPath="${absoluteRootDir}/${srcDir}/${sideloadModulesDir}"
105109
downloadPath="${absoluteRootDir}/Installers/${downloadDir}"
106110

107111
# Set Flags
@@ -200,7 +204,36 @@ for d in ${analysisLayerPath}/*/ ; do
200204
if [ -f "${modulePath}/install.dev.sh" ]; then
201205

202206
# Pad right to 70 chars
203-
announcement=$(printf %-70s "Processing ${moduleDir}")
207+
announcement=$(printf %-70s "Processing pre-installed module ${moduleDir}")
208+
209+
writeLine
210+
writeLine "${announcement}" "White" "Blue"
211+
writeLine
212+
213+
correctLineEndings "${modulePath}/install.dev.sh"
214+
source "${modulePath}/install.dev.sh"
215+
fi
216+
fi
217+
done
218+
219+
# Walk through the sideloaded / downloaded modules directory and call the setup script in each dir
220+
for d in ${analysisLayerPath}/*/ ; do
221+
222+
moduleDir="$(basename $d)"
223+
modulePath=$d
224+
225+
if [ "${modulePath: -1}" == "/" ]; then
226+
modulePath="${modulePath:0:${#modulePath}-1}"
227+
fi
228+
229+
# dirname=${moduleDir,,} # requires bash 4.X, which isn't on macOS by default
230+
dirname=$(echo $moduleDir | tr '[:upper:]' '[:lower:]')
231+
if [ "${dirname}" != 'bin' ]; then
232+
233+
if [ -f "${modulePath}/install.dev.sh" ]; then
234+
235+
# Pad right to 70 chars
236+
announcement=$(printf %-70s "Processing side-loaded module ${moduleDir}")
204237

205238
writeLine
206239
writeLine "${announcement}" "White" "Blue"
@@ -212,6 +245,17 @@ for d in ${analysisLayerPath}/*/ ; do
212245
fi
213246
done
214247

248+
# demos
249+
moduleDir="demos"
250+
modulePath="${absoluteRootDir}/${moduleDir}"
251+
announcement=$(printf %-70s "Processing demos")
252+
writeLine
253+
writeLine "${announcement}" "White" "Blue"
254+
writeLine
255+
correctLineEndings "${modulePath}/install.dev.sh"
256+
source "${modulePath}/install.dev.sh"
257+
258+
215259
# libfontconfig1 is required for SkiaSharp, libgdplus is required for System.Drawing
216260
if [ "${verbosity}" == "quiet" ]; then
217261
write "Installing supporting image libraries..."

Installers/Dev/utils.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ shift & goto :%~1
355355
if not exist "!installPath!" (
356356

357357
rem Params are: S3 storage bucket | fileToGet | downloadToDir | dirToSaveTo | message
358-
call :DownloadAndExtract "%storageUrl%" "!pythonName!.zip" "!baseDir!" "!pythonName!" "Downloading Python !pythonVersion! interpreter..."
358+
call :DownloadAndExtract "%storageUrl%" "!pythonName!.zip" "!baseDir!" "!pythonName!" "Downloading Python !pythonVersion! interpreter..."
359359
if exist "!downloadPath!\!platform!\!pythonName!" (
360360
robocopy /e "!downloadPath!\!platform!\!pythonName! " "!installPath! " !roboCopyFlags! > NUL
361361
)
@@ -473,9 +473,9 @@ shift & goto :%~1
473473
REM python compatible version.
474474
call :Write "Ensuring Python package manager (pip) is installed..."
475475
if /i "%verbosity%" == "quiet" (
476-
!pythonPath! -m ensurepip !pipFlags! >nul 2>nul
476+
!pythonPath! -m ensurepip >nul 2>nul
477477
) else (
478-
!pythonPath! -m ensurepip !pipFlags!
478+
!pythonPath! -m ensurepip
479479
)
480480
call :WriteLine "Done" %color_success%
481481

Installers/Dev/utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Color () {
2222
local foreground=$1
2323
local background=$2
2424

25-
if [ "$foreground" == "" ]; then foreground='Default'; fi
25+
if [ "$foreground" == "" ]; then foreground='Default'; fi
2626
if [ "$background" == "" ]; then background="$color_background"; fi
2727

2828
if [ "$foreground" == 'Contrast' ]; then
@@ -1014,7 +1014,7 @@ function needRosettaAndiBrew () {
10141014

10151015
function quit () {
10161016

1017-
if [ "${useColor}" == "true" ] && "${darkmode}" == "true" ]; then
1017+
if [ "${useColor}" == "true" ] && [ "${darkmode}" == "true" ]; then
10181018
# this resets the terminal, but also clears the screen which isn't great
10191019
# tput reset
10201020
echo

commands.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"commands": {
3+
"BuildDockerBase": {
4+
"fileName": "cmd.exe",
5+
"workingDirectory": "./Installers/Docker",
6+
"arguments": "/c BuildDockerBase.bat"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)