BlueIris 1.1.16 and Deepquest/ Deepstack Question

Posted on
Sat Nov 09, 2019 10:36 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

BlueIris 1.1.16 and Deepquest/ Deepstack Question

Firstly, Really impressed with what you've done!

I've finally gotten to toying with the latest release of BI 1.1.16 and the Deepquest Plugin 0.5.6

+ I installed Docker and the Deepstack image and registered an API key and I THINK it is running correctly:
Code: Select all
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/10_syslog-ng.init...
Nov  9 16:31:07 7b1f0039e965 syslog-ng[12]: syslog-ng starting up; version='3.5.6'
Nov  9 16:31:08 7b1f0039e965 syslog-ng[12]: EOF on control channel, closing connection;
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 18
Nov  9 16:31:08 7b1f0039e965 cron[25]: (CRON) INFO (pidfile fd = 3)
Nov  9 16:31:08 7b1f0039e965 cron[25]: (CRON) INFO (Running @reboot jobs)


DeepStack is Active


Active APIs:


/v1/vision/scene
---------------------------------------
v1/vision/addmodel
---------------------------------------
v1/vision/listmodels
---------------------------------------
v1/vision/deletemodel
---------------------------------------
v1/vision/setadminkey
---------------------------------------
v1/vision/setapikey
---------------------------------------
v1/vision/backup
---------------------------------------
v1/vision/restore


+ I installed the plugin and I THINK it is running correctly...

Code: Select all
Starting plugin "DeepQuestAI Plugin 0.5.6" (pid 94576)
   DeepQuestAI Plugin             
   DeepQuestAI Plugin              ================================================ Initializing New Plugin Session =================================================
   DeepQuestAI Plugin              Plugin name:                   DeepQuestAI Plugin
   DeepQuestAI Plugin              Plugin version:                0.5.6
   DeepQuestAI Plugin              Plugin ID:                     com.GlennNZ.indigoplugin.DeepQuestAI
   DeepQuestAI Plugin              Indigo version:                7.3.1
   DeepQuestAI Plugin              Python version:                2.7.10 (default, Aug 17 2018, 19:45:58) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
   DeepQuestAI Plugin              Python Directory:              /System/Library/Frameworks/Python.framework/Versions/2.7
   DeepQuestAI Plugin              Major Problem equals:          0
   DeepQuestAI Plugin              Install Path :                 /Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/DeepQuestAI.indigoPlugin/Contents/Server Plugin
   DeepQuestAI Plugin              ==================================================================================================================================
   DeepQuestAI Plugin Debug        logLevel = 10
   DeepQuestAI Plugin Debug        User prefs saved.
   DeepQuestAI Plugin Debug        Debugging on (Level: 10)
   DeepQuestAI Plugin Debug        Path to Image Not Found equals:/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/DeepQuestAI.indigoPlugin/Contents/Server Plugin/Images/notfoundimage.jpg
   Started plugin "DeepQuestAI Plugin 0.5.6"
   DeepQuestAI Plugin Debug        Starting Plugin. startup() method called.
   DeepQuestAI Plugin Debug        Deleting temp files if any.
   DeepQuestAI Plugin Debug        Starting DeepState send Thread:
   DeepQuestAI Plugin Debug        Starting HTTP Image Server  thread
   DeepQuestAI Plugin Debug        deviceStartComm() method called.
   DeepQuestAI Plugin              Http Server Image Server on TCP port 4142
   DeepQuestAI Plugin Debug        Checking directory for ObjectType:person
   DeepQuestAI Plugin Debug        Checking Directory for ObjectType
   DeepQuestAI Plugin Debug        Adding Trigger DEEPSTACK test (1070187622) - objectFound
   BlueIris Plugin Debug           update Users called



