The reason for TensorFlow is that it easier to create working APIs with as well as TensorFlow Lite model allows you to run YOLO detections on mobile or edge devices easier! Hope this clears it up. Thanks for the comment.
@@UCrydcKaojc44XnuXrfhlV8Q Excited to hear you are going to implement object detection with an android application. My suggestion is to please make a detailed tutorial of that application just like these. It could be fine even it is multiple parts. Program to an Application is a full-length project and that would bring great traction to your channel as well.🙌🙌💖
Hi bro, thank you so much for your tutorials. I am a complete novice in programming but I was able to follow your tutorials. Now I have a trained model to detect industrial cracks and corrosion and it is working quite well. the only issue I have was during training. the maximum I was able to get was 1200 iterations. when I tried retraining severally, it did not even save to the backup folder in google drive. anyways, it's working. all that is left is to convert to tflite and save on my raspberry pi for my robot. you are a lifesaver... CHEERS.
I am literally addicted to your videos ! I started watching your videos a week back and now I have already seen them all. Keep up the good work. Your way of explanation is truly amazing and you cover most of the doubt which we would get in while running on our own machine. Hope to see a lot of great and informative videos ahead ;) Really a bless to Computer Vision society.
had a little problem with missing modules but once i installed them it was ok. Thanks for a great tutorial. Ran it on my cpu and found the video sample ran at 0.50 FPS lol
Keep up the great work. I appreciate your energy in making these videos happen and replying to queries in the comments. I must say the latter is very impressive. You responded to a very silly mistake in Yolov3 colab video and I have been turned from a subscriber to a fan since then. For this video my query is that how does one work with the cropped images within the bounding boxes of the detection made? Like, I wanted to pass the cropped image through an OCR to get the characters in the cropped image in a list or a string format. A small video or a written tutorial in colab or tensorflow implementation of yolo would be really appreciated. And I cannot say this enough, you are the coolest channel I have ever subscribed to. Sending a lot of love and wishes from India.
Thanks for the kind words it means a lot. I will definitely be having a video soon showing how to work with the cropped image or bounding boxes. I'll make sure that it works for Colab so stay posted!
Always with great videos! I'm working on an API similar to the one you showed in another video. I'm also using OpenCV, running on CPU, and I'm getting processing times similar to yours(1300ms for Yolov3 and 15ms for Yolov3-tiny). At the Yolo github, it is said that the fastest option for running yolo on CPU is with OpenCV built with OpenVINO(optimized backend). I think a tutorial on how to use Yolov4 with OpenVino would be great!
I love your practical demonstration of yolo v4, but i would appreciate if you explain the code as it would benefit most ML and AI engineers out there .
Great Content Sir! Pl if you can kind enough to let us know if YOLO4 was doing good what value Tensor Flow bring in the table...this should be clarified first that what business problem it is existing which brings in the need for Tensor Flow..
Thanks for the video I have a task which is pedestrian detection and congestion measurement I need to build a model that can detect pedestrian and also be able to say if the frame is congested For example let's say in a frame greater than 20 people means congested
Can anyone please tell me what python version and tensorflow version should be used here. Following requirements.txt for CPU gives too many errors while importing tensorflow
Nice video, but when I try to train my custom detection model and I write this command: python save_model.py --weights ./data/mycustom.weights --output ./checkpoints/yolov4-mine --input_size 416 --model yolov4 I got an error message like this: File "E:\tensorflow-yolov4-tflite-master\core\utils.py", line 63, in load_weights conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 4717722 into shape (1024,512,3,3) How to solve this problem?
Thanks for the great video. Followed your steps and successfully got things run both in colab and local machine. However, in aws sagemaker, the model is able to predict with image as input, but with video I got output 'Video-stream stopped! '. My first guess was I made mistake in path name, but I double checked it. Had been googling around, but didn't find much. Would be appreciated if you could provide any though on it. Again, thanks for the great video.
Thanks !! for such simplified explanation, I had a doubt, do everyone make this model like this only like copy and pasting from github or should i also try to make this whole code myself from scratch ? Edit: You were getting 15 fps and saying its less whereas am getting 1.3 FPS..xd
Hi AI guy....first of all good video yaar....I tried this everything went fine but while inferencing in GPU it gives output for first frames only and no bounding box output coming for other frames please help me with this....CPU though it is working fine.
Hi, tysm for the time you take to explain all of this to us. But is here someone who can explain why in the last step of detect_video.py, the terminal returns me that it can´t find the model.pb, what should i do, im going crazyyy
You are the best ... it the best tutorial video about YOLOv4 I ever seen ... thank you very much if I want it to run a real time like the web cam of my laptop ... can you give me some hints!!!
To run webcam all you have to do is run the video command with the video paramter set to “0” and it will run off webcam. Try it out and let me know how it goes!
PLEASE CREATE AN APPLICATION VIDEO LIKE SOCIAL DISTANCE MEASURING, HUMAN COUNTING ETC SO THAT WE UNDERSTAND HOW TO EDIT THE CODE. LOVING YOUR VIDEOS! THANKYOUUUUUUUU!
When I try to execute this order: python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416.tflite I receive this error: tensorflow.lite.python.convert.ConverterError: :0: error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables a re currently not supported through this converter Can you help me please?
I am trying to convert yolov3 to a full int8 tflite model and I get this error : RuntimeError: Max and min for dynamic tensors should be recorded during calibration: Failed for tensor input_1 Empty min/max for tensor input_1
Great work! but im having a problem for the detect_video.py algorithm. apparently when i try to run it, it only gives the output of the detected object for the first frame. the remaining frame only run with the fps counter. no bounding box or object classification were shown in the output video. help?
I am getting this error on windows while creating the environment ERROR conda.core.link:_execute(698): An error occurred while installing package 'defaults::qt-5.9.7-vc14h73c81de_0' LinkError: post-link script failed for package defaults::qt-5.9.7-vc14h73c81de_0 location of failed script: D:\anaconda3\envs\yolov4-cpu\Scripts\.qt-post-link.bat ==> script messages script output
I am stuck with the error 'Could not find a version that satisfies the requirement tensorflow-gpu==2.3.0rc0' while am trying to install the dependencies by command 'conda env create -f conda-gpu.yml'. Please help
i got this error ..help plz F .\tensorflow/core/kernels/random_op_gpu.h:232] Non-OK-status: GpuLaunchKernel(FillPhiloxRandomKernelLaunch, num_blocks, block_size, 0, d.stream(), gen, data, size, dist) status: Internal: no kernel image is available for execution on the device Fatal Python error: Aborted
Hello Sir, I have learnt use of YOLO by watching your videos. Thank you for providing such videos. Sir can you please provide us video on how to distinguish between static and moving object using YOLO in google colab?
A big thumbs up for the amazing contents! I'm eagerly waiting for the object tracker video with yolov4 and deepsort. Any idea when that will be available?
For some reason when I use my own videos the program exits the video after exactly 19 frames the vid.read() is returning false. I tried different size videos ranging from 100Mbs to 4GB Does anyone know how to resolve this?
I start to dig into the machine learning field. And this tutorial is great but i have a problem, after i execute the last code to run object detection on webcam :python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video 0 --output ./detections/results.avi" It's stuck at adding visible gpu ... something. Some gg search, and i was told it's because of the old tensorflow-gpu version. So i change the conda-gpu.yml file to tensorflow-gpu>=2.4.0rc0 opencv-python>=4.1.2 And i got the error Cant parse pt1. Sequence .... Thank you very much
Hello, thanks for the video. When I try to Save custom yolov4 tf model for tflite converting I get this error: ValueError: cannot reshape array of size 4613787 into shape (1024,512,3,3) How can I solve this, what is causing the problem?
Hello, When i tried running this on my mac terminal: conda env create -f conda-gpu.yml I got this error : Solving environment: failed ResolvePackageNotFound: - cudnn - cudatoolkit==10.1.243 Can you profer a solution? Thank you
I am getting this error can you please help ValueError: Dimension 1 in both shapes must be equal, but are 256 and 512. Shapes are [?,256,26] and [?,512,26]. for '{{node concat_6}} = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32](LeakyRelu_7, ResizeBilinear, concat_6/axis)' with input shapes: [?,256,26,2], [?,512,26,8], [] and with computed input tensors: input[2] = .
Hi , thank you so much for your tutorials.here is a question ,if i just want to detect some classes like "car" and "person",how should i do ? i mean in donot want to detect like "cat" ,"dog " any thing else.
good afternoon sir @The AI Guy.. sir I would like to ask if you have complete tutorial from the start to end using google collab about yolov4.. Thank you
this is amazing and I could not be more grateful as I have been trying to find a good tutorial for this so thank you, I am very new to python so is there a way I could start the webcam detection through an application and also get the coordinates of a specific type of box (dog) I would like to use these to control a servo so it points the servo at the dog?
Hey thanks a lot for the video. It helped a lot and it was very instructive ! I was wondering if it's possible to generate a json file (for example) with a timestamp, the detected object and maybe the coordinates. I need a way to know what is going on in the video without looking at it. I want to have a text file with all the information in it. I want to build an application where you can send a video and it returns a text file with the detection informations. Would it be easy to implement in the current state of your code ? Thanks :)
I tried the following code in colab. !python /content/tensorflow-yolov4-tflite/detect_video.py --weights /content/yolov4.weights --size 416 --model yolov4 --video ./data/video/video.mp4 --output ./detections/results.avi But I got this error File "/content/tensorflow-yolov4-tflite/core/utils.py", line 77, in read_class_names with open(class_file_name, 'r') as data: FileNotFoundError: [Errno 2] No such file or directory: './data/classes/coco.names'
I have not optimized this tutorial for Colab so it will most likely have errors. I will look into optimizing it for Colab for a future video on the channel.
Super useful video once again. I have a question: do you have any pointers in how to further retrain YOLOv4 models to reduce false positives? Silly example: Say I am getting a puddle of water in the floor detected as "person" with 79% probability. I want to make use of that frame with false positive to teach the model that the puddle is not a person. Appreciate your support.
Thank you so much for this video! Is it possible for me to train this YOLOv4 model using the tensorflow framework? In the video, you have downloaded the weights from the training that was based on the Darknet framework. I was wondering if I could do everything on TF. Thanks!
Hello Sir,I learned a lot of things beacuse your nice video! But I don't know how to use yolov4 to detect on webcam, I hope you can put on the github or new video please!
Hey TheAIGuy, this is very interesting! I went through all steps, from training with Darknet, to testing with it, converting to TF model. Strangely though, Darknet gives me detected bounding boxes, but with DeepSORT script, I get no bounding boxes. I verified everything regarding the model's config, inputs and outputs, and even no errors when converting to TF model. Any thoughts why can this happen? I appreciate any provided help!
Hello thanks for the video, is very helpful, but I have a issue, I run the code to detect objects in images and it works pretty well, but when I do the same for video or my web cam just doesn't detects anything, and I'm confused... Can you help me please? Thanks!
@@luiscao7241 Check your CUDA's library and drivers, and TensorFlow version that have to be exactly the same than the one that is showed in the video, start from there and then you can experimentize with others versions of everything. I guess I've solved my issue in that way
@@loki1234509876007 Problem is resolved. But speeds is not as my expectation. It is much slower than running with darknet.exe. I got 12 FPS with TF2 (.H5) but 32FPS with darknet.exe.
@@luiscao7241 Fine, I'm glad for you, but is normal, python is soooo much slower than C, the original languaje of darknet... And it depends on your hardware, drivers an so much more too... Are you sure than your python environment is really using your graphics card? -your issue looks like something like that
@@loki1234509876007 :)) If graphics card and others packages (opencv, cudnn, cuda,...) were not installed, how could I successfully train YOLO on a customized dataset?
Thank you for such nice tutorial, but save_model.py: import "tensorflow" could not be resolved, import "absl" could not be resolved, import "absl.flags" could not be resolved. [Possible Problem]: tensorflow-gpu==2.3.0rc0 not available. I am using pip version 21.2.4, To run code I installed TF 2.8.0 & 2.3.0. still same errors. Plz guide. Thank you
Hello I tried using the custom yolov4 weights to tensorflow _pb but I get ValueError: cannot reshape array of size 4400986 into shape (1024,512,3,3) , im pretty sure I followed the yolov4 collab tutorial but when I tried using --model yolov3 args it successfuly converts into _pb but when I tried using the detect_video_py it doesnt detect anything can anyone help
I get the following error when converting from tr to trt with their own weights. What is the solution to this problem? FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Source/Data/coco_dataset/coco/5k.txt'
Thanks for this useful video, Can you HELP me, I created a GUI and when I call your function main(_argv) it gives me this error "main() takes 1 positional argument but 2 were given". any idea why ?????????????
@@TheAIGuy Yup, try implementing object detection through the webcam on colab. I have faced a ton of issues for doing it. It would be great if you can do it.
If you run python convert_trt.py, an error occurs as shown below. I installed windows 10 TensorRT and also proceeded with environment variables. I'm not sure what's the problem. Please tell me how to install and configure windows 10 TensorRT. File "convert_trt.py", line 9, in from tensorflow.python.compiler.tensorrt import trt_convert as trt ImportError: cannot import name'trt_convert' from'tensorflow.python.compiler.tensorrt' (C:\anaconda3\envs\yolov4-gpu\lib\site-packages\tensorflow\python\compiler\tensorrt\__init__.py)
Hello sir... Please help me. I want to train a object detection model on image. But As output I want object name, Object size and Objects information (If I give something). Let's say want to train on a wind turbine blade image. I want defect type in blade(there are 4 types of defects),which blade this defect belongs to. How to label image for YOLO in this situation?
hi thanks. this tutorial worked very well on me. but there is a little error, I can not apply it on android, can you post specifically for the application of TFLite on android?
Great video! New to this but learning a lot from your videos! Hopefully easy question - I'm trying to create an int8 quantized tflite model using the command 'python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416-int8.tflite --quantize_mode int8 --dataset ./coco_dataset/coco/val207.txt' and am getting errors because I don't have the '/coco_dataset/coco/val207.txt' file for the representative data gen. What is this file? How do I create it, or where do I find it? Looked all over the coco documentation. Thanks.
Great work on the conversion part. is there any workaround for using convert_tflite.py for yolov4tiny, specifically for int8? I am trying to use it, but it is throwing errors related to '/dequantize.cc:61 op_context.input->type == kTfLiteUInt8 || op_co'. I also noticed, you've mentioned that for yolov4 & yolov4tiny, it needs to be fixed. Any thoughts on why that error?
Great work, Appreciate that But i have one doubt regarding custom model I have custom object detection weight and cfg file of YOLOv4 now can I follow your same step for that? Will it work ?
Thanks for the sharing. Anyone know how to reduce the classes? I tried to delete the classes in coco.names and then modify the filter and class number in yolov4.cfg. However it doesn't work.
Let me know here in the comments if you run into any issues! Hope you enjoy :)
Why do you choose TensorFlow to run the detection? You can also run it with darknet?
The reason for TensorFlow is that it easier to create working APIs with as well as TensorFlow Lite model allows you to run YOLO detections on mobile or edge devices easier! Hope this clears it up. Thanks for the comment.
@@UCrydcKaojc44XnuXrfhlV8Q Excited to hear you are going to implement object detection with an android application. My suggestion is to please make a detailed tutorial of that application just like these. It could be fine even it is multiple parts.
Program to an Application is a full-length project and that would bring great traction to your channel as well.🙌🙌💖
@@TheAIGuy Can we use 618 X 618 as input_size rather than 416 in save_model.py file??
Rushiraj Parmar No 618 will not work. The size has to be a multiple of 32, so 608 X 608 would work!
Hi bro, thank you so much for your tutorials. I am a complete novice in programming but I was able to follow your tutorials. Now I have a trained model to detect industrial cracks and corrosion and it is working quite well. the only issue I have was during training. the maximum I was able to get was 1200 iterations. when I tried retraining severally, it did not even save to the backup folder in google drive. anyways, it's working. all that is left is to convert to tflite and save on my raspberry pi for my robot. you are a lifesaver... CHEERS.
How do you setup so the conda or pip version works for Raspberry pi?
I am literally addicted to your videos ! I started watching your videos a week back and now I have already seen them all. Keep up the good work. Your way of explanation is truly amazing and you cover most of the doubt which we would get in while running on our own machine. Hope to see a lot of great and informative videos ahead ;) Really a bless to Computer Vision society.
Akash Satamkar thanks for the kind words! Much appreciated.
Hi! Keep making these videos, they are the best and you are always willing to help others. Thank you very much!!
had a little problem with missing modules but once i installed them it was ok. Thanks for a great tutorial. Ran it on my cpu and found the video sample ran at 0.50 FPS lol
Keep up the great work. I appreciate your energy in making these videos happen and replying to queries in the comments. I must say the latter is very impressive. You responded to a very silly mistake in Yolov3 colab video and I have been turned from a subscriber to a fan since then. For this video my query is that how does one work with the cropped images within the bounding boxes of the detection made? Like, I wanted to pass the cropped image through an OCR to get the characters in the cropped image in a list or a string format. A small video or a written tutorial in colab or tensorflow implementation of yolo would be really appreciated. And I cannot say this enough, you are the coolest channel I have ever subscribed to.
Sending a lot of love and wishes from India.
Thanks for the kind words it means a lot. I will definitely be having a video soon showing how to work with the cropped image or bounding boxes. I'll make sure that it works for Colab so stay posted!
Always with great videos!
I'm working on an API similar to the one you showed in another video. I'm also using OpenCV, running on CPU, and I'm getting processing times similar to yours(1300ms for Yolov3 and 15ms for Yolov3-tiny).
At the Yolo github, it is said that the fastest option for running yolo on CPU is with OpenCV built with OpenVINO(optimized backend).
I think a tutorial on how to use Yolov4 with OpenVino would be great!
Thanks for this suggestion. I will definitely look into this for a future videos!
Got it up and running in an hour. Thanks AI Guy!
This is perfect!!! ❤️❤️ just waiting for this! Thank you! Keep going!
Thanks! Hope you enjoy it!
can you please help me with an issue?
I love your practical demonstration of yolo v4, but i would appreciate if you explain the code as it would benefit most ML and AI engineers out there .
Thanks for the suggestion. Will look into doing a code walk-through video.
Great Content Sir! Pl if you can kind enough to let us know if YOLO4 was doing good what value Tensor Flow bring in the table...this should be clarified first that what business problem it is existing which brings in the need for Tensor Flow..
Thanks for the video
I have a task which is pedestrian detection and congestion measurement
I need to build a model that can detect pedestrian and also be able to say if the frame is congested
For example let's say in a frame greater than 20 people means congested
Can anyone please tell me what python version and tensorflow version should be used here. Following requirements.txt for CPU gives too many errors while importing tensorflow
hi thank you , lets share this channels and make it big our brother need more subscribers he's doing good job
Thanks so much Donald! Appreciate your support since the early days :)
The URL to pre-trained yolo4.weights file is not opening(404 error), can anyone please help!
Excellent video tutorials. The teaching style is superb. Keep up the great work.
Nice video, but when I try to train my custom detection model and I write this command:
python save_model.py --weights ./data/mycustom.weights --output ./checkpoints/yolov4-mine --input_size 416 --model yolov4
I got an error message like this:
File "E:\tensorflow-yolov4-tflite-master\core\utils.py", line 63, in load_weights
conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0])
ValueError: cannot reshape array of size 4717722 into shape (1024,512,3,3)
How to solve this problem?
Inside data folder edit coco.names with only the class names you have trained the model
@@navonewrose still error
Hello, I have the same problem. Have you figured out the solution maybe?
SOLUTION (worked for me): change the .names file in the config to your custom classes
Thanks for the great video. Followed your steps and successfully got things run both in colab and local machine. However, in aws sagemaker, the model is able to predict with image as input, but with video I got output 'Video-stream stopped! '. My first guess was I made mistake in path name, but I double checked it. Had been googling around, but didn't find much. Would be appreciated if you could provide any though on it. Again, thanks for the great video.
I dig your code for environment in python 3.8. Here is the good one sentence " conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0 "
Thanks !! for such simplified explanation, I had a doubt, do everyone make this model like this only like copy and pasting from github or should i also try to make this whole code myself from scratch ?
Edit: You were getting 15 fps and saying its less whereas am getting 1.3 FPS..xd
Hi AI guy....first of all good video yaar....I tried this everything went fine but while inferencing in GPU it gives output for first frames only and no bounding box output coming for other frames please help me with this....CPU though it is working fine.
Thank you so much AI Guy!!!
Hi, tysm for the time you take to explain all of this to us. But is here someone who can explain why in the last step of detect_video.py, the terminal returns me that it can´t find the model.pb, what should i do, im going crazyyy
the yolo pretrained weights are no longer available on the google drive.
Best Tutorial YOLOv4 ever!
You are the best ... it the best tutorial video about YOLOv4 I ever seen ... thank you very much
if I want it to run a real time like the web cam of my laptop ... can you give me some hints!!!
To run webcam all you have to do is run the video command with the video paramter set to “0” and it will run off webcam. Try it out and let me know how it goes!
PLEASE CREATE AN APPLICATION VIDEO LIKE SOCIAL DISTANCE MEASURING, HUMAN COUNTING ETC SO THAT WE UNDERSTAND HOW TO EDIT THE CODE. LOVING YOUR VIDEOS! THANKYOUUUUUUUU!
When I try to execute this order: python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416.tflite
I receive this error: tensorflow.lite.python.convert.ConverterError: :0: error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables a
re currently not supported through this converter
Can you help me please?
hi i got some error cannot reshape array of size 770091 into shape (256,384,3,3) using yolov4 tiny
I am trying to convert yolov3 to a full int8 tflite model and I get this error :
RuntimeError: Max and min for dynamic tensors should be recorded during calibration: Failed for tensor input_1
Empty min/max for tensor input_1
Great work! but im having a problem for the detect_video.py algorithm.
apparently when i try to run it, it only gives the output of the detected object for the first frame. the remaining frame only run with the fps counter. no bounding box or object classification were shown in the output video.
help?
Did you find any solution for the above issue.
I've been stucked with the same issue for awhile too..
I'm facing the same issue. Did you manage to find it mate?
Did anyone solve this issue?
Thanks alot for the excellent explanation !! I want to find mAP for the Yolov4 model. How to use evaluate ?
I am getting this error on windows while creating the environment
ERROR conda.core.link:_execute(698): An error occurred while installing package 'defaults::qt-5.9.7-vc14h73c81de_0'
LinkError: post-link script failed for package defaults::qt-5.9.7-vc14h73c81de_0
location of failed script: D:\anaconda3\envs\yolov4-cpu\Scripts\.qt-post-link.bat
==> script messages script output
I am stuck with the error 'Could not find a version that satisfies the requirement tensorflow-gpu==2.3.0rc0' while am trying to install the dependencies by command 'conda env create -f conda-gpu.yml'. Please help
Thank you for your great content and simple explanation. Keep going :)
Hi newbie here, Could you tell me if it is applicable for yolov4 tiny following this tutorial?
Thank you.
bro your videos are vey helpful..can you make a video on yolo theory part it will be very beneficial..thanks
i got this error ..help plz
F .\tensorflow/core/kernels/random_op_gpu.h:232] Non-OK-status: GpuLaunchKernel(FillPhiloxRandomKernelLaunch, num_blocks, block_size, 0, d.stream(), gen, data, size, dist) status: Internal: no kernel image is available for execution on the device
Fatal Python error: Aborted
I got same error too
inference time of tflite is very high, means taking more time for prediction, can you PLEASE confirm me one thing tflite uses NVIDIA GPU in not?
Thank you for sharing! Excellent work :)
Hello Sir, I have learnt use of YOLO by watching your videos. Thank you for providing such videos. Sir can you please provide us video on how to distinguish between static and moving object using YOLO in google colab?
A big thumbs up for the amazing contents! I'm eagerly waiting for the object tracker video with yolov4 and deepsort. Any idea when that will be available?
This is extremely helpful! Thanks! Will u be making any tutorial of a counter for multiple objects used in applications such as traffic counting?
Yes I will be showing how to customize the code for counting, cropping images etc. soon. Stay tuned!
For some reason when I use my own videos the program exits the video after exactly 19 frames the vid.read() is returning false. I tried different size videos ranging from 100Mbs to 4GB
Does anyone know how to resolve this?
I start to dig into the machine learning field. And this tutorial is great but i have a problem, after i execute the last code to run object detection on webcam :python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video 0 --output ./detections/results.avi"
It's stuck at adding visible gpu ... something. Some gg search, and i was told it's because of the old tensorflow-gpu version. So i change the conda-gpu.yml file to
tensorflow-gpu>=2.4.0rc0
opencv-python>=4.1.2
And i got the error Cant parse pt1. Sequence ....
Thank you very much
Can you please tell what xmin, xmax, ymin, ymax mean ? Are they top-left and bottom-right coordinates or height, width and centroid of bounding box ?
I wanted to use tensorFlow Lite, but with my own YOLOv4 custom object detector. How could i do that?
Hello, thanks for the video. When I try to Save custom yolov4 tf model for tflite converting I get this error:
ValueError: cannot reshape array of size 4613787 into shape (1024,512,3,3)
How can I solve this, what is causing the problem?
sdavid did you change the .names file in the config to your custom classes?
@@TheAIGuy Dude. Thank you very much, it works.
Hello,
When i tried running this on my mac terminal: conda env create -f conda-gpu.yml
I got this error : Solving environment: failed
ResolvePackageNotFound:
- cudnn
- cudatoolkit==10.1.243
Can you profer a solution? Thank you
Thanks for the tutorial! you helped me a lot with your great videos.
excellent tutorial. Is there a tutorial where you explain the yolo model with tensorflorw from scratch?
I am getting this error can you please help
ValueError: Dimension 1 in both shapes must be equal, but are 256 and 512. Shapes are [?,256,26] and [?,512,26]. for '{{node concat_6}} = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32](LeakyRelu_7, ResizeBilinear, concat_6/axis)' with input shapes: [?,256,26,2], [?,512,26,8], [] and with computed input tensors: input[2] = .
Please add 'Test Time Augmentation' approach with YOLOv4 in your future video.
prateek gupta will look into this! Thanks for the suggestion.
Not being able to see the detections in the video, even though the video is playing.
What about object detection on Videos using tflite? Please help me
Hi can anyone tell me where can I find the .pbtxt file to know what labels are available in the saved_mode.pb?
Hi , thank you so much for your tutorials.here is a question ,if i just want to detect some classes like "car" and "person",how should i do ? i mean in donot want to detect like "cat" ,"dog " any thing else.
I am using GPU GeForce GTX 1050 ComputeCapability: 6.1... but i am getting only 3.7 FPS.
you said even cpu will get 4 to 8 FPS?? can someone help??
good afternoon sir @The AI Guy.. sir I would like to ask if you have complete tutorial from the start to end using google collab about yolov4.. Thank you
is there not a way to use this repo with cuda 10.2 sir ? im using jetson nano with pre installed cuda 10.2
Great work👍. Can you tell how to calculate mAP of your model?
this is amazing and I could not be more grateful as I have been trying to find a good tutorial for this so thank you, I am very new to python so is there a way I could start the webcam detection through an application and also get the coordinates of a specific type of box (dog) I would like to use these to control a servo so it points the servo at the dog?
Captain Lynk I have a video coming out tomorrow that will show you how to output the coordinates!
@@TheAIGuy No way thank you so much!!
for a beginner, i don’t understand where to start with cmd. even with anaconda environment, i still have problems with file directory.
Hey thanks a lot for the video. It helped a lot and it was very instructive !
I was wondering if it's possible to generate a json file (for example) with a timestamp, the detected object and maybe the coordinates. I need a way to know what is going on in the video without looking at it. I want to have a text file with all the information in it.
I want to build an application where you can send a video and it returns a text file with the detection informations.
Would it be easy to implement in the current state of your code ?
Thanks :)
a very good education. I created tflite as you explained in the video. How can I use it on Raspberry 4 4GB with web cam?
Hi man, Great video as usual! Do you know if I can use the weights from yolov3 training to this yolov4 usage?
I tried the following code in colab.
!python /content/tensorflow-yolov4-tflite/detect_video.py --weights /content/yolov4.weights --size 416 --model yolov4 --video ./data/video/video.mp4 --output ./detections/results.avi
But I got this error
File "/content/tensorflow-yolov4-tflite/core/utils.py", line 77, in read_class_names
with open(class_file_name, 'r') as data:
FileNotFoundError: [Errno 2] No such file or directory: './data/classes/coco.names'
I have not optimized this tutorial for Colab so it will most likely have errors. I will look into optimizing it for Colab for a future video on the channel.
@@TheAIGuy Thanks a lot!
Super useful video once again. I have a question: do you have any pointers in how to further retrain YOLOv4 models to reduce false positives? Silly example: Say I am getting a puddle of water in the floor detected as "person" with 79% probability. I want to make use of that frame with false positive to teach the model that the puddle is not a person. Appreciate your support.
Crack! Genio, máquina, really nice work mate!
This is really helpful. I have subscribed to your channel.
Can you make a video on how to deploy it on raspberry pi?
Thank you so much for this video! Is it possible for me to train this YOLOv4 model using the tensorflow framework? In the video, you have downloaded the weights from the training that was based on the Darknet framework. I was wondering if I could do everything on TF.
Thanks!
Hi we have a small project but we do not have the PC to do it, where can we contact or email? We already have the datasets. Thank you!!!!
Hello Sir,I learned a lot of things beacuse your nice video! But I don't know how to use yolov4 to detect on webcam, I hope you can put on the github or new video please!
Hey TheAIGuy, this is very interesting! I went through all steps, from training with Darknet, to testing with it, converting to TF model. Strangely though, Darknet gives me detected bounding boxes, but with DeepSORT script, I get no bounding boxes. I verified everything regarding the model's config, inputs and outputs, and even no errors when converting to TF model. Any thoughts why can this happen? I appreciate any provided help!
Hello thanks for the video, is very helpful, but I have a issue, I run the code to detect objects in images and it works pretty well, but when I do the same for video or my web cam just doesn't detects anything, and I'm confused... Can you help me please? Thanks!
same issues!
@@luiscao7241 Check your CUDA's library and drivers, and TensorFlow version that have to be exactly the same than the one that is showed in the video, start from there and then you can experimentize with others versions of everything. I guess I've solved my issue in that way
@@loki1234509876007 Problem is resolved. But speeds is not as my expectation. It is much slower than running with darknet.exe. I got 12 FPS with TF2 (.H5) but 32FPS with darknet.exe.
@@luiscao7241 Fine, I'm glad for you, but is normal, python is soooo much slower than C, the original languaje of darknet... And it depends on your hardware, drivers an so much more too...
Are you sure than your python environment is really using your graphics card? -your issue looks like something like that
@@loki1234509876007 :)) If graphics card and others packages (opencv, cudnn, cuda,...) were not installed, how could I successfully train YOLO on a customized dataset?
I can't use command: conda env create -f conda-gpu.yml
really helpful thank you
Glad you enjoyed! Thanks for the nice comment.
Thank you for such nice tutorial, but
save_model.py: import "tensorflow" could not be resolved,
import "absl" could not be resolved,
import "absl.flags" could not be resolved.
[Possible Problem]: tensorflow-gpu==2.3.0rc0 not available. I am using pip version 21.2.4,
To run code I installed TF 2.8.0 & 2.3.0. still same errors.
Plz guide. Thank you
update: It worked on tf-gpu 2.3.1
Can I run this above example on Google Colab ?
Hello I tried using the custom yolov4 weights to tensorflow _pb but I get ValueError: cannot reshape array of size 4400986 into shape (1024,512,3,3) , im pretty sure I followed the yolov4 collab tutorial but when I tried using --model yolov3 args it successfuly converts into _pb but when I tried using the detect_video_py it doesnt detect anything can anyone help
I checked the checkpoints folder and the ones where I used --model yolov3 doesnt have the keras_metadata pb file
hey may I know which shell you are using in this video
I get the following error when converting from tr to trt with their own weights. What is the solution to this problem?
FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Source/Data/coco_dataset/coco/5k.txt'
So you always must initially train the model using darknet and convert it to tensorflow afterwards?
yolov4 weight file is not working 404 error on drive ...
Thanks for this useful video, Can you HELP me, I created a GUI and when I call your function main(_argv) it gives me this error "main() takes 1 positional argument but 2 were given". any idea why ?????????????
Hi. I have on question? DeepSort(tensorflow) + libdarknet.so vs DeepSort(tensorflow) + tensorflow Yolov4......... which one is faster?
Humble request to do video for YOLOv4 Object Detector in colab using webcam
Thanks for the request. I've taken note of it and will look into it for future video!
@@TheAIGuy Yup, try implementing object detection through the webcam on colab. I have faced a ton of issues for doing it. It would be great if you can do it.
if i am using the google colab what are the steps?
If you run python convert_trt.py, an error occurs as shown below.
I installed windows 10 TensorRT and also proceeded with environment variables.
I'm not sure what's the problem.
Please tell me how to install and configure windows 10 TensorRT.
File "convert_trt.py", line 9, in
from tensorflow.python.compiler.tensorrt import trt_convert as trt
ImportError: cannot import name'trt_convert' from'tensorflow.python.compiler.tensorrt' (C:\anaconda3\envs\yolov4-gpu\lib\site-packages\tensorflow\python\compiler\tensorrt\__init__.py)
Hello,
Please can you add the gpu memory and gpu utilization of theses different models in you comparaison?
Will look into adding this for you soon!
Hello sir... Please help me.
I want to train a object detection model on image. But As output I want object name, Object size and Objects information (If I give something).
Let's say want to train on a wind turbine blade image. I want defect type in blade(there are 4 types of defects),which blade this defect belongs to.
How to label image for YOLO in this situation?
Great! thanks for this post!!.
hi thanks. this tutorial worked very well on me. but there is a little error, I can not apply it on android, can you post specifically for the application of TFLite on android?
tankyou for this tutorial
Why I run the TensorFlow Lite command is slower than normal TensorFlow
It's the same for me. It's 3 times slower than using CPU
@@rblansxx3444 when i run in raspberry pi 3 increase speed but cpu descent speed I think Tensorflow Lite is used for embedded systems
Great video! New to this but learning a lot from your videos! Hopefully easy question - I'm trying to create an int8 quantized tflite model using the command 'python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416-int8.tflite --quantize_mode int8 --dataset ./coco_dataset/coco/val207.txt' and am getting errors because I don't have the '/coco_dataset/coco/val207.txt' file for the representative data gen. What is this file? How do I create it, or where do I find it? Looked all over the coco documentation. Thanks.
I’m impressed with this tutorial, do you know if this will run any fast on macbook pro 2017, i7 without a GPU?
Great work on the conversion part. is there any workaround for using convert_tflite.py for yolov4tiny, specifically for int8? I am trying to use it, but it is throwing errors related to '/dequantize.cc:61 op_context.input->type == kTfLiteUInt8 || op_co'. I also noticed, you've mentioned that for yolov4 & yolov4tiny, it needs to be fixed. Any thoughts on why that error?
Hi, Thank you for the great video. But the detect_video.py has problem. it does not show any boxes.
Great work, Appreciate that
But i have one doubt regarding custom model
I have custom object detection weight and cfg file of YOLOv4
now can I follow your same step for that?
Will it work ?
Yash Mistry i have another video on showing how to run a custom model through this repository! Give it a check! Hope that helps.
Thanks for the sharing. Anyone know how to reduce the classes? I tried to delete the classes in coco.names and then modify the filter and class number in yolov4.cfg. However it doesn't work.