Run Official YOLOv7 Object Detection on Images, Video & WebCam in Google Colab| 4K

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
here we go again guys so if you may or may not  know that yolo v6 was released this month in july   and just a few days a few weeks after that yolo  v7 was released now that's not the yolov7 that i'm   going to be showing you in this tutorial this is  yolo v7 that is meant to be multi-purpose and by   multi-purpose i mean that it allows you to  object detection with object segmentation   with both estimation and a few other special  tasks now that would have been really nice but   my problem comes in is that it doesn't  come with a peer-reviewed paper   and on top of that they call it v7 now in my  ideal world i would like for it to be called   maybe yolo detectron or yo electron or something  like that right that would have been a much more   appropriate name for it calling it yolov7 would  mean that it's better than v6 and same thing with   yolo v5 that it would be better than your before  at the time of its launch yolo v5 wasn't as good   as the only before but now i think it is better  than your level they have upgraded over time but   yolo v5 doesn't even have apr reviewed paper but  guys and girls it's not all doom and gloom because   this yolo v7 the official yolo v7 has appeared  review paper which i'll go through very soon   and i'm going to be showing you in this tutorial  how to run the official yolo v7 on a cloud gpu   now this tutorial consists of four steps the first  step is we're going to be setting up the yellow v7   dependencies right over here next in step 2 we're  going to be running inference on a single image   and in the third step we're going to be  downloading a sample video and this can   be either from a google drive link it can be a  from upload dialog or we can download a public   url video and then once we download it we're  going to be running yolo v7 on that video and   then the fourth and final step we're going to be  running yellow v7 on a webcam it will be real time   but just note that because of latencies between  collab and javascript and all of that shenanigans   it's not going to be as real time as if you had to  run it on your own pc cool so let's get started in   order to get started what you need to do is you  can head over to store dot augmented startups.com   also as you can see there's a whole variety  of projects that you can check out and what   we are looking for is this one over here called  yolov7 object detection so you can click on get   project and you can access all of the files  for free and the file that you're looking   for is this one here called yolo v7 ipython  notebook just around two megabytes and what   you need to do is go into google drive upload  it into any google drive folder that you want   and open it up in google collab cool so now you  have the google collab notebook it has everything   that you need to get running but what's really  cool is that this is a one-click solution okay   almost a one-click solution because it's just  a few dialogues that you need to interact with   so you just need to go over here to runtime  and just say run all right now before i do that   i'm going to first restart and then run all cool  so you can do the same or you can just say run all   make sure you open up this so that you  can see all of your google drive folders   so yolov7 will be installed right over here in  this directory over here so first we're going to   be mounting google drive if you haven't already  been prompted to do so it will prompt you to   connect to your google drive which you should do  once you do that it'll give you access to all of   these directories over here and this is just so  for future you can access it much more easier and   you won't have to lose anything if your runtime  restarts so next up we're going to be cloning   the repo and setting up our dependencies so you  can see all of our requirements have been met   and then just make some new directories if they  haven't been made next in 1.3 we're going to be   getting our yolo v7 models so what's really cool  is that you can run any one of the yolo v7 models   so the normal v7 the xw 6 e6 d6 e6e i know it all  sounds complicated but we'll cover all of this   in detail in the course so speaking of the yolo  v7 course there will be a link down below where   you can enroll in the full yolo v7 course when  it is available and it's not going to be just any   boring yolo v7 course we're going to focus mostly  on developing real world applications using flask   apps so connecting object detection and computer  vision to a flask web app that you can actually   deploy in the real world so definitely click that  link down below if you want to learn how to mix   computer vision with web app development cool so  moving on we have our helper code for inference   this is mostly for yellow v6 now we're not going  to go too much into this because there's a lot   to cover in this lecture and we rather  cover this in the course rather than here   and also because the comments do a really great  job of explaining everything so over here in 1.5   we have our configuration parameters and now the  reason why i have bolded this is because this is   where you can put in your inputs so what i mean is  that over here you can filter out classes that you   don't want in your output so for example we want  to fold out train or buses or you can filter out   people if you want so you can do that right over  here and what's really cool is that you don't have   to put the class number like uh back in the old  days right you can just put in train and person   and it will figure out automatically okay we don't  want train to be in our output great so now over   here in weights you can specify your weights right  so all of the ways that we downloaded up here   let's just go up here quickly you can specify any  one of these weights and it will run these weights so you can put that over here and also you can  specify your image size your confidence threshold   your iou threshold you can decide whether you want  to run this on a gpu or cpu or if you're running   this on your local computer you can specify which  gpu you want to run it on or maybe even multiple   um and then here we have classes to filter and  this will filter any classes that we specify   right over here cool so next up we're going to be  doing inference on a single image right so this is   where you specify your source image so that'll  be over here in google drive my drive yolo v7   that will be in inference that you can click over  here and all of the images that you want you can   plop into this folder and it will run it if you  specified over here really cool right so over   here we're implementing the inference for yolo v7  there's a lot that's going on here and too much to   explain in one video and then finally once we have  done the inferencing of yolo v7 we can then show   the output image which is this one over here so  as you can see we have detected a couple of horses   the confidence is quite high at 0.96 0.94 0.8 so  i think we're doing really well now one thing that   caught my attention was that this says yellow r  now it's not using yellow r because the authors of   yellow v7 the official yolo v7 created yoloR they  probably use some of the back end features from   your r and that's why they i think they probably  need to update this cool so let's move on to step   number three which is inference on a video now  over here you can see that it's running here   it's asking me to choose a file so i can choose  whichever file that i want to choose so there's   one.mp4 that i'll choose but i won't do that  right now you can choose that if you want just   note that this dialog box won't work in safari  i've tried it and it didn't work so i'm using   chrome or actually vivaldi which is an alternative  to the chrome browser so i'm just going to click   cancel over here and i'm going to instead run  it from this link here so this command will   download this video which is about 2 megabytes  in size you can put any video that you want you   can upload it to google drive and then just get  the id from it and then paste it right over here   so you can just replace that otherwise if you have  a public url you can use wget to get that video   file right next we enter our video path which is  desktop mp4 so that would be somewhere around here   just.mp4 right cool and this part of the code  will be running yellow v7 inference on a video   so you can see there's a lot of open cv functions  we're not going to go through that and you can   see over here that it is processing all of the  frames and once it has completed the processing   it will run the video right here in the browser  or in the collab environment which is really cool   maybe if the video is a bit too big it might not  be able to but what we are doing right here is   that we are compressing the video so that it will  run in the browser cool so as you can see it runs   really well so once you process the video you  are then able to download the inference video   which is really cool so you can decide whether  you want to download it straight from here   or you can also go to output.mp4 and download it  here i found that downloading from collab is not   as fast as going to say google drive and going  into your normal drive so i'll go into yellow v7   i'll go into output and if i download it from  here it will be much more faster than if you   downloaded it say from the collab notebook cool  so the video has downloaded we can now move   over to step number four which is influence on a  webcam so then over here in 4.1 we have the webcam   helper functions and then using some javascript  magic we are able to get our webcam images into   colab process them with yellow v7 and then infer  them in real time now just know that there is a   bit of latency which i'll explain in a bit so  these are all of the functions that you need   to get it running and then this will stream the  video and then if you scroll down you can see that   we are able to run yolo v7 on a webcam in real  time now just note that there is a bit of latency   okay actually there's a lot of latency as you can  see so if i move over here it'll take some time   to catch up with me and then same if i move back  here now that is because we are sending the images   from our computer into the browser into javascript  because there's a lot of processing that happens   from getting our images from our webcam into  the javascript helper functions and to process   it for google colab if you're running it real  time however this would be much more faster   cool so as you can see we are able to get  yellow v7 running in google collab on an image   video and on webcam so if you enjoyed this  tutorial you can definitely help me out by   buying me a chai or coffee i really like chai and  mainly because augmented startups is my full-time   job basically with your support i'm able to create  more tutorials like this and to make computer   vision easy for you speaking of computer vision  if you want to learn more in computer vision   we have courses which you can click over here it  will take you to our website so we have a bunch of   courses in ai and computer vision so the recent  course that we launched is the unit course it's   an image segmentation course that is designed for  biomedical applications self-driving car course   for all you robotics enthusiasts our justin  computer vision course one of our most popular   courses is ulr by far mainly because we show you  how to pull 18 plus yolo R apps and then over   here we have YOLOX which shows you how to build a  full yolo x dashboard so computer vision dashboard   for traffic flow management so you can check out  all of our courses that we have as well as all of   the other projects that we have on our project  store also be sure to like share and subscribe   to our youtube channel right over here to keep  up to date with the latest in yolo v7 and beyond and if you want to learn how to train your yolo  v7 models then check this video right over here
Info
Channel: Augmented AI
Views: 42,246
Rating: undefined out of 5
Keywords: darknet, object detection, yolo, custom object detection, train yolo in cloud, cloud, google colab, object detection classifier, custom detector, custom yolov4, deep learning, yolov7, yolov7 cloud, yolov5, yolov7 tutorial, install yolov7, train yolov7, augmented startups
Id: bkWeWmvYFvY
Channel Id: undefined
Length: 12min 10sec (730 seconds)
Published: Wed Jul 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.