[tool] [tutorial] Free AI Person Detection for Blue Iris

damaar

n3wb
Joined
Dec 19, 2020
Messages
7
Reaction score
1
Location
nz
Thatnk @balucanb . With the latest windows beta installer, aitools doesn't appear to start the service.

Code:
2020-12-20 16:16:12.961857|Error|AITOOLS.EXE|GetDeepStackRun|None|None|None|   Deepstack partially running.  You many need to manually kill server.exe, python.exe, redis-server.exe|48|2||1
2020-12-20 16:16:12.973634|Info|AITOOLS.EXE|Shell_Load|None|None|None| APP START complete.  Initialized in 1.5 seconds (1525ms)|49|1|yellow|1
2020-12-20 16:16:13.697164|Debug|AITOOLS.EXE|HistoryStartStop|None|None|None| History update timer started.|51|0||1
2020-12-20 16:16:17.836951|Info|AITOOLS.EXE|ReloadLog||||Loaded 24645 lines in 323ms from C:\Programs\vrloncd aitool\_Settings\Logs\AITool.[2020-12-20].log.|1|0||1
2020-12-20 16:16:43.999274|Debug|AITOOLS.EXE|OnCreated||||  |2|1||8
2020-12-20 16:16:43.999274|Debug|AITOOLS.EXE|OnCreated||BackSD|BackSD.20201220_161643971.jpg|  ====================== Adding new image to queue (Count=1): V:\ai\BackSD.20201220_161643971.jpg|3|1||8
2020-12-20 16:16:44.277235|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| Updating/Resetting AI URL list...|4|0||9
2020-12-20 16:16:44.318284|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| ----   #1: Added new URL: http://192.168.5.252:5000/v1/vision/detection|5|0||9
2020-12-20 16:16:44.319239|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| ...Found 1 AI URL's in settings.|6|0||9
2020-12-20 16:16:44.321290|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg| Adding task for file 'BackSD.20201220_161643971.jpg' (Image QueueTime='0.0' mins, URL Queue wait='54ms', URLOrder=1 of 1, URLOriginalOrder=1) on URL 'http://192.168.5.252:5000/v1/vision/detection'|7|0||9
2020-12-20 16:16:44.321290|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|| Done adding 1 total threads, ErrCnt=0, ImageProcessQueue.Count=0|8|0||9
2020-12-20 16:16:44.365266|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Starting analysis of V:\ai\BackSD.20201220_161643971.jpg...|9|1||9
2020-12-20 16:16:44.374200|Debug|AITOOLS.EXE|IsValidImage|192.168.5.252:5000|BackSD||   Image file is valid: BackSD.20201220_161643971.jpg|10|2||11
2020-12-20 16:16:44.376268|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  (1/6) Uploading a 268635 byte image to DeepQuestAI Server at http://192.168.5.252:5000/v1/vision/detection|11|1||11
2020-12-20 16:16:44.412263|Error|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Got http status code 'Forbidden' (403) in 35ms: Forbidden|12|1||12
2020-12-20 16:16:44.414263|Error|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Empty string returned from HTTP post.|13|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|           Total Time:  415ms (Count=1, Min=415ms, Max=415ms, Avg=415ms)|14|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg| DeepStack (URL) Time:  35ms (Count=1, Min=35ms, Max=35ms, Avg=35ms)|15|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|       File lock Time:  1ms (Count=1, Min=1ms, Max=1ms, Avg=1ms)|16|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|     Image Queue Time:  364ms (Count=1, Min=364ms, Max=364ms, Avg=364ms)|17|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|    Image Queue Depth:  1 (Count=1, Min=1, Max=1, Avg=1)|18|1||12
2020-12-20 16:16:44.417264|Info|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD||...Problem with AI URL: 'http://192.168.5.252:5000/v1/vision/detection' (URL ErrCount=2, max allowed of 5)|19|0||12
2020-12-20 16:16:44.418359|Info|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|...Putting image back in queue due to URL 'http://192.168.5.252:5000/v1/vision/detection' problem (QueueTime=0.0, Image ErrCount=0, Image RetryCount=1, URL ErrCount=2): 'V:\ai\BackSD.20201220_161643971.jpg', ImageProcessQueue.Count=0|20|0||12
2020-12-20 16:16:44.688723|Info|AITOOLS.EXE|WaitForNextURL|192.168.5.252:5000|BackSD||---- Waiting 30 seconds before retrying bad URL. (ErrCount=2 of 5, Setting 'MinSecondsBetweenFailedURLRetry'=30): http://192.168.5.252:5000/v1/vision/detection|21|0||12
2020-12-20 16:16:44.688723|Info|AITOOLS.EXE|WaitForNextURL|192.168.5.252:5000|BackSD||---- All URL's are in use or disabled, waiting...|22|0||12
Logs above. I will troll trough some documentation from deepstack, so if there is something different with the new build.
 

