Object detection with Jetson Nano using YOLOv7 and RealSense
Вставка
- Опубліковано 19 жов 2022
- In this tutorial I explain the basics of yolov7 and how to use it with a RealSense camera.
Here is the project:
drive.google.com/drive/folder...
In this tutorial, Jetson Nano 4GB model is used.
version: 32.7.2
Yolov7
github.com/WongKinYiu/yolov7
PyTorch for Jetson
forums.developer.nvidia.com/t...
jetsonhacks/installRealSenseSDK GitHub page
github.com/jetsonhacks/instal... - Наука та технологія
Great tutorial! Thanks!
Hi Başak Akyüz!
Thanks for watching my video!
It is my pleasure is this video have helped you!
Great video. Thank you. What changes are required for doing the same with regular CSI camera (or USB), on a custom trained model?
Hi yigalb4826!
Thanks for watching my video!
You should install the same libraries except for “librealsense”. If you are using web camera, you can run the “detect.py” script with “--source 0” argument. Please see “Inference” section of this repository.
github.com/WongKinYiu/yolov7
@@robotmania8896
Hello,
I hope this message finds you well. I'm currently facing an issue while running YOLOv7 on my Jetson Nano. After successfully running the detection script, I encounter the following GTK error:
"GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported."
This issue results in a core dump. I'm reaching out to seek assistance in resolving this GTK error. Here are some details about my environment:
Jetson Nano platform
Python 3.6
YOLOv7 successfully installed
If anyone has experience with this GTK error or suggestions for troubleshooting steps, your guidance would be immensely appreciated. Feel free to ask for more details, logs, or any specific information that might help diagnose the problem.
Thank you in advance for your help!
Thank you so much
Hi Nonpawit Ekburanawat!
Thanks for watching my video!
It is my pleasure if this video has helped you!
Hi ! You have greate tutorials. Is it possible to make a tutorial on how to implement yolov7 or yolov5 in ROS2 ? I have really hard time on doing that and there is no much information that I can find on the Internet. I hope it is not too much to ask. Thanks !
Hi Калоян Тотев!
Thanks for watching my video!
I actually already have made that tutorial. Please, refer this video
ua-cam.com/video/594Gmkdo-_s/v-deo.html
Hi, you did a great work with this, Do you have or know for any tutorial to implment YOLO V7 in ROS 1? thanks in advance and sorry if is a problem.
Hi humberto hidalgo valdez!
Thanks for watching my video!
Since yolov7 is using pytorch, you can implement it with ROS Noetic, but not with versions prior to it. I don’t have a tutorial about ROS1 and yolov7, but you can refer to this tutorial.
ua-cam.com/video/594Gmkdo-_s/v-deo.html
Though it is using ROS2, the program flow required to run yolov7 should be the same.
Hello, is there any tutorial in your channel that helps with deploying yolov7 models using TensorRT and python?
I was looking for this too
Hi Guillermo Velazquez!
Thanks for watching my video!
Unfortunately, I don’t have a tutorial regarding TensorRT and yolov7. But since it seems that several people are interested in it, maybe I will make it in the future.
How long does the system( in milliseconds) take to detect/recognize an object?
Hi Shreyas Madhav A.V.!
Thanks for watching my video!
It depends on the input image size and the network size. If I remember correctly, in this implementation it was around 120ms.
Which webcam are you using Sir! because my CSI cam IMX219-160 are not connecting ...
How to connect it?
Hi Studymaterial007!
Thanks for watching my video!
In this tutorial I am using RealSense D435 camera. So general webcam will not work with the code I have provided.
Numpy failed to install on jetson nano 2gb.numoy wheels failed
What can I do. Plz help
Hi AI_VISIONS!
Thanks for watching my video!
What kind of error exactly do you have?
How can we do custom object detection with this? How to output the custom detected objects? Can you tell me this, or make a tutorial or link one please?
To train your own data set please refer here.
github.com/WongKinYiu/yolov7#training
Hi. I have a Jetson Nano, and I want to make an engine file. May I ask what I should do?
Hi 인엔프피!
The procedure of making an engine file should be same for jetson nano. To execute python3 code of this tutorial, you need python3.7 and above. But jetson nano with the newest jetpack (4.6) comes with a python3.6.9, so I am afraid it is not possible to execute it.
why is the error *core dumped* even though the memory-swap is 5.9gb (jetsonnano developer kit)
Hi Maxat Maxatov!
Thanks for watching my video!
I don’t know what is causing the “core dumped” error in your case, but I recommend you to close all other applications to free as much memory as possible before executing yolov7.
There is no detect_RS in the cloned github repo, should we use the link in your description and copy the file to the original cloned repository?
Hi Harshill Daggupati!
Thanks for watching my video!
To execute the script just download the zip file, unzip it and execute the “detect_RS” script. You don’t have to move the script anywhere.
@@robotmania8896 oh okay, thank you
may i know what is your ROS version used?
Hi MOHAMAD IKHWAN!
Thanks for watching my video!
In this tutorial I have not used ROS. It is just a python3 script.
very interesting project!, well done :D .
can i clone this project and run it on jetson nano 2gb , jetpack 4.6.1 ?
Hi Oussama Lachihab!
Thanks for watching my video!
I think it is possible to execute the python script on the 2GB version. But I don’t know whether 2GB memory is enough to successfully build the model. So, I think you have to try it out.
hi bro, can you do object recognition with webcam and then rotate the camera motor so that the object is in the middle of the frame (do servos and pca9685 work?)
Hi Boom Nguyen!
Thanks for watching my video!
I am actually planning to make the next video about object tracking, so I will make something similar to what you have mentioned. But I am planning to use jetson nano and dynamixel AX-12A servos.
@@robotmania8896 hope you will release a video soon, i'm looking forward to it. If yes, please let me know, thanks bro
Hi! Great content. I have a problem, I install every package and clone the yolov7 repository, then, when I try do the inference with the model it gets stuck with the following message: convert model to traced model. I left It overnight but It crashed and didnt do the inference. Would you know what its happenig? Could It be a bad installation of some package? Thank you!
Hi santiago arango!
Thanks for watching my video!
I think it is memory overflow. As I mention in the video (8:14~), please use the tiny model and close all other programs and windows.
I was able to run it, thank you very much!! I have another question, do you know if it is possible to run the inference in real time with a raspberry camera? If so, how do I set it up? Thank you for your time.
@@santiagoarango9216 I personally have never used a raspberry pi camera. But according to this web page, it is possible.
jetsonhacks.com/2019/04/02/jetson-nano-raspberry-pi-camera/
Please, refer to this page.
Is it possible to run this on a Redxa Rock 5 B?
Hi Jakub Sowinski!
Thanks for watching my video!
Yes, I think it is possible to run yolov7 on Redxa Rock 5 B. But inference time could be longer, since Redxa Rock 5 B doesn’t have GPU like Jetson Nano.
Using the realsense and running detect_RS.py i have this problema:
Traceback (most recent call last):
File "detect_RS.py", line 179, in
detect()
File "detect_RS.py", line 59, in detect
config = rs.config()
AttributeError: module 'pyrealsense2' has no attribute 'config'
Hi joguiguma!
Thanks for watching my video!
Have you modified the bashrc file like I mentioned in the video(10:20~)?
@@robotmania8896 thank you for your answer, however the problem is that I follow all steps, even the identification of the horses, however when I install Realsense SDK in the folder usr/local/lib/python3.6 does not appear the folder pyrealsense2, some suggestion please?
@@robotmania8896 I can solve the problem and your tutorial works very well. Thank you very much.
I dont see pyrealsense2 folder in my python3.10 folder. Just dist-packages. All of the installed ".so" packages are under a folder called "OFF". What should I do?
This tutorial assumes you are using the default Python 3.6.8. So, I am not sure what to do if you are using python3.10. Have you tried to import pyrealsenes2 library?
@@robotmania8896 Thanks for the quick reply, I can import pyrealsense2 but whenever I try to turn on the camera with pipeline.start() it give the error: No device connected
Sorry, I missed your comment. In this case, please check your USB cable.
@@robotmania8896 It was a problem in the bashrc, I was trying to download torch and torchvision from conda but it didn't see the wrappers... It is working now, thanks!
Around what fps were you getting for this?
Hi Owen!
Thanks for watching my video!
I didn’t measure fps but it seems to be around 8fps.
Hi, the video was very good i learned a lot. I am using LI-IMX219-MIPI-FF-NANO brand csi camera. how can i run it.
Hi Emirhan YILDIRIM!
Thanks for watching my video!
I think this page will help you with CSI camera.
github.com/JetsonHacksNano/CSI-Camera
Hi!
How do I run Yolov7 with ZED SDK? I have a ZED camera instead of intel real sense.
Hi SHIRSHAK PATTNAIK!
Thanks for watching my video!
Unfortunately, I don’t have a tutorial regarding ZED camera, but program flow should be the same. You have to replace the realsense part in my tutorial code to ZED definition. Here is the link of how to grab frames of ZED camera. www.stereolabs.com/docs/tutorials/image-capture/
I hope it will help you.
@@robotmania8896 hi !! can I get your contact because we are trying the process but it is not working it seems
@@shirshakpattnaik2869 Here is my email address
robotmania8867@yahoo.com
hi , how can use running on gpu , I always use cpu
Hi N ASH!
Thanks for watching my video!
If you are using jetson nano and pytorch, you don’t have to do anything special. Pytorch will detect GPU automatically.
hi! what is the python version and pip version
Hi jaisleen greetel!
Thanks for watching my video!
Python version is 3.6.9 and pip3 version is 9.0.1
Hi, I got this error
Traceback (most recent call last):
File "detect_RS.py", line 179, in
detect()
File "detect_RS.py", line 59, in detect
config = rs.config()
AttributeError: module 'pyrealsense2' has no attribute 'config'
I applied the all information after 10:00 min. almost 5 times again and again. I deleted and install the realsense lib again unfortunality no response. Please help me about this problem. But while checking the document in the pyrealsense lib in python3.6 folder, I looked that you have 6 lib folder but I have 3 lib folder eventhough I dont change anything.
Thank you
Hi Furkan Tasdemir!
Thanks for watching my video!
You error occurs when python can find the library but cannot find the right module to import. Are you sure that you have executed “buildLibrealsense.sh”? If you executed “installLibrealsense.sh”, this error may happen.
@@robotmania8896 Hi, thank you for your reply, I Had not been executed installLibrealsense.sh until writing this comment. But after writed I executed unfortunality no response. I deleted all documents and reinstall still no responce. Could you share your email, Iet me send all error to you?
@@robotmania8896 hello, thank you for your reply. I executed the buildlibrealsense without installbuildrealsense document. I tried almost 8-10 times but unfortunalty no reponse. I deleted all document and folder and tried reinstall on my jetson nano and D455 realsense. I scaned several forum for answer but :) no real answer. Could you give me your email let me send all error document to you.
Here is my email
robotmania8867@yahoo.com
@@robotmania8896 I sent thank you
Is your memory larger enough to install all these tool you need?
Yes, if you are using a 32GB SD card, you should not experience any problems.
@@robotmania8896 thanks for your reply, I use 64G sd card but the memory of /home is only 16G, what space should I install these tools? In /home or in 14 G (Image)?
@@user-ye3wu3tf4b Maybe I don’t understand something, but you don’t have to specify explicitly where to install packages and libraries. You just have to follow the commands I described in the tutorial.
Hi, i have a jetson nano and i am trying to run yolo v7 followed by your steps but I am unable to install matplitlib it's showing error, please can you help me out
Hi Chill Pill!
Thanks for watching my video!
Can you please show me the error?
how to import pyrealsense2 in jetson nano ?
Hi adli fares!
Thanks for watching my video!
Please refer to 10:00 ~ of this video.
@@robotmania8896 thanks, i already solve it :)
@@adlifares9062 can you tell me how did you solved this? As its giving me an erroe of Module Not Found 'PyrealSense2'
Hi, I received
"AttributeError: module collections has no attribute mutablemapping"
after running the command pip3 install -U PyYAML
Pls help me
Hi, cor!
Thanks for watching my video!
The following link provide explanation of the issue:
stackoverflow.com/questions/70943244/attributeerror-module-collections-has-no-attribute-mutablemapping
I hope it will help you.
hi robot mania thanks for the video i have a problem with the installation of matplotlib it tell me that i have "a failde buidling wheel for matplotlib".
I installed wheel by using "pip3 install wheel" but it still doesn't work.
It also said that there is a "failed with error code 1 in /tmp/pip-build-z99gk0eq/matplotlib"
I upgraded setuptool by using " pip install --upgrade setuptools" but it still don't work
thank you in advance
Hi ThomThom!
Thanks for watching my video!
I could not find any information about your error from the information you gave me. Maybe there are errors prior to the error you gave me?
nvidia@ubantu:~/ yolov7-main$ python3 detect.py --weights yolov7-tiny.pt --source inference/images/buss.jpg
Traceback (most recent call last):
File "detect.py", line 10, in
from models.experimental import attempt_load
File "/home/nvidia/yolov7-main/models/experimental.py", line 6, in
from models.comman import Conv, DWConv
File "/home/nvidia/yolov7-main/models/common.py" , line 11, in
ModuleNotFoundError : No module named 'torchvision.ops'
Hi Ajit coder decoder!
Thanks for watching my video!
I found a similar issue.
github.com/facebookresearch/detectron2/issues/1574
Please check your torch vision version. Maybe it is an old version.
@@robotmania8896 sir same as the video
I follow the same instructions in your video sir
@@Ajitkm8 Hmm… I never have had such an error. The posts I found said that this issue is related to unmatched versions of pytorch and torchvision.
github.com/facebookresearch/detectron2/issues/3146
@@robotmania8896 I m usin nvidia jetson TX2 NX is suitable for yolov7 model or not , if not then which model is suitable for jetson TX2 NX yolo model pls tell