Skip to content

Commit 3be5c0c

Browse files
author
John Olafenwa
committed
updates to windows version
1 parent b245d8f commit 3be5c0c

14 files changed

Lines changed: 50 additions & 27 deletions

File tree

deepstack-setup-cpu.iss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\deepstack\*"; DestDir: "{a
6565
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\interpreter\*"; DestDir: "{app}\interpreter"; Flags: ignoreversion recursesubdirs createallsubdirs
6666
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\redis\*"; DestDir: "{app}\redis"; Flags: ignoreversion recursesubdirs createallsubdirs
6767
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\*"; DestDir: "{app}\server"; Flags: ignoreversion recursesubdirs createallsubdirs
68+
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\platform.windows.cpu.json"; DestDir: "{app}\server\platform.json"; Flags: ignoreversion
69+
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\version.txt"; DestDir: "{app}\server"; Flags: ignoreversion
6870
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\categories_places365.txt"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion
6971
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\face.pt"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion
7072
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\facerec-high.model"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion

deepstack-setup-gpu.iss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\deepstack\*"; DestDir: "{a
6565
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\interpreter\*"; DestDir: "{app}\interpreter"; Flags: ignoreversion recursesubdirs createallsubdirs
6666
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\redis\*"; DestDir: "{app}\redis"; Flags: ignoreversion recursesubdirs createallsubdirs
6767
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\*"; DestDir: "{app}\server"; Flags: ignoreversion recursesubdirs createallsubdirs
68+
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\platform.windows.cpu.json"; DestDir: "{app}\server\platform.json"; Flags: ignoreversion
69+
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\server\version.txt"; DestDir: "{app}\server"; Flags: ignoreversion
6870
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\categories_places365.txt"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion
6971
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\face.pt"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion
7072
Source: "C:\Users\johnolafenwa\Documents\AI\DeepStack\sharedfiles\facerec-high.model"; DestDir: "{app}\sharedfiles"; Flags: ignoreversion

native/DeepStack

Lines changed: 0 additions & 1 deletion
This file was deleted.

platform/platform.docker.cpu.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"PROFILE":"desktop_cpu",
3+
"CUDA_MODE":false
4+
}

platform/platform.docker.gpu.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"PROFILE":"desktop_gpu",
3+
"CUDA_MODE":true
4+
}

platform/platform.jetson.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"PROFILE":"jetson",
3+
"CUDA_MODE":true
4+
}

platform/platform.windows.cpu.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"PROFILE":"windows_native",
3+
"CUDA_MODE":false
4+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"PROFILE":"windows_native",
3-
"GPU":false
3+
"CUDA_MODE":true
44
}

server/deepstack.exe

2 KB
Binary file not shown.

server/server.go

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ var expiring_date = time.Now()
4848

4949
var settings structures.Settings
5050
var sub_data = structures.ActivationData{}
51-
var config = structures.Config{PLATFORM: "DOCKER"}
52-
5351
var redis_client *redis.Client
5452

5553
func scene(c *gin.Context) {
@@ -712,10 +710,6 @@ func printlogs() {
712710

713711
custom := os.Getenv("VISION-CUSTOM")
714712

715-
if config.PLATFORM == "RPI" {
716-
custom = os.Getenv("VISION_CUSTOM")
717-
}
718-
719713
if err == nil && custom == "True" {
720714

721715
for _, file := range models {
@@ -766,9 +760,29 @@ func main() {
766760
var adminKey string
767761
var port int
768762
var modelStoreDetection string
763+
var mode string
764+
765+
if os.Getenv("PROFILE") == "" {
766+
platformdata, err := ioutil.ReadFile("platform.json")
767+
768+
if err != nil {
769+
var platform structures.PLATFORM
770+
771+
json.Unmarshal(platformdata, &platform)
772+
773+
os.Setenv("PROFILE", platform.PROFILE)
774+
os.Setenv("CUDA_MODE", platform.CUDA_MODE)
775+
}
776+
}
777+
778+
versionfile, err := os.Open("version.txt")
769779

770-
os.Setenv("PROFILE", "windows_native")
771-
os.Setenv("CUDA_MODE", "True")
780+
if err != nil {
781+
versiondata, _ := ioutil.ReadAll(versionfile)
782+
version := string(versiondata)
783+
784+
fmt.Println("DeepStack: Version " + version)
785+
}
772786

773787
flag.StringVar(&visionFace, "VISION-FACE", os.Getenv("VISION-FACE"), "enable face detection")
774788
flag.StringVar(&visionDetection, "VISION-DETECTION", os.Getenv("VISION-DETECTION"), "enable object detection")
@@ -777,6 +791,7 @@ func main() {
777791
flag.StringVar(&adminKey, "ADMIN-KEY", os.Getenv("ADMIN-KEY"), "admin key to secure admin endpoints")
778792
flag.StringVar(&modelStoreDetection, "MODELSTORE-DETECTION", "/modelstore/detection/", "path to custom detection models")
779793
flag.IntVar(&port, "PORT", 5000, "port")
794+
flag.StringVar(&mode, "MODE", "Medium", "performance mode")
780795

781796
flag.Parse()
782797

@@ -805,6 +820,7 @@ func main() {
805820
os.Setenv("VISION-DETECTION", visionDetection)
806821
os.Setenv("VISION-SCENE", visionScene)
807822
os.Setenv("APPDIR", APPDIR)
823+
os.Setenv("MODE", mode)
808824
}
809825

810826
if DATA_DIR == "" {
@@ -868,7 +884,7 @@ func main() {
868884
rediscmd.Stdout = stdout
869885
rediscmd.Stderr = stderr
870886

871-
err := rediscmd.Start()
887+
err = rediscmd.Start()
872888
if err != nil {
873889
stderr.WriteString(err.Error())
874890
}
@@ -943,22 +959,9 @@ func main() {
943959

944960
go utils.LogToServer(&sub_data)
945961

946-
if config.PLATFORM == "RPI" {
947-
948-
initActivationRPI()
949-
950-
}
951-
952962
admin_key := os.Getenv("ADMIN-KEY")
953963
api_key := os.Getenv("API-KEY")
954964

955-
if config.PLATFORM == "RPI" {
956-
957-
admin_key = os.Getenv("ADMIN_KEY")
958-
api_key = os.Getenv("API_KEY")
959-
960-
}
961-
962965
if admin_key != "" || api_key != "" {
963966

964967
if admin_key != "" {

0 commit comments

Comments
 (0)