damaar

n3wb
Joined
Dec 19, 2020
Messages
7
Reaction score
1
Location
nz
Thatnk @balucanb . With the latest windows beta installer, aitools doesn't appear to start the service.

Code:
2020-12-20 16:16:12.961857|Error|AITOOLS.EXE|GetDeepStackRun|None|None|None|   Deepstack partially running.  You many need to manually kill server.exe, python.exe, redis-server.exe|48|2||1
2020-12-20 16:16:12.973634|Info|AITOOLS.EXE|Shell_Load|None|None|None| APP START complete.  Initialized in 1.5 seconds (1525ms)|49|1|yellow|1
2020-12-20 16:16:13.697164|Debug|AITOOLS.EXE|HistoryStartStop|None|None|None| History update timer started.|51|0||1
2020-12-20 16:16:17.836951|Info|AITOOLS.EXE|ReloadLog||||Loaded 24645 lines in 323ms from C:\Programs\vrloncd aitool\_Settings\Logs\AITool.[2020-12-20].log.|1|0||1
2020-12-20 16:16:43.999274|Debug|AITOOLS.EXE|OnCreated||||  |2|1||8
2020-12-20 16:16:43.999274|Debug|AITOOLS.EXE|OnCreated||BackSD|BackSD.20201220_161643971.jpg|  ====================== Adding new image to queue (Count=1): V:\ai\BackSD.20201220_161643971.jpg|3|1||8
2020-12-20 16:16:44.277235|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| Updating/Resetting AI URL list...|4|0||9
2020-12-20 16:16:44.318284|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| ----   #1: Added new URL: http://192.168.5.252:5000/v1/vision/detection|5|0||9
2020-12-20 16:16:44.319239|Debug|AITOOLS.EXE|WaitForNextURL||BackSD|| ...Found 1 AI URL's in settings.|6|0||9
2020-12-20 16:16:44.321290|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg| Adding task for file 'BackSD.20201220_161643971.jpg' (Image QueueTime='0.0' mins, URL Queue wait='54ms', URLOrder=1 of 1, URLOriginalOrder=1) on URL 'http://192.168.5.252:5000/v1/vision/detection'|7|0||9
2020-12-20 16:16:44.321290|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|| Done adding 1 total threads, ErrCnt=0, ImageProcessQueue.Count=0|8|0||9
2020-12-20 16:16:44.365266|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Starting analysis of V:\ai\BackSD.20201220_161643971.jpg...|9|1||9
2020-12-20 16:16:44.374200|Debug|AITOOLS.EXE|IsValidImage|192.168.5.252:5000|BackSD||   Image file is valid: BackSD.20201220_161643971.jpg|10|2||11
2020-12-20 16:16:44.376268|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  (1/6) Uploading a 268635 byte image to DeepQuestAI Server at http://192.168.5.252:5000/v1/vision/detection|11|1||11
2020-12-20 16:16:44.412263|Error|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Got http status code 'Forbidden' (403) in 35ms: Forbidden|12|1||12
2020-12-20 16:16:44.414263|Error|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|  Empty string returned from HTTP post.|13|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|           Total Time:  415ms (Count=1, Min=415ms, Max=415ms, Avg=415ms)|14|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg| DeepStack (URL) Time:  35ms (Count=1, Min=35ms, Max=35ms, Avg=35ms)|15|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|       File lock Time:  1ms (Count=1, Min=1ms, Max=1ms, Avg=1ms)|16|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|     Image Queue Time:  364ms (Count=1, Min=364ms, Max=364ms, Avg=364ms)|17|1||12
2020-12-20 16:16:44.417264|Debug|AITOOLS.EXE|DetectObjects|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|    Image Queue Depth:  1 (Count=1, Min=1, Max=1, Avg=1)|18|1||12
2020-12-20 16:16:44.417264|Info|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD||...Problem with AI URL: 'http://192.168.5.252:5000/v1/vision/detection' (URL ErrCount=2, max allowed of 5)|19|0||12
2020-12-20 16:16:44.418359|Info|AITOOLS.EXE|ImageQueueLoop|192.168.5.252:5000|BackSD|BackSD.20201220_161643971.jpg|...Putting image back in queue due to URL 'http://192.168.5.252:5000/v1/vision/detection' problem (QueueTime=0.0, Image ErrCount=0, Image RetryCount=1, URL ErrCount=2): 'V:\ai\BackSD.20201220_161643971.jpg', ImageProcessQueue.Count=0|20|0||12
2020-12-20 16:16:44.688723|Info|AITOOLS.EXE|WaitForNextURL|192.168.5.252:5000|BackSD||---- Waiting 30 seconds before retrying bad URL. (ErrCount=2 of 5, Setting 'MinSecondsBetweenFailedURLRetry'=30): http://192.168.5.252:5000/v1/vision/detection|21|0||12
2020-12-20 16:16:44.688723|Info|AITOOLS.EXE|WaitForNextURL|192.168.5.252:5000|BackSD||---- All URL's are in use or disabled, waiting...|22|0||12
Logs above. I will troll trough some documentation from deepstack, so if there is something different with the new build.
Ignore me, I forgot! Need to start it using deepstack --VISION-DETECTION True --PORT xyz in powershell otherwise you get that error, not the shortcut installed by deepstack. I missed this in the docs. Hopefully my stupidity helps someone else :D
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
So.......
This is where I am.

  1. Deleted all my Docker containers.
    Opened Power shell and ran:
  2. docker pull deepquestai/deepstack:latest
    and
  3. docker pull deepquestai/deepstack:cpu-2020.12
    Why? Because I know nothing about Docker and was not sure if I needed both or if "latest" would do the trick.
    Then I created 2 Docker containers:
  4. docker run --restart=always -e mode=high -eVISION-DETECTION=True -v localstorage:/datastore -p 8383:5000 --name deepstack deepquestai/deepstack:latest
    and
  5. docker run --restart=always -e mode=high -eVISION-DETECTION=True -v C:\Users\user\Documents\my-models:/modelstore/detection -p 8000:5000 deepquestai/deepstack:cpu-2020.12
