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?
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.
@@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....
@@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
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
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.
@@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?
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.
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!
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?
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?
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.
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....🥺
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.
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.
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
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
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!
@@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...
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/
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?
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] 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?
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
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.
please How do I obtain the training accuracy?
Thanks for your great efforts!...Can I enter my own datasets if I want to detect "Egyptian" license plates?
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.
Amazing work.... but i have a question will it work offline once trained and downloaded????
Thanks! yes definitely, it works offline.
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?
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.
@@theos-ai Thank you very much 😊
@@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....
@@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
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
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.
heyy have u tried doing it? how were the results??
@@hardishah3188 I did it with my computers webcam instead of ESP32CAM 5 months ago. 🙂
@@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?
Hii.
Can we setup this whole program in system and make use it by web cam.
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
@@theos-ai will it work offline because 8 have to setup it in my college.
Yes! It works offline
@@thisisrajatkumar have you tried it offline
can i use that dataset for other country or do i need to create my own?
Depends on the alphabet of your country. But you can create your own with Theos AI if needed.
Great work. Will this run on mobile phone s?
Thanks! yes for sure. Maybe not in real-time but it works.
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.
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!
cool.
Hi! Great job, it looks amazing. It's possible to download the weights after train?
Hi, thanks! Yes of course it's possible! check this out: github.com/theos-ai/easy-yolov7#click-the-weights-button
@@theos-ai Thanks a lot! :)
Thanks for your training. Is it possible to read Asian languages like Farsi and how are you?
Yes it's definitely possible, send us an email to contact@theos.ai and we will help you. I'm good and you?
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?
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?
What model is faster to train yolov5 or yolov7?
They take roughly the same time. YOLOv7 tiny is the fastest to train because it's the smallest model.
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 ??
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.
Hi Thoes
Can I use this code in Jetson nano.?
Hi, yes definitely
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....🥺
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.
@@theos-ai K Sir... Thank u for ur reply...😍
no weights with tag license-plates:experiment-1:best found for yolov7, help me please
Did you sign up to theos.ai and trained yolov7 tiny on a dataset called "license plates" ?
@@theos-ai i just sign up
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.
Sure, check out this video: th-cam.com/video/KFZW8p-o2fA/w-d-xo.html
where i can find the video
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.
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
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
Amazing music 13:30 what song is that ?
Once Upon a December (from Anastasia): open.spotify.com/track/2PCTrOWob0vs0io6pfGOYS?si=0d3bd0e78cf04349
How Can i save all the car numbers in a CSV file or display real time
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/
@@theos-ai Hi Theos, I tried but number plate information is not getting saved on csv.
😪
@@sumitsrivatava why not?
hello sir how can ı reading license plate from camera.
Hi 👋🏻 check this out: github.com/theos-ai/easy-yolov7#detect-multiple-live-video-streams-in-parallel
can you do the security camera video method please
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.
can you do a security cam plss hehe
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
great work but i can't find the source code ?
It’s on the description of this video
why do I have to login?
Because it's a platform, like AWS and Google Cloud but for Artificial Intelligence development.
sir, can you teach us to use paddle OCR with custom data?
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!
@@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...
tutorial on Collab and machine if possible.
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/
Sure, we will make it on colab
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?
Hi, send me a WhatsApp message and I'll help you with this: +41784208194
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 ?
Hi 👋🏻 Where are you running the model?
@@theos-ai rookie mistake. Was using the cfg for the full yolo when training, not the one for tiny. Thanks for replying though!
[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?
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
need your assistance on this project
Anh có thể cho xin code về phần ocr mà không cần yolov7 không
This is not working realtime it's Saving the vedio then it's playing
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.
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.
Hi, please send us a whatsapp message to +17372046474