Face detection with Jetson Nano Jetbot

Hello,
I just got a Jetson Nano and want to set up a robot with face detection from (https://github.com/JetsonHacksNano/CSI-Camera).
When I access the Jetson directly the face_detect.py works just fine with the code below in the terminal. But the code does not work, when I access it from my deskPC via wifi / from my deskPCs browser and like it is discribed for the Jetbot (Step4 in https://github.com/NVIDIA-AI-IOT/jetbot/wiki/software-setup).

When i try the code in Jupyter lab, just nothin happens. Even though the liberies cv2 and numpy seem to be imported fine.

When I try to open the script from the console with

cd CSI-Camera

and

python face_detect.py

it says (python:14648): Gtk-WARNING **: 09:08:13.993: cannot open display:

Does anybody know how to figure this out?

Kind regards and thanks for any help,
Mat

1 Like

Hi,

This is because the sample need a DISPLAY to show the output result.
However, it’s not supported to redirect the window via ssh.

Here are two alternatives for your reference:

1. Use local display for the output.
Try to setup the DISPLAY parameter before the python code.

$ export DISPLAY=:1
$ python face_detect.py

2. Turn off the window output.
Remove or comment the imshow command.
https://github.com/JetsonHacksNano/CSI-Camera/blob/master/face_detect.py#L70

Thanks.

1 Like

Hi,
thanks you. But it looks like this didn’t solve my problem.

is the export DISPLAY=:1 supposed to open a new window for displaying the view from the camera? At least in my case no dispaly opens and i get the same error.

When i comment the imshow in the jupyterlab script also nothing happens. Where is the image supposed to display when i comment the imshow command?

Thanks again,
Matt

Hi,

Sorry for the late update.

Do you have a display device connected to the Jetson platform directly?
Please noticed that you will need one to enable the x-window.

Thanks.

Hi,

i have no display connected yet. The idea was to display the video stream inline in the juypter lab / notebook.
Is a PiOLED-Display enough, like mentioned here (https://github.com/NVIDIA-AI-IOT/jetbot/wiki/hardware-setup), or do i need a display to display the videostream? I guess the idea behind the PiOLED is to display the IP-Adress.

thanks,
Matt

Hi,

Sorry that we don’t have too much experience on the PiOLED-Display.
But if the display can work on Jetson, it should also work for your code.

If you don’t have a display right now, you can change the code to save it as an image.
https://github.com/JetsonHacksNano/CSI-Camera/blob/master/face_detect.py#L70

Thanks.