Again because I am clueless..
  1. I went into AI-Tool and entered both- 127.0.0.1:8000, 127.0.0.1:8383 into the AI serverURL(s) block
7 .Result was NO MORE FREAKING ERRORS!!!!, NO URL Errors, No 404 OR 403 Errors.

....However, while I am indeed getting alerts and snapshots are being sent to telegram I am not getting any "custom" results??
My custom model is pictures of me and family members, with the desired result being my/their name being shown under the pic if recognized. I stood in front of several of my cameras to see if it would work but only got the box with "person" instead my name. I used close to 300 images during the training and let it run for the complete 300 Epochs took 6 1/2 hours to complete. Waiting on some answer from John O.
@balucanb
Needless to say since I'm not using the custom modelling I can only offer observations and suggestions.

1. I propose that you setup a default version of deepstack and confirm it is working as expected.
2. Remove the default container and load the custom version using the same port number as you used in point 1.

I do not believe you need two different versions of deepstack. I propose you stick with the 2020.12 version for both instances.

This will give us some fundamental info to determine if your custom model is working. You can check the processing time for example.
 

Ripper99

n3wb
Joined
Dec 12, 2020
Messages
10
Reaction score
2
Location
Canada
Hello everyone, I'm using BI version 5.3.7.0 along with AI Tool version 2.0.195.7637 and I'm running the newest version of Deepstack in Docker.

[[EDIT]]. *Note I'm using Ubiquiti Protect for managing the cameras on a Cloudkey 2+ *

I have an odd problem with AI Tools and Ubiquiti cameras, it seems like everything is working however only with one camera at a time even when I have others configured exactly the same in BlueIris, basically I was following this tutorial for Deepstack and everything is up and working but it seems one camera will be doing the detection unless I make a change in the Trigger section.

