Real-time License Plate Recognition with YOLOv7 + OCR in Google Colab GPU | ANPR/ALPR Tutorial 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ย. 2024

ความคิดเห็น • 89

  • @mabroukhamid6879
    @mabroukhamid6879 7 หลายเดือนก่อน +2

    please How do I obtain the training accuracy?

  • @nourabdelghany6847
    @nourabdelghany6847 ปีที่แล้ว +1

    Thanks for your great efforts!...Can I enter my own datasets if I want to detect "Egyptian" license plates?

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      Yes you can! sign up to theos.ai and start labeling your own dataset! also join our community from the links in the description so we can help you.

  • @pratyushpandey9126
    @pratyushpandey9126 ปีที่แล้ว

    Amazing work.... but i have a question will it work offline once trained and downloaded????

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Thanks! yes definitely, it works offline.

  • @soumyakapat6537
    @soumyakapat6537 ปีที่แล้ว +1

    Sir, how can I collect the license plate number in colab, because it is only showing in the output video only but I need the license plate number as a string?

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      after this line: "detections = ocr_model.read(frame, detections=detections, classes=OCR_CLASSES)" the detections variable is a list of dictionaries, and each dictionary has a "text" key where you can extract the string.

    • @soumyakapat6537
      @soumyakapat6537 ปีที่แล้ว

      @@theos-ai Thank you very much 😊

    • @soumyakapat6537
      @soumyakapat6537 ปีที่แล้ว

      @@theos-ai
      from theos.computer_vision.object_detection.utils import draw
      from theos.computer_vision import ocr
      from theos.client import Client
      from google.colab import files
      from tqdm import tqdm
      import torch
      import json
      import time
      import cv2
      import os
      if torch.cuda.is_available():
      torch.cuda.empty_cache()
      client = Client(inputs='.', outputs='.')
      yolov7 = client.get(ALGORITHM, version=ALGORITHM_VERSION)
      yolov7.load_weights(WEIGHTS)
      yolov7.to_gpu()
      if OCR_MODEL_TYPE and OCR_MODEL_ACCURACY:
      ocr_model = ocr.load(size=OCR_MODEL_SIZE, model_type=OCR_MODEL_TYPE, accuracy=OCR_MODEL_ACCURACY)
      else:
      ocr_model = ocr.load(size=OCR_MODEL_SIZE)
      if OCR_MODEL_SIZE == 'large':
      ocr_model.to_gpu()
      webcam = cv2.VideoCapture(0)
      if webcam.isOpened() == False:
      print('[!] error opening the webcam')
      try:
      while webcam.isOpened():
      ret, frame = webcam.read()
      if ret == True:
      detections = yolov7.detect(frame, track=True)
      detections = ocr_model.read(frame, detections=detections, classes=OCR_CLASSES)
      for d in detections:
      print(d['text'])
      detected_frame = draw(frame, detections, alpha=0.15)
      print(json.dumps(detections, indent=4))
      cv2.imshow('webcam', detected_frame)
      cv2.waitKey(1)
      else:
      break
      except KeyboardInterrupt:
      pass
      webcam.release()
      print('[+] webcam closed')
      yolov7.unload()
      Sir I tried this code for the opening of webcam in colab, but it always says that "[!] error opening the webcam".
      So please help me to solve this problem....

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      @@soumyakapat6537 You can't open the webcam in colab. Watch this tutorial to learn how to use the webcam with YOLOv7: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html

  • @luchador191
    @luchador191 ปีที่แล้ว +1

    Thank you for your great project!Instead of inputting a video for my university homework, I need to do it in real time with the ESP32 Cam. I need to detect the plate from the camera, keep the plate code in communication with the Arduino and use it. After training YOLO, how can I do plate detection and text extraction with ESP32 Cam? I will be grateful if you help

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi 👋🏻! take a look at our new Easy YOLOv7 GitHub repository: github.com/theos-ai/easy-yolov7
      We show how to easily use YOLOv7 in real-time with any camera (even livestream). Here's the TH-cam tutorial: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html
      Then you can follow the same instructions I show in the real-time license plate video to read the text.

    • @hardishah3188
      @hardishah3188 ปีที่แล้ว

      heyy have u tried doing it? how were the results??

    • @luchador191
      @luchador191 ปีที่แล้ว

      @@hardishah3188 I did it with my computers webcam instead of ESP32CAM 5 months ago. 🙂

    • @maddestruction1
      @maddestruction1 8 หลายเดือนก่อน

      @@luchador191 I need to do it in real-time too but when a license plate is detected it outputs the number multiple times as long as it is still in the frame. How did you approach this issue?

  • @thisisrajatkumar
    @thisisrajatkumar ปีที่แล้ว +1

    Hii.
    Can we setup this whole program in system and make use it by web cam.

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      Hi 👋🏻 yes! you can use it with your webcam, I show how to do it here: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html

    • @thisisrajatkumar
      @thisisrajatkumar ปีที่แล้ว +1

      @@theos-ai will it work offline because 8 have to setup it in my college.

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Yes! It works offline

    • @pratyushpandey9126
      @pratyushpandey9126 ปีที่แล้ว

      ​@@thisisrajatkumar have you tried it offline

  • @jeremyterrible1692
    @jeremyterrible1692 10 หลายเดือนก่อน

    can i use that dataset for other country or do i need to create my own?

    • @theos-ai
      @theos-ai  10 หลายเดือนก่อน

      Depends on the alphabet of your country. But you can create your own with Theos AI if needed.

  • @dayalan81
    @dayalan81 ปีที่แล้ว

    Great work. Will this run on mobile phone s?

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      Thanks! yes for sure. Maybe not in real-time but it works.

  • @kishoreg8835
    @kishoreg8835 2 ปีที่แล้ว +5

    i have a question - insted of using ocr model. can i train my yolo v7 model to detect alphabets and numbers .. classes will be car, lp, 0-9, A-Z. isn't this better than using two different detection.

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว +3

      We tried this before but it didn't work very well. Mainly because it's hard to get a good class balance on the alphabet. You would need a lot of labeled data for this. But If you want to try, please let us know if it worked better for you, good luck!

    • @kishoreg8835
      @kishoreg8835 2 ปีที่แล้ว

      cool.

  • @sebaarr
    @sebaarr ปีที่แล้ว

    Hi! Great job, it looks amazing. It's possible to download the weights after train?

    • @theos-ai
      @theos-ai  ปีที่แล้ว +2

      Hi, thanks! Yes of course it's possible! check this out: github.com/theos-ai/easy-yolov7#click-the-weights-button

    • @sebaarr
      @sebaarr ปีที่แล้ว

      @@theos-ai Thanks a lot! :)

  • @arazib8394
    @arazib8394 ปีที่แล้ว

    Thanks for your training. Is it possible to read Asian languages like Farsi and how are you?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Yes it's definitely possible, send us an email to contact@theos.ai and we will help you. I'm good and you?

  • @varundeliwala2441
    @varundeliwala2441 ปีที่แล้ว

    Hi rama, I am facing this error, in the last google colab cell,
    AttributeError: 'NoneType' object has no attribute 'get_installation_path'
    for the line number 16: yolov7 = client.get(ALGORITHM, version=ALGORITHM_VERSION)
    can you please help me out?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi Varun 👋🏻 did you run the previous cell where the settings variable are created? and did you previously train your own model on theos.ai and set the variables accordingly to your own model just like I show in the video?

  • @coconutnut21
    @coconutnut21 ปีที่แล้ว

    What model is faster to train yolov5 or yolov7?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      They take roughly the same time. YOLOv7 tiny is the fastest to train because it's the smallest model.

  • @saifnacer4532
    @saifnacer4532 ปีที่แล้ว

    Thank you , it looks amazing , It's possible to work on my local machine not on colab , if yes can you please tell me how ??

    • @theos-ai
      @theos-ai  ปีที่แล้ว +1

      Thanks! Yes of course you can. Install all the dependencies shown in the first cell and then copy and paste the code cells in a script.py file and run it.

  • @merazali7712
    @merazali7712 ปีที่แล้ว

    Hi Thoes
    Can I use this code in Jetson nano.?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi, yes definitely

  • @GhostRider-bn3tk
    @GhostRider-bn3tk 2 ปีที่แล้ว

    Sir am getting "these weights don't exist or you don't have access to them. Please remember to set the project key if the weights are private" ...
    Please help me with that Sir....🥺

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว

      Hi Ghost! 👻
      Did you follow all the steps? You have to upload the dataset and train the model. Then set the project key with the CLI and finally you will be able to download the weights.
      Join our discord server linked in the description so we can help you there in real-time.

    • @GhostRider-bn3tk
      @GhostRider-bn3tk 2 ปีที่แล้ว

      @@theos-ai K Sir... Thank u for ur reply...😍

  • @theelofiguy
    @theelofiguy ปีที่แล้ว

    no weights with tag license-plates:experiment-1:best found for yolov7, help me please

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Did you sign up to theos.ai and trained yolov7 tiny on a dataset called "license plates" ?

    • @theelofiguy
      @theelofiguy ปีที่แล้ว

      @@theos-ai i just sign up

  • @jorgesk8iqq
    @jorgesk8iqq ปีที่แล้ว

    Thank you a lot. I hope u can help me, i need know how to work in real time, save the plate, after it put it on a database whit date and time.

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Sure, check out this video: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html

  • @tamiltanny7
    @tamiltanny7 ปีที่แล้ว

    where i can find the video

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi 👋🏻 What video? If you're talking about the video where I trained the model, it's linked in the description of this video. You can also go to our channel page and find it there.

  • @aliali-sj9jp
    @aliali-sj9jp ปีที่แล้ว

    hay thanks to let me know about the great theos and for the great lesson ,this is my question please :
    in the Detect and read script
    Replace configuration variables with my own values.
    can i do it this way because i deleted my weight tag from my theos session but before deleted i download the weights Hopeing that will have a way to implement it in this way WEIGHTS = '/content/drive/MyDrive/best.weights'
    please explain to me what i can do now

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Thanks! I'm afraid you can't use it like that in this colab notebook, you have to set the weights tag there. Try using your weights with easy yolov7: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html

  • @eduardourzua155
    @eduardourzua155 ปีที่แล้ว

    Amazing music 13:30 what song is that ?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Once Upon a December (from Anastasia): open.spotify.com/track/2PCTrOWob0vs0io6pfGOYS?si=0d3bd0e78cf04349

  • @sumitsrivatava
    @sumitsrivatava ปีที่แล้ว

    How Can i save all the car numbers in a CSV file or display real time

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Loop through the detections list, get the text with detection['text'] and then use this to save to a csv: www.codingem.com/python-write-to-csv-file/

    • @sumitsrivatava
      @sumitsrivatava ปีที่แล้ว

      @@theos-ai Hi Theos, I tried but number plate information is not getting saved on csv.
      😪

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      @@sumitsrivatava why not?

  • @arif-emre-yaman
    @arif-emre-yaman ปีที่แล้ว

    hello sir how can ı reading license plate from camera.

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi 👋🏻 check this out: github.com/theos-ai/easy-yolov7#detect-multiple-live-video-streams-in-parallel

  • @walidflux
    @walidflux 2 ปีที่แล้ว

    can you do the security camera video method please

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว +1

      Yes! will do it this week or the next, make sure to subscribe and turn on the notification bell so you know when I posted the video.

    • @yslronhepos3325
      @yslronhepos3325 ปีที่แล้ว

      can you do a security cam plss hehe

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Take a look at the new Easy YOLOv7 tutorial I made guys, I show how to use security cameras: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html

  • @haitamben9177
    @haitamben9177 11 หลายเดือนก่อน

    great work but i can't find the source code ?

    • @theos-ai
      @theos-ai  10 หลายเดือนก่อน

      It’s on the description of this video

  • @timochyfilix5176
    @timochyfilix5176 ปีที่แล้ว

    why do I have to login?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Because it's a platform, like AWS and Google Cloud but for Artificial Intelligence development.

  • @hema-ig1xk
    @hema-ig1xk 2 ปีที่แล้ว

    sir, can you teach us to use paddle OCR with custom data?

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว

      Hi hema! Sure we are working on that video currently! Make sure to subscribe and turn on the notification bell to be the first to see it when it comes out!

    • @hema-ig1xk
      @hema-ig1xk 2 ปีที่แล้ว

      @@theos-ai I see that you are trying to implement this on your website. to make training easier.... but is it possible for you to show us how to do the training normally using the repository. I can't tell my faculty that i used some library or website.... sorry if am asking for something unreasonable. there is no such tutorial online...so i could only ask you since you are kind enough to reply to us. it's ok if you can't...

    • @hema-ig1xk
      @hema-ig1xk 2 ปีที่แล้ว

      tutorial on Collab and machine if possible.

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว

      Why can't you tell them that you used a library? you will always be using a library, wether it is PyTorch, TensorFlow, NumPy, OpenCV, and all the others... the Theos pip library is no different: pypi.org/project/theos-ai/

    • @theos-ai
      @theos-ai  2 ปีที่แล้ว

      Sure, we will make it on colab

  • @seanlowwei
    @seanlowwei ปีที่แล้ว

    Hi there, I am new to machine learning. I have my own machine learning model, I have already used Theos ai to annotate and draw bounding boxes for 1000 images, may I know how I can export/download the json file for each image?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi, send me a WhatsApp message and I'll help you with this: +41784208194

  • @89Micro
    @89Micro ปีที่แล้ว +1

    Hi! After training a custom model starting from the yolov7-tiny , the inference time grows a lot ( like 4 times longer). The dataset used is not so large (500-600 images). What could be the reason for this ?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi 👋🏻 Where are you running the model?

    • @89Micro
      @89Micro ปีที่แล้ว

      @@theos-ai rookie mistake. Was using the cfg for the full yolo when training, not the one for tiny. Thanks for replying though!

  • @yurymiguel1943
    @yurymiguel1943 ปีที่แล้ว

    [theos] importing yolov7 code...
    [theos] yolov7 code imported successfully
    [theos] loading yolov7...
    Traceback (most recent call last):
    File "", line 28, in
    File "/root/theos/system/computer-vision/object-detection/algorithms/yolov7/code/theos_setup/api.py", line 15, in load_weights
    weights_path = self.get_weights_path(weights)
    File "theos/computer_vision/object_detection/api.py", line 42, in theos.computer_vision.object_detection.api.ObjectDetectionAPI.get_weights_path
    theos.exceptions.WeightsNotFound: no weights with tag license-plates:experiment-1:best found for yolov7
    Can you help me?

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Did you train a dataset called "license plates" with YOLOv7? if not probably you didn't follow the tutorial I provided on this video description: th-cam.com/video/GVLUVxTpqG0/w-d-xo.htmlfeature=shared

  • @hackspro8732
    @hackspro8732 5 หลายเดือนก่อน +1

    need your assistance on this project

  • @leminhduy7107
    @leminhduy7107 4 หลายเดือนก่อน

    Anh có thể cho xin code về phần ocr mà không cần yolov7 không

  • @Arrobosys
    @Arrobosys 9 หลายเดือนก่อน

    This is not working realtime it's Saving the vedio then it's playing

    • @theos-ai
      @theos-ai  9 หลายเดือนก่อน

      It's real-time. If you do it on your local computer you'll be able to see the output while it's detecting it.

  • @anshulparashar9743
    @anshulparashar9743 ปีที่แล้ว

    Thanks for the informative video. I am trying to connect my local gpu using the 4 commands as mentioned in previous video. It is throwing me a error that it needs theos 0.0.34. But I am unable to install it as Ubuntu says package does not exist. And therefore I am unable to connect.
    Can you please provide a solution or your WhatsApp number so I can explain better.
    I have to critically test it as our organization might move for Theos Ai Pro if this is successful.

    • @theos-ai
      @theos-ai  ปีที่แล้ว

      Hi, please send us a whatsapp message to +17372046474