Skip to content

Commit 940c15b

Browse files
authored
Merge pull request #147 from johnolafenwa/john/windows-build-fix
John/windows build fix
2 parents da2aace + 48c0cb0 commit 940c15b

File tree

6 files changed

+27
-18
lines changed

6 files changed

+27
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ __pycache__/
1515
windows_packages/
1616
windows_packages_cpu/
1717
windows_packages_gpu/
18+
windows_env_cpu/
19+
windows_env_gpu/
1820
redis/
1921
interpreter/
2022
windows_setup/

download_dependencies.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ function Download($URL, $NAME){
99
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/sharedfiles.zip" -NAME "sharedfiles"
1010
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/interpreter.zip" -NAME "interpreter"
1111
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/redis.zip" -NAME "redis"
12-
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/windows_packages_cpu.zip" -NAME "windows_packages_cpu"
13-
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/windows_packages_gpu.zip" -NAME "windows_packages_gpu"
12+
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/gpu_env.zip" -NAME "windows_env_gpu"
13+
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/cpu_env.zip" -NAME "windows_env_cpu"
1414
Download -URL "https://deepquest.sfo2.digitaloceanspaces.com/deepstack/shared-files/windows_setup.zip" -NAME "windows_setup"

generate_windows_setup.ps1

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ $setup_script += "`nName: ""spanish""; MessagesFile: ""compiler:Languages\Spanis
5959
$setup_script += "`nName: ""turkish""; MessagesFile: ""compiler:Languages\Turkish.isl"""
6060
$setup_script += "`nName: ""ukrainian""; MessagesFile: ""compiler:Languages\Ukrainian.isl"""
6161

62-
63-
$setup_script += "`n`n[Tasks]"
64-
$setup_script += "`nName: ""desktopicon""; Description: ""{cm:CreateDesktopIcon}""; GroupDescription: ""{cm:AdditionalIcons}""; Flags: unchecked"
65-
$setup_script += "`nName: ""quicklaunchicon""; Description: ""{cm:CreateQuickLaunchIcon}""; GroupDescription: ""{cm:AdditionalIcons}""; Flags: unchecked; OnlyBelowVersion: 0,6.1"
66-
6762
$setup_script += "`n`n[Files]"
68-
$setup_script += "`nSource: ""$PSScriptRoot\server\deepstack.exe""; DestDir: ""{app}""; Flags: ignoreversion"
69-
$setup_script += "`nSource: ""$PSScriptRoot\*""; DestDir: ""{app}"";"
7063
$setup_script += "`nSource: ""$PSScriptRoot\intelligencelayer\*""; DestDir: ""{app}\intelligencelayer""; Flags: ignoreversion recursesubdirs createallsubdirs"
7164
$setup_script += "`nSource: ""$PSScriptRoot\interpreter\*""; DestDir: ""{app}\interpreter""; Flags: ignoreversion recursesubdirs createallsubdirs"
7265
$setup_script += "`nSource: ""$PSScriptRoot\redis\*""; DestDir: ""{app}\redis""; Flags: ignoreversion recursesubdirs createallsubdirs"
@@ -83,21 +76,21 @@ $setup_script += "`nSource: ""$PSScriptRoot\sharedfiles\face.pt""; DestDir: ""{a
8376
$setup_script += "`nSource: ""$PSScriptRoot\sharedfiles\facerec-high.model""; DestDir: ""{app}\sharedfiles""; Flags: ignoreversion"
8477
$setup_script += "`nSource: ""$PSScriptRoot\sharedfiles\scene.pt""; DestDir: ""{app}\sharedfiles""; Flags: ignoreversion"
8578
$setup_script += "`nSource: ""$PSScriptRoot\sharedfiles\yolov5m.pt""; DestDir: ""{app}\sharedfiles""; Flags: ignoreversion"
79+
$setup_script += "`nSource: ""$PSScriptRoot\sharedfiles\bebygan_x4.pth""; DestDir: ""{app}\sharedfiles""; Flags: ignoreversion"
80+
8681
if($Platform -eq "CPU"){
87-
$setup_script += "`nSource: ""$PSScriptRoot\windows_packages_cpu\*""; DestDir: ""{app}\windows_packages""; Flags: ignoreversion recursesubdirs createallsubdirs"
82+
$setup_script += "`nSource: ""$PSScriptRoot\windows_env_cpu\*""; DestDir: ""{app}\windows_env""; Flags: ignoreversion recursesubdirs createallsubdirs"
8883
}
8984
elseif($Platform -eq "GPU"){
90-
$setup_script += "`nSource: ""$PSScriptRoot\windows_packages_gpu\*""; DestDir: ""{app}\windows_packages""; Flags: ignoreversion recursesubdirs createallsubdirs"
85+
$setup_script += "`nSource: ""$PSScriptRoot\windows_env_gpu\*""; DestDir: ""{app}\windows_env""; Flags: ignoreversion recursesubdirs createallsubdirs"
9186
}
9287

88+
$setup_script += "`nSource: ""$PSScriptRoot\run_script.bat""; DestDir: ""{app}""; Flags: ignoreversion"
9389
$setup_script += "`nSource: ""$PSScriptRoot\logo.ico""; DestDir: ""{app}""; Flags: ignoreversion"
9490
$setup_script += "`nSource: ""$PSScriptRoot\init.py""; DestDir: ""{app}""; Flags: ignoreversion"
9591

9692
$setup_script += "`n`n[Icons]"
97-
$setup_script += "`nName: ""{group}\{#MyAppName}""; Filename: ""{app}\{#MyAppExeName}"""
9893
$setup_script += "`nName: ""{group}\{cm:UninstallProgram,{#MyAppName}}""; Filename: ""{uninstallexe}"""
99-
$setup_script += "`nName: ""{commondesktop}\{#MyAppName}""; Filename: ""{app}\{#MyAppExeName}""; IconFilename: {app}\{#MyAppIcon}; Tasks: desktopicon quicklaunchicon"
100-
$setup_script += "`nName: ""{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}""; Filename: ""{app}\{#MyAppExeName}""; IconFilename: {app}\{#MyAppIcon}; Tasks: quicklaunchicon"
10194

10295
$setup_script += "`n[Code]"
10396
$setup_script += "`nprocedure CurStepChanged(CurStep: TSetupStep);"

requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
onnxruntime==0.4.0
21
redis
32
opencv-python
43
Cython
@@ -7,4 +6,7 @@ scipy
76
tqdm
87
tensorboard
98
PyYAML
10-
Matplotlib
9+
Matplotlib
10+
easydict
11+
future
12+
numpy

run_script.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
call C:\DeepStack\windows_env\Scripts\Activate.bat
2+
3+
if "%2"=="" ( python %1 ) else ( python %1 --model %2 --name %3 )

server/server.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,7 @@ func main() {
901901
var mode string
902902
var certPath string
903903
var sendLogs string
904+
var threadcount int
904905

905906
if os.Getenv("PROFILE") == "" {
906907
os.Chdir("C://DeepStack//server")
@@ -942,6 +943,13 @@ func main() {
942943
flag.Float64Var(&request_timeout, "TIMEOUT", floatTimeoutVal, "request timeout in seconds")
943944
}
944945

946+
intThreadcountVal, err := strconv.Atoi(os.Getenv("THREADCOUNT"))
947+
if err != nil {
948+
flag.IntVar(&threadcount, "THREADCOUNT", 5, "number of threads to use for each endpoint")
949+
} else {
950+
flag.IntVar(&threadcount, "THREADCOUNT", intThreadcountVal, "number of threads to use for each endpoint")
951+
}
952+
945953
mode_val, mode_set := os.LookupEnv("MODE")
946954

947955
if mode_set {
@@ -989,7 +997,7 @@ func main() {
989997
if PROFILE == "windows_native" {
990998

991999
APPDIR = "C://DeepStack"
992-
interpreter = filepath.Join(APPDIR, "interpreter", "python.exe")
1000+
interpreter = "C://DeepStack//run_script.bat"
9931001
redis_server = filepath.Join(APPDIR, "redis", "redis-server.exe")
9941002

9951003
os.Setenv("VISION-FACE", visionFace)
@@ -998,6 +1006,7 @@ func main() {
9981006
os.Setenv("VISION-ENHANCE", visionEnhance)
9991007
os.Setenv("APPDIR", APPDIR)
10001008
os.Setenv("MODE", mode)
1009+
os.Setenv("THREADCOUNT", strconv.Itoa(threadcount))
10011010
}
10021011

10031012
if DATA_DIR == "" {
@@ -1253,7 +1262,7 @@ func main() {
12531262

12541263
modelcmd := exec.CommandContext(ctx, "bash", "-c", interpreter+" "+detectionScript+" --model "+file+" --name "+model_name)
12551264
if PROFILE == "windows_native" {
1256-
modelcmd = exec.CommandContext(ctx, interpreter, detectionScript, "--model", file, "--name", model_name)
1265+
modelcmd = exec.CommandContext(ctx, interpreter, detectionScript, file, model_name)
12571266
}
12581267
startedProcesses = append(startedProcesses, modelcmd)
12591268
modelcmd.Dir = filepath.Join(APPDIR, "intelligencelayer/shared")

0 commit comments

Comments
 (0)