+ But the Docker log is showing what looks like some 404 errors?
Code: Select all
[GIN] 2019/11/09 - 16:32:22 | 404 |        16.2µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/46441a05dde9fb870a8b4119496babfdc93095daa5868e51e319c2c22b952509
[GIN] 2019/11/09 - 16:32:34 | 404 |          17µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/676d3cd76ab25bc7e4d85000ed2c1932aba2c9f0f6665c98a9358e08d6490c02
[GIN] 2019/11/09 - 16:32:54 | 404 |        16.3µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/8ca8ea9286b12e38806cd305a911dbe668fc0fba790e931dd94b560932247c8c


+ Killing and restarting the docker container appears to have remedied this:
Code: Select all
v1/vision/restore
[GIN] 2019/11/09 - 16:39:39 | 200 |     16.5926ms |      172.17.0.1 | GET      /
[GIN] 2019/11/09 - 16:39:39 | 200 |     16.3905ms |      172.17.0.1 | GET      /assets/css/new-age.min.css
[GIN] 2019/11/09 - 16:39:39 | 200 |     17.1938ms |      172.17.0.1 | GET      /assets/device-mockups/device-mockups.min.css
[GIN] 2019/11/09 - 16:39:39 | 200 |     20.7374ms |      172.17.0.1 | GET      /assets/vendor/simple-line-icons/css/simple-line-icons.css
[GIN] 2019/11/09 - 16:39:39 | 200 |     37.8012ms |      172.17.0.1 | GET      /assets/vendor/bootstrap/css/bootstrap.min.css
[GIN] 2019/11/09 - 16:39:39 | 200 |     28.4422ms |      172.17.0.1 | GET      /assets/vendor/fontawesome-free/css/all.min.css
[GIN] 2019/11/09 - 16:39:39 | 200 |     19.9211ms |      172.17.0.1 | GET      /assets/img/loader.gif
[GIN] 2019/11/09 - 16:39:39 | 200 |     27.1152ms |      172.17.0.1 | GET      /assets/img/deepstack.png


+ Blue Iris Plugin appears to be running okay...
Code: Select all
   Starting plugin "BlueIris Plugin 1.1.16" (pid 94759)
   BlueIris Plugin                 
   BlueIris Plugin                 ================================================ Initializing New Plugin Session =================================================
   BlueIris Plugin                 Plugin name:                   BlueIris Plugin
   BlueIris Plugin                 Plugin version:                1.1.16
   BlueIris Plugin                 Plugin ID:                     com.GlennNZ.indigoplugin.BlueIris
   BlueIris Plugin                 Indigo version:                7.3.1
   BlueIris Plugin                 Python version:                2.7.10 (default, Aug 17 2018, 19:45:58) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
   BlueIris Plugin                 Install Path :                 /Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/BlueIris.indigoPlugin/Contents/Server Plugin
   BlueIris Plugin                 Path to Gifsicle :             /Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/BlueIris.indigoPlugin/Contents/Server Plugin/gifsicle/1.91/bin/giflossy
   BlueIris Plugin                 ==================================================================================================================================
   BlueIris Plugin Debug           logLevel = 10
   BlueIris Plugin Debug           ------ validatePrefsConfigUi() method called.
   BlueIris Plugin Debug           Checking Timeouts...
   BlueIris Plugin Debug           ImageTimeout:10
   BlueIris Plugin Debug           Setting ImageTimeout to 10
   BlueIris Plugin Debug           ServerTimeOut:5
   BlueIris Plugin Debug           Setting ServerTimeout to 5
   BlueIris Plugin Debug           Self ServerTimeout  :5
   BlueIris Plugin Debug           DiskAcces:  All Good.  Can Read/Write to this location
   BlueIris Plugin Debug           Found This Server Device:Blue Iris Server Device
   BlueIris Plugin Debug           Self.SaveDirectory equals:/Library/Application Support/Perceptive Automation/Indigo 7.3/IndigoWebServer/public/
   Started plugin "BlueIris Plugin 1.1.16"
   BlueIris Plugin Debug           Starting Plugin. startup() method called.
   BlueIris Plugin Debug           Sending BroadcasttoSubscribers
   BlueIris Plugin Debug           Creating Directories and deleting files..
   DeepQuestAI Plugin Debug        received broadcasterStarted message
   BlueIris Plugin Debug           Starting HTTP listener thread
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin                 Http Server Listening on TCP port 4556
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           deviceStartComm() method called.
   BlueIris Plugin Debug           Setting BlueIrisVersion to  5