So lets say I have my Office camera set to Trigger/Motion Sensor/Min. Object Size = 1002 , this camera will be working and captures in my office will trigger on movement by me and AI Tool will process.

I have three other cameras set up to test and they all are configured to trigger the same way and basically when I created new cameras I used the option "copy from other camera" and then changed the RTSP url and the cameras show up fine but the ONLY way to make the others trigger is by going into the Trigger settings and adjusting "Trigger/Motion Sensor/Min. Object Size" option on say the Theatre camera as an example, so lets says the Min. Object Size on this camera was set to 840 and I change it to 740 then this camera will become the ONLY camera of the four that AI Tool now processes images for and it will keep doing this and no other cameras until I go into a different camera and slightly adjust "Trigger/Motion Sensor/Min. Object Size" option and then that camera becomes the one that AI Tool will process images for?

I know it sound odd buy hopefully another person with Ubiquiti cameras can confirm the same thing is happening with their setup, I have tested this with a single camera and of course that will work all the time but as soon as I add a second camera then I have this problem where only one camera will be processed, I have tested this with up to 14 cameras with the same result.

The only thing I think that possibly might have to do with this is I don't have all Ubiquiti cameras set to self managed so Ubiquiti Protect is using the cameras normally as it dos and recording fine and then Blue Iris I have all low quality RTSP substreams eg;

Camera Office = 192.168.1.120:7447/JJnG64KrxTHEzSCP

Camera Theatre= 192.168.1.120:7447/MMtG64LryuKKzTTY

The cameras of course still all have unique RTSP urls for High/Medium/Low and they work in BI to view video its just the triggers that seem broken somehow no matter what quality of stream I chose and they're not triggering like they should?

I'd rather not have to put the Ubiquiti cameras in stand alone mode and I've heard of others using Ubiquiti cameras in Ubiquiti Protect mode while also using BI so if anybody else has a similar configuration please let me know if you are using Ubiquiti Protect mode and your cameras are NOT in stand alone mode, are you seeing this same sort of problem I am?

Thanks in advance for any help.
 
Last edited:

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
@balucanb
Needless to say since I'm not using the custom modelling I can only offer observations and suggestions.

1. I propose that you setup a default version of deepstack and confirm it is working as expected.
2. Remove the default container and load the custom version using the same port number as you used in point 1.

I do not believe you need two different versions of deepstack. I propose you stick with the 2020.12 version for both instances.

This will give us some fundamental info to determine if your custom model is working. You can check the processing time for example.
Good info. I agree I do not think I am going to need both containers running 2 different versions. Since my original post I did shut each down and only had 1 version running at a time, I assume shutting it down is as good as deleting it? They both were processing normally minus putting the custom label on certain pictures, not sure about the processing times I will need to go back and check that.
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
Good info. I agree I do not think I am going to need both containers running 2 different versions. Since my original post I did shut each down and only had 1 version running at a time, I assume shutting it down is as good as deleting it? They both were processing normally minus putting the custom label on certain pictures, not sure about the processing times I will need to go back and check that.
I agree you could just stop a container but you should also remove the port connection within aitool. You need to really ensure that you configure for one container and then enable/disable the different containers to ensure you are not getting accidentally mislead. Does your custom container recognise anything?
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
I agree you could just stop a container but you should also remove the port connection within aitool. You need to really ensure that you configure for one container and then enable/disable the different containers to ensure you are not getting accidentally mislead. Does your custom container recognise anything?
Yes what I did was stop the container, and remove all ref, to it in AI-Tool. Also, yes both models, the normal one everyone is using and my custom model are returning results as expected as far as "seeing" the objects. I am just not getting the custom label if it see's a picture of me for example. I have ran a post command in postman several times and I get the correct result so I am really stumped on what the issue is. John O is going to look at my pt file and see if it is the file or maybe an issue with deepstack. there is another person on GH and he and I are about at the same point and getting the same results so either we both of us are jacking it up or there is an issue is my guess.
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
I agree especially if another pioneer is having the same issue. Are you supposed to receive only your own models labels or a combination of the old and your new with the re modelled container?
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
@Ripper99
Sorry, I have found your post confusing. You keep referring to the rtsp address. What is the ip address for each of your camera's? Needless to say you cannot use the same ip address for the cameras unless they are cloned.
 
