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...
  • Наука та технологія

КОМЕНТАРІ • 98

  • @basak101
    @basak101 Рік тому

    Great tutorial! Thanks!

    • @robotmania8896
      @robotmania8896  Рік тому +1

      Hi Başak Akyüz!
      Thanks for watching my video!
      It is my pleasure is this video have helped you!

  • @YigalBZ
    @YigalBZ Рік тому

    Great video. Thank you. What changes are required for doing the same with regular CSI camera (or USB), on a custom trained model?

    • @robotmania8896
      @robotmania8896  Рік тому

      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

    • @Ahmed-Khaled-
      @Ahmed-Khaled- 8 місяців тому

      @@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!

  • @nonpawitekburanawat1329
    @nonpawitekburanawat1329 Рік тому

    Thank you so much

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi Nonpawit Ekburanawat!
      Thanks for watching my video!
      It is my pleasure if this video has helped you!

  • @user-ep8bo9gy6w
    @user-ep8bo9gy6w Рік тому +1

    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 !

    • @robotmania8896
      @robotmania8896  Рік тому

      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

  • @humbertobruto
    @humbertobruto Рік тому

    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.

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @guillermovelazquez3211
    @guillermovelazquez3211 Рік тому +1

    Hello, is there any tutorial in your channel that helps with deploying yolov7 models using TensorRT and python?

    • @yeohweixiangbenjy1983
      @yeohweixiangbenjy1983 Рік тому +1

      I was looking for this too

    • @robotmania8896
      @robotmania8896  Рік тому +1

      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.

  • @shreyasmadhava.v.598
    @shreyasmadhava.v.598 Рік тому

    How long does the system( in milliseconds) take to detect/recognize an object?

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @user-gm1ge8ef2u
    @user-gm1ge8ef2u 2 місяці тому

    Which webcam are you using Sir! because my CSI cam IMX219-160 are not connecting ...
    How to connect it?

    • @robotmania8896
      @robotmania8896  2 місяці тому +1

      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.

  • @Inspiration_video23
    @Inspiration_video23 Рік тому +1

    Numpy failed to install on jetson nano 2gb.numoy wheels failed
    What can I do. Plz help

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi AI_VISIONS!
      Thanks for watching my video!
      What kind of error exactly do you have?

  • @harshilldaggupati
    @harshilldaggupati Рік тому

    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?

    • @robotmania8896
      @robotmania8896  Рік тому +1

      To train your own data set please refer here.
      github.com/WongKinYiu/yolov7#training

  • @user-qw8iq5st5h
    @user-qw8iq5st5h Рік тому

    Hi. I have a Jetson Nano, and I want to make an engine file. May I ask what I should do?

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @maxatmaxatov9197
    @maxatmaxatov9197 Рік тому

    why is the error *core dumped* even though the memory-swap is 5.9gb (jetsonnano developer kit)

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @harshilldaggupati
    @harshilldaggupati Рік тому

    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?

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

    • @harshilldaggupati
      @harshilldaggupati Рік тому

      @@robotmania8896 oh okay, thank you

  • @mohamadikhwan589
    @mohamadikhwan589 Рік тому

    may i know what is your ROS version used?

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi MOHAMAD IKHWAN!
      Thanks for watching my video!
      In this tutorial I have not used ROS. It is just a python3 script.

  • @oussamalachihab3107
    @oussamalachihab3107 Рік тому

    very interesting project!, well done :D .
    can i clone this project and run it on jetson nano 2gb , jetpack 4.6.1 ?

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @minhhnguyen88
    @minhhnguyen88 Рік тому

    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?)

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

    • @minhhnguyen88
      @minhhnguyen88 Рік тому

      @@robotmania8896 hope you will release a video soon, i'm looking forward to it. If yes, please let me know, thanks bro

  • @santiagoarango9216
    @santiagoarango9216 Рік тому

    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!

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

    • @santiagoarango9216
      @santiagoarango9216 Рік тому

      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.

    • @robotmania8896
      @robotmania8896  Рік тому

      @@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.

  • @jsow99
    @jsow99 8 місяців тому

    Is it possible to run this on a Redxa Rock 5 B?

    • @robotmania8896
      @robotmania8896  8 місяців тому

      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.

  • @joguiguma
    @joguiguma 5 місяців тому

    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'

    • @robotmania8896
      @robotmania8896  5 місяців тому

      Hi joguiguma!
      Thanks for watching my video!
      Have you modified the bashrc file like I mentioned in the video(10:20~)?

    • @joguiguma
      @joguiguma 5 місяців тому

      @@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?

    • @joguiguma
      @joguiguma 5 місяців тому

      @@robotmania8896 I can solve the problem and your tutorial works very well. Thank you very much.

  • @user-bz3mh2ud8e
    @user-bz3mh2ud8e 10 місяців тому

    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?

    • @robotmania8896
      @robotmania8896  10 місяців тому

      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?

    • @user-bz3mh2ud8e
      @user-bz3mh2ud8e 10 місяців тому

      @@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

    • @robotmania8896
      @robotmania8896  10 місяців тому

      Sorry, I missed your comment. In this case, please check your USB cable.

    • @user-bz3mh2ud8e
      @user-bz3mh2ud8e 10 місяців тому

      @@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!

  • @owen261
    @owen261 Рік тому

    Around what fps were you getting for this?

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi Owen!
      Thanks for watching my video!
      I didn’t measure fps but it seems to be around 8fps.

  • @emirhanyildirim8135
    @emirhanyildirim8135 Рік тому

    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.

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi Emirhan YILDIRIM!
      Thanks for watching my video!
      I think this page will help you with CSI camera.
      github.com/JetsonHacksNano/CSI-Camera

  • @shirshakpattnaik2869
    @shirshakpattnaik2869 Рік тому

    Hi!
    How do I run Yolov7 with ZED SDK? I have a ZED camera instead of intel real sense.

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

    • @shirshakpattnaik2869
      @shirshakpattnaik2869 Рік тому

      @@robotmania8896 hi !! can I get your contact because we are trying the process but it is not working it seems

    • @robotmania8896
      @robotmania8896  Рік тому

      @@shirshakpattnaik2869 Here is my email address
      robotmania8867@yahoo.com

  • @nash9501
    @nash9501 9 місяців тому

    hi , how can use running on gpu , I always use cpu

    • @robotmania8896
      @robotmania8896  9 місяців тому

      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.

  • @jaisleengreetel8671
    @jaisleengreetel8671 Рік тому

    hi! what is the python version and pip version

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi jaisleen greetel!
      Thanks for watching my video!
      Python version is 3.6.9 and pip3 version is 9.0.1

  • @furkantasdemir1941
    @furkantasdemir1941 Місяць тому

    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

    • @robotmania8896
      @robotmania8896  Місяць тому

      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.

    • @furkantasdemir1941
      @furkantasdemir1941 Місяць тому

      @@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?

    • @furkantasdemir1941
      @furkantasdemir1941 Місяць тому

      @@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.

    • @robotmania8896
      @robotmania8896  Місяць тому

      Here is my email
      robotmania8867@yahoo.com

    • @furkantasdemir1941
      @furkantasdemir1941 Місяць тому

      @@robotmania8896 I sent thank you

  • @user-ye3wu3tf4b
    @user-ye3wu3tf4b Рік тому

    Is your memory larger enough to install all these tool you need?

    • @robotmania8896
      @robotmania8896  Рік тому +1

      Yes, if you are using a 32GB SD card, you should not experience any problems.

    • @user-ye3wu3tf4b
      @user-ye3wu3tf4b Рік тому

      @@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)?

    • @robotmania8896
      @robotmania8896  Рік тому +1

      @@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.

  • @chillpill9163
    @chillpill9163 Рік тому

    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

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi Chill Pill!
      Thanks for watching my video!
      Can you please show me the error?

  • @adlifares9062
    @adlifares9062 Рік тому

    how to import pyrealsense2 in jetson nano ?

    • @robotmania8896
      @robotmania8896  Рік тому

      Hi adli fares!
      Thanks for watching my video!
      Please refer to 10:00 ~ of this video.

    • @adlifares9062
      @adlifares9062 Рік тому

      @@robotmania8896 thanks, i already solve it :)

    • @swayansubaral210
      @swayansubaral210 7 місяців тому

      @@adlifares9062 can you tell me how did you solved this? As its giving me an erroe of Module Not Found 'PyrealSense2'

  • @cor3200
    @cor3200 Рік тому

    Hi, I received
    "AttributeError: module collections has no attribute mutablemapping"
    after running the command pip3 install -U PyYAML
    Pls help me

    • @robotmania8896
      @robotmania8896  Рік тому

      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.

  • @MrThomas19995
    @MrThomas19995 Рік тому

    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

    • @robotmania8896
      @robotmania8896  Рік тому

      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?

  • @Ajitkm8
    @Ajitkm8 Рік тому

    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'

    • @robotmania8896
      @robotmania8896  Рік тому +1

      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.

    • @Ajitkm8
      @Ajitkm8 Рік тому

      @@robotmania8896 sir same as the video

    • @Ajitkm8
      @Ajitkm8 Рік тому

      I follow the same instructions in your video sir

    • @robotmania8896
      @robotmania8896  Рік тому

      @@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

    • @Ajitkm8
      @Ajitkm8 Рік тому

      @@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