+ I also get this in the INdigo log on debug when I connect to either localhost:80 or localhost:4142

Code: Select all
   DeepQuestAI Plugin Debug        New Http Handler thread:Thread-2, total threads: 3
   DeepQuestAI Plugin Debug        Html Server: do_get: self.path = /
   DeepQuestAI Plugin Debug        HTML: do_Get: New image Serving reset count, and re-reading directory
   DeepQuestAI Plugin Debug        Date_Sort Files called...
   DeepQuestAI Plugin Debug        d_Get: Html ObjectName:
   DeepQuestAI Plugin Debug        self.plugin.imageNo =0
   DeepQuestAI Plugin Debug        New Http Handler thread:Thread-2, total threads: 3
   DeepQuestAI Plugin Debug        Html Server: do_get: self.path = /favicon.ico
   DeepQuestAI Plugin Debug        New Http Handler thread:Thread-2, total threads: 3
   DeepQuestAI Plugin Debug        Html Server: do_get: self.path = /favicon.ico
   DeepQuestAI Plugin Debug        New Http Handler thread:Thread-2, total threads: 3


I made a trigger to run on Person detected, but it is not firing. Thoughts?

Posted on
Sat Nov 09, 2019 2:33 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Hi

Wondered how you were getting on!

Must say haven’t changed the code for a few weeks at all has been running stable on mine (processed 200Gbs+ of images!)

It looks good - well done!
But missing the dark quest api end point

Code: Select all
/v1/vision/detection


This is the one, and the only one we need.

Need to enable the detection api on Darkquest

I’ll check their docs and update this post. Running my deep quest on a windows mini machine so different setup.

Also the http is — http://localhost:4142/person.html

The ‘person’ can be any deeepstate object, also http//localhost:4142/archive/person.html for old ones - although my archive is so big having issues quickly displaying and will probably have to sort by recent, something to limit amount.


Glenn


Sent from my iPad using Tapatalk

Posted on
Sat Nov 09, 2019 2:36 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Thanks- I’ll check again. I know I am very close. Tell me, what port do you run your Deepstack docker on? Not the web server, the listening port

Posted on
Sat Nov 09, 2019 2:37 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

BlueIris 1.1.16 and Deepquest/ Deepstack Question

Very very close.

https://python.deepstack.cc/object-detection

Check above - need to run Docker deep state with VISION-DETECTION=true

I use port 7188 - figure 80 not a good choice, I believe there is only one port - which is both listening and webserver. At least in the windows docker version. Documentation not that clear on that front.

Glenn


Sent from my iPad using Tapatalk

Posted on
Sat Nov 09, 2019 3:12 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Hmmm. I launch docker on my Indigo host mac with
Code: Select all
 sudo docker run -e VISION-DETECTION=True -v localstorage:/datastore -p 80:5000 \
deepquestai/deepstack


At least, i think i did.

Can you walk me through the flow of the data?

I THINK it goes BI-> BI Plugin-> DeepStack-> Deepstack Plugin?

This really, really is gonna up everybody’s HA game. Heck, I just trained a CNN model to id every member of my family; I can’t wait to integrate it with this!

Posted on
Sat Nov 09, 2019 3:22 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Hi

List of active API from deepstack - first log is missing the detection one, so probably enabled with another similiar worded API

Data flow
Blue Iris plugin detects motion (depending on BI settings)
Triggers BI Plugin
Communicates with DeepQuest Plugin - sending a single Alert image details
DeepQuest plugin - pulls this alert image, and then depending on supercharge will continue to pull images as long as the supercharge settings.
The images are sent immediately as received to DeepQuest Docker for processing, which then sends back info about what is within image.
Triggers/Actions/Images saved and available to Deepquest http service if conditions met.

Can lead to a lot of images being pulled from BI, hence the RAM drive option.