Last edited:

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
I agree especially if another pioneer is having the same issue. Are you supposed to receive only your own models labels or a combination of the old and your new with the re modelled container?
According to John we should be receiving both.
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
According to John we should be receiving both.
So infact then you only need one container!
I guess you are integrating your models with those that have already been developed in the earlier version which begs to have this question answered. How does Deepstack prioritise what it sees. For example it may recognise your face but indicate you are a person!
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
So infact then you only need one container!
I guess you are integrating your models with those that have already been developed in the earlier version which begs to have this question answered. How does Deepstack prioritise what it sees. For example it may recognise your face but indicate you are a person!
Exactly! That is the part I do not get either. I assume it does double duty so to speak, it runs the recognition twice? but I would think I would get double hits, one showing "person" and one showing "custom label" for the same image. I am not smart enough to look at the code and see if or how it would accomplish this.
 

mayop

n3wb
Joined
Jul 20, 2020
Messages
29
Reaction score
22
Location
Canada
I'd rather not have to put the Ubiquiti cameras in stand alone mode and I've heard of others using Ubiquiti cameras in Ubiquiti Protect mode while also using BI so if anybody else has a similar configuration please let me know if you are using Ubiquiti Protect mode and your cameras are NOT in stand alone mode, are you seeing this same sort of problem I am?

Thanks in advance for any help.
The problem is Unifi Protect. It causes the keyframe rate to be too low. Ideally it should be 1.00 as shown below:



There is a post on BI of possible fixes for cameras themselves:
Now as for protect there is a variable that causes the issue but it's not something you can edit.
However one can edit it by modifying the Protect system files and changing the default from 5 to 1 which will fix the issue if you are good with editing javascript code and using SSH.

I use a cloudkey gen 2 plus with protect 1.17.0 beta 6 currently.

WARNING - THE FOLLOWING MAY CAUSE ISSUES OR BREAK YOUR UNIFI PROTECT INSTALL

Using SSH goto in "/usr/share/unifi-protect/app" (This is for the Gen2+ with 2.0 firmware, it may differ for the Dream Machine and UNVR). Look for the file called service.js. Save a copy of this file in case you break something.

