Closed rexn8r closed 2 years ago
Yeah same problem here when fresh install on a pi4 with a OAK-D-Lite ...
Hi @rexn8r and @gris74, I will be looking into this problem. I will let you know as soon as I figured out the cause of this issue.
Thanks @michaelhwn
looking forward to the solution.
One thing I missed to mention is that while running setup.sh, the opencv-contrib-python installation got stuck with following message;
Building wheel for opencv-contrib-python (PEP 517)....... /
I then cancelled the process after one hour, manually installed opencv-contrib-python and ran the setup again.
thanks rex
Hi @michaelhwn
Any update on the resolution for the issues i faced above?
Thanks
Hi @rexn8r, I am trying to reproduce it on my end. One thing I noticed is that the long installation time of openCV only happens on a 64-bit Raspberry Pi OS (Bullseye). Is this the OS you are using?
Hi @rexn8r and @gris74, so far I can reproduce this issue on the latest 64-bit Raspberry Pi OS (Bullseye). The reason is that CEP's vision module hasn't been updated to support 64-bit OS. This caused the module to fail to initialize. On a 32-bit system, I haven't been able to reproduce this error. If you are using a 32-bit OS and encounter this error, please run the following commands and provide the output messages to me:
sudo journalctl -u cait_webapp.service -f
sudo journalctl -u cait_webapp.service -f
Regardless, I will be updating CEP's vision module to support 64-bit OS in a day or two. I will also let you know once the updates are pushed.
hi @michaelhwn
I have checked the pi version and its 32 bit.
below is the output message of the service;
+++++++++++++++++++++++ Mar 14 10:52:58 raspberrypi bash[422]: rv = self.dispatch_request() Mar 14 10:52:58 raspberrypi bash[422]: File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request Mar 14 10:52:58 raspberrypi bash[422]: return self.view_functionsrule.endpoint Mar 14 10:52:58 raspberrypi bash[422]: File "/home/pi/cep/src/cait/cortic_webapp/main.py", line 282, in getvideodev Mar 14 10:52:58 raspberrypi bash[422]: devices = essentials.get_video_devices() Mar 14 10:52:58 raspberrypi bash[422]: NameError: name 'essentials' is not defined Mar 14 10:52:58 raspberrypi bash[422]: 192.168.1.3 - - [14/Mar/2022 10:52:58] "GET /getvideodev HTTP/1.1" 500 - Mar 14 10:52:58 raspberrypi bash[422]: INFO:werkzeug:192.168.1.3 - - [14/Mar/2022 10:52:58] "GET /getvideodev HTTP/1.1" 500 - Mar 14 10:53:00 raspberrypi bash[422]: 192.168.1.3 - - [14/Mar/2022 10:53:00] "GET /getwifi HTTP/1.1" 200 - Mar 14 10:53:00 raspberrypi bash[422]: INFO:werkzeug:192.168.1.3 - - [14/Mar/2022 10:53:00] "GET /getwifi HTTP/1.1" 200 -
+++++++++++++++++++++++++++++++++++++
thanks rex
Thanks for the log @rexn8r, the error shows that the “essential” module of CAIT is not found, and thus the calling of any functions provided by that module returns an error. This led me to suspect that something went wrong during the setup process. Specifically, the process might have stopped before this line. It is possible that the long installation time of opencv-contrib-python (because it is probably compiling from scratch) caused such issue. I will be testing with other openCV versions and find one that can be installed much faster.
In the meantime, can you try to setup CEP on a newly flashed 32-bit Raspberry Pi OS again? But this time, just let the opencv-contrib-python installation run until the setup process finish and reboot the Pi.
sure thing. i am onto it. will update you how it goes.
thanks rex
hi @michaelhwn
finally managed to install and setup on raspberry pi 4. this time the installation completed quite fast and without error and also the opencv wheel didn't take long..
2 questions about the solution:
thanks rex
Hi @rexn8r, good to know it works this time. In order to add a new vision capability, you have to perform the following steps:
Note: I will be using the OAK-D Facemesh function as an example since adding age & gender will be a very similar process
<root_of_cep>/src/curt/curt/modules/vision
, you will need to create a new Python module that inherits the OAKDProcessingWorker class. An example can be found in here.<root_of_cep>/src/curt/curt/modules/vision/oakd_node_types.py
. Similar to this example<root_of_cep>/src/curt/curt/module_configs.json
, add a new key-value pair entry under vision, the key is the module name (filename without extension) you created in 1., and the value is the class name. Example. Then also add the module name into the worker_list. Example.<root_of_cep>/http://src/curt/models/modules/vision/platforms/oakd/
.<root_of_cep>/src/cait/cait/core.py
, add a function that uses the CURT programming interface to involve the age & gender function. One example can be found in here.<root_of_cep>/src/cait/cait/essentials.py
, add a function that calls the age&gender function you implemented in 6. All of the functions in this module form the CAIT Python programming interface. You can find an example in here.<root_of_cep>/src/cait/cortic_webapp/main.py
. Implement a handler for the age & gender request. You can find an example in here.<root_of_cep>/src/cait/cortic_webapp/static/js/cait_blocks.js
. Add a new block type for the age & gender block. This is an example for the facemesh block. For the block name and description, you need to extend the string table in <root_of_cep>/src/cait/cortic_webapp/static/js/en.js
. Example.vision_func
like this.<root_of_cep>/src/cait/cortic_webapp/static/js/cait_functions.js
, implement the Javascript function you created in 10. Example.<root_of_cep>/src/cait/cortic_webapp/templates/programming.html
, enable the age & gender block like this.The above steps should give you a complete age & gender function in the CAIT visual programming interface, CAIT Python programming interface, and CURT programming interface. Please feel free to contact me if you encounter any issues in following the steps.
Regarding the Windows support of CAIT, currently, CAIT is only designed to run in the Raspberry Pi OS on a Raspberry 4B. So you won't be able to set it up on a Windows machine.
hi @michaelhwn
thanks for the guideline. I will give it a shot and let you know.
regards
Closing due to inactivity.
Hi
I am trying to setup CAIT on my raspberry pi model 4 8 GB with 64 bit OS.
Ran the setup.sh to install pre-requisites.
Now when i am trying to run the setup; the page is unable to detect OAK-D camera. I have installed DepthAI pre-requisites and ran Age & Gender demo and its running successfully.
Below is the setup page with Devtools;
here's the OAK-D camera which is functioning well;
below is the lsusb command result;
how do i complete the setup?
thanks rex