There is a DeepQuest plugin main device - that you should create from plugin Config - find and move to a ideal folder.
This will let you know if all is running well.

Posted on
Sun Nov 10, 2019 12:07 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Where to start... I use the following trigger to tell DeepStack to look at the image.

Trigger: BlueIris Plugin Event
Event: Trigger with Camera Motion
Action: Send Image to DeepState
----Congigure Send Image to DeepState:
--------Image Type: URL
--------Path or URL: http://REDACTED:@192.168.1.56:81/image/thea

Then I get this in my Indigo log:

Code: Select all



And this in my Deekstack Docker log...

Code: Select all
[GIN] 2019/11/10 - 17:59:33 | 404 |        16.9µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/eeea0247479e6faa212d1f8d7f0676acddca086724f2ab9719392e5d3fb64fef
[GIN] 2019/11/10 - 18:00:36 | 404 |       266.6µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/0443fd0c026ab8888bb49572dcd76990ab36ecfaad77c62f84b6bfcbbadace2b
[GIN] 2019/11/10 - 18:00:54 | 404 |        16.4µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/da3b975b8def74703ae77022ae670401e4f019161b3fa6f00cfb33cde8ba6964
[GIN] 2019/11/10 - 18:01:05 | 404 |        15.5µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/8ca8ea9286b12e38806cd305a911dbe668fc0fba790e931dd94b560932247c8c
[GIN] 2019/11/10 - 18:02:04 | 200 |    800.0258ms |      172.17.0.1 | POST     /v1/vision/detection
[GIN] 2019/11/10 - 18:02:05 | 200 |    744.2926ms |      172.17.0.1 | POST     /v1/vision/detection
[GIN] 2019/11/10 - 18:02:06 | 200 |    848.0417ms |      172.17.0.1 | POST     /v1/vision/detection
[GIN] 2019/11/10 - 18:02:57 | 404 |        17.5µs |      172.17.0.1 | GET      /api/XOxXUBCnpydG4MyljRvV8kZnIJ3ehzXESMkkFAhU/lights/cd1cec6c21678358e0a223ef84279910d0033b81463f35091affa24db6a860c9


I then have a trigger for object detection that is not getting triggered...

Trigger: DeepQuestAI Pulgin Event
Event: Trigger with Object Detection
----Object Type: Person
----Confidence level: 0.4
----From Camera: BlueIris Camera BI thea
Action: send pushover notification
Action: Download Image

I am curious what those 404 errors are about from the docker container. Thoughts? I'm close.

Oddly,
The Plug in seamless allowing me to detect the chair in my daughters room, even though I didn't ask it to do so!
I made a trigger to test the "chair" detection functinality, and it is working great! Now, just to find out how to detect a person :)

Posted on
Sun Nov 10, 2019 1:02 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Got it working, and it is AWEEEEEEEEEEESOMEEEEEEEEEEEEEEEEEEEEEE!

I'm already planning a training data set for facial recognition! Thank you!

Posted on
Sun Nov 10, 2019 2:13 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

mundmc wrote:
Got it working, and it is AWEEEEEEEEEEESOMEEEEEEEEEEEEEEEEEEEEEE!
I'm already planning a training data set for facial recognition! Thank you!


Good to hear, let me know the major issues and will help document a bit better.

The action group - ‘send image to deepstate’ should NOT need to used with Blueiris.
Blueiris automatically sends the alert image, and any subsequent ‘supercharge’ images to deepstate, if broadcast enabled and if camera enabled in deepstate.

In BI plugin config - need checkbox - use/send broadcast enabled.
Rest in Deepstate plugin - need to select (multiple) cameras that are enabled in deepstate. Then can select seperate cameras for different trigger events etc. BI broadcasts message to deepstate plugin, if camera enabled, image sent to deepstate, message returns depending on triggers/triggered, if deepstate object device matching image saved/device updated.

Do create the deepstate plugin devices - main device created in plugin config and then create device for each object interested in triggering on. These devices enable saving of images -without device images are not saved for later display. (Was best way of determining what object should save, from the 80 or os possibilities)
The devices also save time of recent trigger, image link etc.