Open service.js (It's minified so it will be harder to read) and search for:

JavaScript:
;a.DEFAULTS=[{idrInterval:5,minClientAdaptiveBitRate:0},{idrInterval:5,minClientAdaptiveBitRate:15e4},{idrInterval:5,minClientAdaptiveBitRate:0}]
then change the three instances of idrInterval:5 to idrInterval:1 as shown below.

JavaScript:
;a.DEFAULTS=[{idrInterval:1,minClientAdaptiveBitRate:0},{idrInterval:1,minClientAdaptiveBitRate:15e4},{idrInterval:1,minClientAdaptiveBitRate:0}]
Save the file then use SSH to restart protect:

Code:
systemctl restart unifi-protect
I only have two cameras in protect so I don't know what would happen with many cameras.

Since doing this my keyframe rate is 1.00 and BI works the same as if my G3 cameras were in standalone mode. Also you will have to edit the file everytime you update your protect install and/or controller (in my case).

I made a post about it on ui.com but no one replied.
 

JL-F1

Getting the hang of it
Joined
Jun 12, 2020
Messages
115
Reaction score
71
Location
USA
Running the beta GPU deepstack.

Works nice 90ms

But now when I look at the history in aitool, the trigger happens 3-7 secs after the snapshot photo timestamp. It used to be ~1sec everytime.

Anyone else notice this? Anything can check to decrease that time?

The snapshots go on an SSD, so the drive isn't slow.

Everything else is exactly the same, just GPU deepstack beta changed
 

AskNoOne

n3wb
Joined
Dec 20, 2020
Messages
7
Reaction score
5
Location
UK
I'm trying to get DS running on a Jetson Nano and I'm having a bit of trouble. Here's what I've done so far. I installed the latest Jetpack on an SD card and then set the nano up using headless mode with a USB cable. I assigned a static IP address and then accessed the Nano with Putty. I then ran the following commands.

sudo apt-get update
sudo apt-get upgrade

sudo docker pull deepquestai/deepstack:jetpack-2020.12

sudo docker run --runtime nvidia --restart=unless-stopped -e VISION-DETECTION=True -p 80:5000 deepquestai/deepstack:jetpack-2020.12

sudo docker volume create portainer_data

sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

sudo systemctl enable docker.service

sudo reboot now

After the reboot both containers started and I could access Portainer as well as the DS web interface on port 80 but AI Tool can not communicate with DS.

12/19/2020 6:35:46 PM DetectObjects Unable to connect to the remote server [WebException] Mod: <DetectObjects>d__31 Line:999:48 Error AITOOLS.EXE 10.1.31.30:5000 GarageMotion GarageMotion.20201219_183544288.jpg 60 1 9 False aitool.[2020-12-19].log

The DS URL in AI Tool is set to 10.1.31.30:5000 which is the IP address of the Nano and I believe the port number is correct based on the docker run line.

This is my first time working with a Nano and my first experience with Docker so I'm not familiar with troubleshooting techniques on these platforms. From what I see in Portainer and the output of a few Docker commands everything looks fine to me, but then I don't have an experienced eye.

Now to complicate things. I have installed Jetpack on the Nano twice. Once using the Gui and once headless. I was able to get everything working with the Gui install but I wanted to try out headless install so I wiped the card, started over, and now I can't get DS to work again.

Any help will be appreciated.
As far I can tell from your explanation you have done everything correctly with the exception of the URL in AITool. You need to talk to port 80, not 5000. 5000 is the internal docker container port which is mapped to the host port 80.

I tend to define a non-standard port rather than 80 just to avoid any potential conflicts with web servers you may have or plan to setup. (But 80 should be fine too)

Hope this solves your issue!
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
In ref to the custom models need some help can anybody help me, trying to do the following:
1 - Clone DeepStack Trainer git clone git@github.com:johnolafenwa/deepstack-trainer.git
2 - CD to the repo root cd deepstack-trainer
3 - Put your the images in a folder you want to test
4 - from the repo root run, ```python detect.py --weights "C:/path-to-your-model.pt" --source "C:/path-to-your-test-images-folder"

#1-3 No problem.
When I run the code I am getting this-

PS C:\Users\user\Documents\GitHub\deepstack-trainer> python detect.py --weights "C:\Users\user\Documents\my-models" --source " \testimages"
** On entry to DGEBAL parameter number 3 had an illegal value
** On entry to DGEHRD parameter number 2 had an illegal value
** On entry to DORGHR DORGQR parameter number 2 had an illegal value
** On entry to DHSEQR parameter number 4 had an illegal value
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\init.py", line 305, in <module>
_win_os_check()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\init.py", line 302, in _win_os_check
raise RuntimeError(msg.format(file)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\user\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\numpy\\init.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: Traceback (most recent call last):
File "C:\Users\user\Documents\GitHub\deepstack-trainer\detect.py", line 5, in <module>
import cv2
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cv2\init.py", line 5, in <module>
from .cv2 import *
ImportError: numpy.core.multiarray failed to import

Any help is appreciated- Please Barney style the answer...
 

robpur

Getting comfortable
Joined
Jul 31, 2014
Messages
274
Reaction score
1,322
Location
Washington State
As far I can tell from your explanation you have done everything correctly with the exception of the URL in AITool. You need to talk to port 80, not 5000. 5000 is the internal docker container port which is mapped to the host port 80.
Well Duh, that was it. I've been running the native Windows version of DS with the web server running on port 80 and pic submission port on 5050. I didn't understand how the docker version works and assumed that it used two different ports like the Windows version. After setting -p 5050:5000 it works as desired.

I'm currently running MODE=High, using full size images of 1280x720, 1920x1080 and 2048x1536 and average DS time is around half a second. This time is fine for me since I'm running DS on three different machines on the network and my current camera setup can not saturate the collective DSs, but I saw a post on the DeepStack forum from sickidolderivative saying that he processes images on the Nano in around 130 ms, but he's submitting images between 300x300 and 500x500. I wonder if accuracy suffers with such small images. I prefer accuracy over speed but it's probably not necessary to submit full resolution images. I'll have to hunt for the sweet spot.

Thanks for helping me get up and running with the Nano!
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
146
Reaction score
23
Location
TX
For those that are using PTZ cameras in your set up with BI/ AI-Tool / deepstack, I am curious if it works for detection and what you have done set up wise.
 
Top