depthai icon indicating copy to clipboard operation
depthai copied to clipboard

Introduce Web GUI

Open VanDavv opened this issue 4 years ago • 4 comments

This PR introduces a new GUI type - web - that is available together with already present cv and qt GUIs. Web GUI allows to use your browser to interact with DepthAI Demo script.

Demo

DepthAI Demo Web GUI v1 demo

To use the new GUI, run the following command:

python3 depthai_demo.py -gt web

and open http://127.0.0.1:8090 to see your webpage in action

Still in todo/nice-to-have:

  • Add error handling
  • Add connection/status indicators

VanDavv avatar Feb 02 '22 14:02 VanDavv

I migrated webserver used in Web GUI to aiohttp, so that all requests are parsed asynchronously. It's available on many platforms straight from PyPi, so I think compatibility won't be an issue.

Will do more testing on RPi tomorrow and hopefully inside docker as well - if successful, will allow us to create depthai-demo docker image

VanDavv avatar Feb 03 '22 22:02 VanDavv

img

WebGUI on RPi 4 4GB works in only 4 FPS - I guess it's due to host-side JPEG encoding that is performed before the image is sent. Will enable an additional MJPEG encoder for webGUI and stream already encoded data

VanDavv avatar Feb 04 '22 13:02 VanDavv

I tried to use the Script node to make a "packet router" that only sends packets from specified input. Still, it gets somehow stuck at runtime - connected nodes stop sending new packets to it, even though the script node is working (I can change specified preview, and I see on console that node received the message).

We'll be debugging this issue further internally but sharing here too context, a video showing the behavior below

https://user-images.githubusercontent.com/5244214/152767862-e0687704-d718-42f2-89ae-2b6bfaf8497e.mov

VanDavv avatar Feb 07 '22 10:02 VanDavv

@themarpe are there any updates on the Script node issues? Once we'll be able to use script node to choose a specific packet to be sent, we'll be able to introduce the Web GUI

VanDavv avatar Apr 15 '22 11:04 VanDavv