Yolo v3 Introduction to object detection with TensorFlow 2

preview_player
Показать описание
When I got started learning YOLO v3, I noticed that it’s really difficult to understand both the concept and implementation. Even though there are tons of blog posts and GitHub repository about it, most of them are presented in complex architectures.

I am not going to cover how Yolo works in theory step by step. I’ll try to cover more in detail all parts from the past tutorial and parts I missed last time. If you are interested you can check my past tutorial, where I tried to explain a whole theory in it. Although I implemented it in TensorFlow 1.15. But more and more people write to me about errors, because they try my code within TF 2.0 or above, so I decided that it’s time to write YOLO v3 implementation to TensorFlow 2.1.

Based on that experience, I will try to write code in this tutorial to make it easy and reusable for many beginners who just got started learning object detection. Without over-complicating things, with this tutorial, you will be able to simply implement Yolo v3 in TensorFlow 2.1. In this tutorial series, I will give you solutions on how to train the Yolo model for your own custom dataset locally or even on Google Colab (received a lot of requests).

✅ Support My Channel Through Patreon:

✅ One-Time Contribution Through PayPal:
Рекомендации по теме
Комментарии
Автор

dude, your explanation and codes helped me a lot. You should look into EfficientDet object detection networks.

vaibhavsingh
Автор

Hi sir, thank you very much for these helpful tutorials. Could you please index these videos in this playlist(Yolo V3 with TensorFlow 2)? I want to finish the whole series but do now know in which order I should follow.

beizhou
Автор

Hi there, If you are following this video and finding issues just like I did, it's probably because there have been lots of changes made to tensorflow now. So to rectify them, follow these steps
1) Make sure you don't have any version of python installed(installed either from python.org or from microsoft store), delete all python.exe and python3.exe files present in your computer.
3) While installing it, make sure to check Add python 3.7.0 to path checkbox
3) Since numpy version is way higher than used in here, after cloning the repo, just change the first line of requirements.txt as numpy<1.19.0>=1.18.0, before pip install command
4) If you've followed these steps and pip install is not working, try python -m pip install -r ./requirements.txt

Welcome in advance!!!!

@"Python Lessons" awesome job by the way!!!!

lakshmanprabhu
Автор

Is there a anyway to make dimensions of bounding box in circle form instead of rectangle.

waqarhussain
Автор

Hi..would you pleas upload a video of class incremental learning in object detection using distillation knowledge in YOLOv3 model.

raheelsharif
Автор

getting error "NameError: name 'YOLO_DARKNET_WEIGHTS' is not defined" i modified according to your this video because when i download your github clone its something different maybe updated
and when tried in spyder IDE i getting error about cv2 but in my machine i installed both packages opencv from conda manager and opencv-python from pip manager

yashmistry
Автор

Is this tutorial will work on windows 10 ?

pritichouhan
Автор

Good afternoon, I get the error "ERROR: Could not find a version that satisfies the requirement tensorflow == 2.3.1"
Can I use 2.7.0 for example?
Thank you in advance for your response

КротВОчках-эс
Автор

May I know which dataset did you get the kite image from?

namvu
Автор

Hii.. I wanted to use the tracker for the custom objects. How can i do that for those classes which are not in coco dataset.

rashmitiwari
Автор

Hi, may I ask, how to change the weight from the existing yolov3 to tiny? Seems that the video detection a bit slow

ammarhilmi
Автор

Hi sir, I'm verry interesting for this video. Can I run this code in Tensorflow 2.10.1 cuda 11.2 ?

dungao
Автор

can i use tensorflow-gpu 2.3.0 version in this series?

yashmistry
Автор

is 0 if using GPU, and -1 if using CPU in train.py. Is my understanding right?

grlg
Автор

Nice! I want video about object detection on custom dataset, which prepared with labelimg

СергейКравченко-хц
Автор

hlw, Sir i am suffering one thing.. when i want to detect from my pc webcam it seems to very slow.(i use cpu ). Is there any way to solve this ??

shohanur_rahman_
Автор

Can i get workflow diagram for this project please

dishankadi
Автор

Thank you, dear. I have a question. The version of python you are using is 3 or 2?
I have an error. What do I need to do? Please...
Traceback (most recent call last):
File "/home/gerlee88/Documents/TensorFlow-2.x-YOLOv3/detection_demo.py", line 28, in <module>
yolo =
File "/home/gerlee88/Documents/TensorFlow-2.x-YOLOv3/yolov3/yolov3.py", line 188, in Create_Yolov3
conv_tensors = YOLOv3(input_layer, NUM_CLASS)
File "/home/gerlee88/Documents/TensorFlow-2.x-YOLOv3/yolov3/yolov3.py", line 115, in YOLOv3
route_1, route_2, conv = darknet53(input_layer)
File "/home/gerlee88/Documents/TensorFlow-2.x-YOLOv3/yolov3/yolov3.py", line 65, in darknet53
input_data = convolutional(input_data, (3, 3, 3, 32))
File "/home/gerlee88/Documents/TensorFlow-2.x-YOLOv3/yolov3/yolov3.py", line 46, in convolutional
conv = BatchNormalization()(conv)
File "/home/gerlee88/.local/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 625, in __call__
exception_str + '\n"""')
TypeError: You are attempting to use Python control flow in a layer that was not declared to be dynamic. Pass `dynamic=True` to the class constructor.
Encountered error:
"""
Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.

grlg
Автор

Grate Series Sir kindly keep it up ...
Kindly guide sir,
While training i am facing Error, i did not changed in train.py
File "train.py", line 181, in main
# use keras weights
UnboundLocalError: local variable 'save_directory' referenced before assignment

zaheerbeg
Автор

I've been learning a lot from your content. Thank you for your effort. I watched this video and ran your detection_demo.py for the test.mp4 file that comes in the repository when you download it. I'm getting an error when I try and process the test.mp4 video:
[ERROR:0] global (392) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.1.2) error: (-215:Assertion failed) !filename.empty() in function 'cv::icvExtractPattern'

However, I can save the processed test.mp4 to file (I called it test_pred.mp4), and then view it. It works - I can see the box predictions in the video. However I really like the 'real-time' aspect of displaying it on screen as you have in your video.

I'm running windows 10, with a 2070 GPU, and made a virtual environment that I installed your requirements.txt to. Any idea what might have caused this error?

kristopherhuber