My usage:
    Currently processed more than 155000 images !
    Saves every car seen/date stamped high res image (can keep for months given size of image tiny )
    Saves every person seen as well
    & have a fox ‘dog’ setup to check and see whether any foxes around.
    Triggers alert announcement / sound if person at the Gate; regardless of whether pressed doorbell
    Likewise if sees a fox anywhere!


Future:

Did look at face recognition, send the person image cropped data to face recognition api immediately, but 1/2 time struggled to find a face in the person captured.
(also slowed down what deepstate was able to do)
Realised was my cameras - really need a passport like headshot - which none of my cameras are tight enough to get.
Thought could mount new camera at door for a headshot to open door etc - but then realised holding photo to this camera would have same effect!
Interest sort of faded at that point.




Sent from my iPad using Tapatalk
Last edited by GlennNZ on Sun Nov 10, 2019 4:04 pm, edited 3 times in total.

Posted on
Sun Nov 10, 2019 2:20 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Thanks for the tips- this will make deploying it at every cam much easier.

This is by far the most complicated and powerful thing my Indigo setup does, but it’s really amazing it’s all done locally.

Re: facial recognition- you are right about resolution... It’s very unlikely I’ll be able to do that accurately without a well-placed camera with decent resolution.

Still, this is awesome.

Posted on
Mon Nov 11, 2019 11:14 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Maybe you can help me on the suggested implementation...

At present, I use two triggers, whereaas I may only need one.

The first is:
Trigger: BlueIris Plugin Event
Event: Trigger with Camera Motion
Action: Send Image to DeepState (no parameters entered now)

The second is:
Trigger: DeepQuestAI Pulgin Event
Event: Trigger with Object Detection
----Object Type: Person
----Confidence level: 0.4
----From Camera: BlueIris Camera BI thea
Action: send pushover notification

A problem I am encountering...
I have multiple triggers for Deepstack and BleIris, depending on whether the activity is outside, inside, etc.. Now, when one Deepstack Trigger fires, for some reason they ALL fire, even though there is no activity on the other cameras. Thoughts?

Posted on
Mon Nov 11, 2019 1:51 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

BlueIris 1.1.16 and Deepquest/ Deepstack Question

Hi,

More than happy to fine tune any issues..

First trigger - send image to deep state - should not be needed for BI cameras. If using other cameras / stream etc can use. But BI integration, is that if setup correctly, sends the images to deepstate when BI camera detects motion/or is triggered with BI

2nd:
Hmmm not sure why they are all firing ... may be a code issue.
When you say ‘All’ - all Deepstate triggers or just all same object types ?
Or all BI and deepstate triggers (which would be harder to explain)
Will check code, possible is issue...

Glenn


Sent from my iPad using Tapatalk

Posted on
Mon Nov 11, 2019 4:32 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

Thanks, let me clarify-

Say I have 3 separate Deepstate triggers, each for a Person detected on an assigned camera.

When one triggers (due to a person being there), ALL of the Deepstate Indigo triggers fire, even if nothing was happening in their respective cameras.

Posted on
Mon Nov 11, 2019 4:33 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: BlueIris 1.1.16 and Deepquest/ Deepstack Question

mundmc wrote:
Thanks, let me clarify-

Say I have 3 separate Deepstate triggers, each for a Person detected on an assigned camera.

When one triggers (due to a person being there), ALL of the Deepstate Indigo triggers fire, even if nothing was happening in their respective cameras.


Thanks.
That’ll be a bug I suspect - as I have different objects for different triggers, and haven’t tested that - will add that to test machine.
Should have a fix in a couple of hours...



Sent from my iPad using Tapatalk

Posted on
Mon Nov 11, 2019 6:54 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

BlueIris 1.1.16 and Deepquest/ Deepstack Question

Posted 0.5.7 Deepstate.

Think it fixes issue - was a interesting bug (not what I thought)

Let me know how you go....


Glenn

Who is online

Users browsing this forum: No registered users and 1 guest