[SOLVED] How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Discussions about the AI-deck
Post Reply
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

[SOLVED] How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Hi,

I can successfully flash the examples in the "AIdeck_examples/GAP8/*"
And I can run the viewer.py in the "AIdeck_examples/NINA" to see the streaming images implementing by the submodule "AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_steamer"

So, how to run the other examples, such as the FaceDetection? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Thanks!
Last edited by raven on Sat Nov 21, 2020 5:18 am, edited 1 time in total.
Make positive impact.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by kimberly »

not sure I understand what you mean, but you can use the viewer.py for the FaceDetection example as well.
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Hi,

When I flash the "wifi_jpeg_steamer" using GAP8 docker and execute the viewer.py, I can see myself
WeChatab0fa9eb031eee8933efbf3d7f007a78.png
But when I flash the "FaceDetection" and execute the viewer.py, I can't see anything.
WeChat19502949b73da36fcf45efce5b760226.png
I saw the video in the blog https://www.bitcraze.io/2020/05/latest- ... e-ai-deck/, there is a rectangle to highlight the face. But I cannot see the steaming images and the detected face.

I think maybe I miss some related steps or documentations?
Which code will draw the rectangle around the face, the C firmware?

Thanks!
Make positive impact.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by kimberly »

Have you checked the makefile? Maybe there is a USE_STREAMER define that needs to be uncommented. Also you will need to do the same with USE_CAMERA
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by kimberly »

Also remember that the facedetection is done on a raw image, so it might not perform as well as with the grayscale example. The grayscale example is best to be done with onram execution of the program (so make run), so that you can see the read out.
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Hi,

I uncomment the "#USE_STREAMER" and "USE_CAMERA" and I can see the streaming images!
But unfortunately, there is either not the rectangle around my face, it there any other necessary steps need to be done?

What's more, I'm curious that why we should uncomment that two variables by ourselves? There is not an instruction to tell the developer to do that. Maybe it has been ignored, or any other reasons?

Thanks!
Make positive impact.
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Oh, sorry~

I saw the rectangle hhh!
Maybe due to the performance, I cannot see that instantly at the first time.
I need to try the onram way.
Make positive impact.
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Hi!

Most of the program looks running well, but the result of face detection is not very good.
I try the onRAM way and open the viewer.py at the same time.
command.png
result.jpeg
The rectangle appeared sometimes. But it cannot detect my face.
Maybe there are some methods to improve the correctness?

Thanks!
Make positive impact.
raven
Member
Posts: 33
Joined: Thu Sep 24, 2020 1:57 pm
Contact:

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by raven »

Hi,

I continued to try different environments and angles, and I found it worked well sometimes.
So, I think I have deployed FaceDetection successfully, the improvement of accuracy is not important, it's time for me to implement my own work based on the AI_deck!

But I still want to ask "Why we should uncomment that two variables (USE_STREAMER, USE_CAMERA) by ourselves? Why is it commented by default?

Thanks!!!
Make positive impact.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: How to run the FaceDetection Example? Is there any python code like the viewer.py for wifi_jpeg_steamer?

Post by kimberly »

Because currently the streamer does not work with SDK 3.7. Using the camera could be activated at default, that is true, but on the other hand its also good to just know if the gap8 code works with a picture as example. This is as how it works as example in the gap8 sdk. The two defines were mentioned in the documentation.

The facedetection is a HOG feature based detection and the conditions has to be exactly right. The face should be well lit and bright and there shouldn't be to much stuff going on in the background (like the example image). Another problem that its currently doing the detection a raw footage with a RGB bayer filter (the blocks you see), while the original example was made for grayscale cameras (like the example picture). That also contributes on it having a slightly difficult time to detect it.

Good luck with implementing and please let us know if you have any more problems!
Post Reply