Hey y'all! Wrote up a couple of steps to setup your environment. I'm planning on doing a video on this but until then, here's a crash course post: 1. First up install Python 3.7.4. Download and install the package for your OS that has the words 2019.07 in it from here repo.anaconda.com/archive/. This should give you 3.7.4 to work with. 2. Then install Visual Studio C++ 2015 from here: go.microsoft.com/fwlink/?LinkId=691126. Tensorflow needs this in order to compile 3. OPTIONAL IF YOU HAVE A GPU - Install Cuda and Cudnn. Install Cuda first, then install Cudnn. - Cuda: 10.1 - developer.nvidia.com/cuda-10.1-download-archive-base - Cudnn: 7.6.5 - developer.nvidia.com/rdp/cudnn-download Once Cudnn is installed you need to copy the Cudnn files into their respective folders inside the Cuda directory. I used this as a guide: towardsdatascience.com/installing-tensorflow-with-cuda-cudnn-and-gpu-support-on-windows-10-60693e46e781 4. Then install Protoc 3.13 from here: github.com/protocolbuffers/protobuf/releases. For windows, download the repository and then add it to your PATH file. 5. Then install python packages using the pip command: Tensorflow: 2.3.1 - pip install tensorflow==2.3.1 OpenCV: 4.4.0 - pip install tensorflow==4.4.0 6. Install the object detection API. To do this, run these commands from a command prompt or terminal: git clone github.com/tensorflow/models cd tensorflow/models/research protoc object_detection/protos/*.proto --python_out=. cp object_detection/packages/tf2/setup.py . python -m pip install .
Dear Nich Sir, I was a software engineer student, yesterday my results has come out and I got a first-class honor for my BSc degree, For the final project, I got 80 marks. My final project was Sign language detection in my language (Sinhala language). That project was kinda Advanced, but your sign language detection videos series inspired me to make a better project for my finals. So Thank you soo much and wanna say this, again and again, YOU ARE THE BEST AI TEACHER IN TH-cam, Keep making these kinda videos and make others' life brighter like this. I think you should pin this comment. ⭐⭐⭐
@@sukanyadessai6238 th-cam.com/video/dZh_ps8gKgs/w-d-xo.html this is the video i followed and setup all correctly. Also for the data training i hv used colab.
@@NicholasRenotte No, thanks to you with your awesome works, awesome technics, ...But could you make a video on how to save this model ? ( Save the mobel in tflite format, tf.js format for example?)
@@NicholasRenotte I have already test an object Detection project in flutter application that uses the SSD mobilenet and YOLO and if I am not wrong I think by changing just the .tflite model and the label.txt by this one, I think it will work because I think your model extends to SSD mobilenet
🤣 Oh I know where you're coming from, it was a nightmare coming up with the walkthrough for this. The content and documentation is haphazard as hell. I just need to make an installation video now!
Haha I bet it was laborious, by far thought this the best video in TH-cam that implements some sort of tracking hand gesture that makes sense all the way through lol
@@ypm7369 thanks so much 🙏 , it honestly means a lot you saying that!! I'm working on how to export the models and work with them in Tensorflow.JS apps right now...there's also sooo little documentation for how to do it properly.
Excuse me, I want to ask. At 11:01 minutes, in the program to take pictures automatically, my program has no errors at all, looks good. The camera is detected successfully, the frame appears, and the frame can display the image from the camera. After the program finishes (camera off) a new directory appears, but none of the images are saved. What happened? May I know the explanation? Thank you before!
I had the same issue - I solved it by using this function here, just copy paste it into the cell where his one is and you should be fine: # Loop through each label and collect images for label in labels: # Create directory for the label label_dir = os.path.join(IMAGES_PATH, label) os.makedirs(label_dir, exist_ok=True)
cap = cv2.VideoCapture(0) print("Collecting images for {}".format(label)) time.sleep(5)
for imgnum in range(number_of_images): ret, frame = cap.read() if not ret: print("Failed to capture image") continue
First of all, thank you, sir, for this great content. For those trying this in 2024, I want to say that this program can still be compiled. However, there are some version gaps and compatibility issues between Apple and Windows OS in the code. But don’t give up-keep going! Much love from Sri Lanka! ❤️
Nick, you are amazing! All thanks to you for making a well organised video with soo much clarity 💥💥 .... I did my first deep learning project based on your teaching and safe to say that it was a HIT among my professors.... I look forward to make more of such projects... Thank you so much Prof. Nick .... You are the BEST⭐⭐⭐⭐⭐
✦ Building a real-time sign language detector using TensorFlow Object Detection and Python 00:04 Collecting images using python and opencv, labeling them using label image package Building the sign language detector using transfer learning and tensorflow object detection api ✦ Leverage transfer learning, pre-processing, and training code. 01:46 Collect images using OpenCV and webcam for training. Set up label image and label the images for sign language detection. Update checkpoints and execute training. ✦ Imported necessary dependencies for image collection and processing 05:15 Imported cv2, os, time, and uuid for image collection and file handling Specified the path for storing collected images and defined the labels for sign language poses ✦ Setting up labels and collecting images 07:08 Labels are created to represent different poses for image collection Code is written to loop through labels, create directories for each label, and capture images using webcam ✦ Collecting and labeling images for object detection with Real Time Sign Language Detection 10:38 Using the label image package to label images for object detection Organizing images into folders for each label in the workspace for TensorFlow ✦ Setting up label image and labeling images using TensorFlow Object Detection 13:11 Setting up label image involves a few steps including organizing the images into a single directory and running the python command to start the labeling process. Labeling the images is done using label image, where the image directory and save directory are specified before starting the labeling process. ✦ XML files contain all necessary information for object representation. 16:50 XML files include image folder, file name, path, source, size, and object details. Data partitioning is crucial for training and testing the object detection model. ✦ Organizing images and annotations for training and testing 18:24 Selecting images for training and testing folders based on classes Moving both images and xml annotations into the appropriate folders ✦ Creating label map and tf records for object detection using TensorFlow. 21:33 The label map file should be present in the annotation folder with different labels and IDs. To simplify the generation of tf records, use the script 'generate tf record' included in the GitHub repository. ✦ Created tf record files for training and test data 23:06 Generated successfully the tf record files for both training and test data partitions Updated label map and generated tf records, ready to proceed to training ✦ Updating configuration parameters for model training 26:11 Changing batch size and fine-tune checkpoint for faster training Updating annotation path, tf records, and checkpoint type for detection ✦ Training the deep learning model using command prompt 27:42 The time taken for training depends on the available hardware, such as GPU The process involves running a command in the terminal, and monitoring the loss metrics for successful training ✦ Real-time sign language detection using pre-built model and training process. 30:39 Real-time detection demonstrated with accurate recognition of signs like 'hello', 'I love you', 'thank you', and 'no'. Images captured with OpenCV, labeled with label image, and model trained through pre-built Jupyter notebook.
Nick - Love your channel - Thanks for this video. I was still struggling after the "face mask" video. This one clarified a lot of the important points. It gave me a much better understanding of what is going on than just watching the first object detection video twice... ok ten times ;-) . Speed of training - I have an AMD RX 580 video card instead of NVidia so I'm stuck with training via my AMD 3700X CPU (or am I?). No hindrance to the learning experience of course, but if I had only known last year when I built up my systems... sigh. Thanks again, you are truly a terrific teacher!
Ohhhhhh I know the pain of getting the GPU to work. Yep, unfortunately at the moment only NVIDIA cards seem to dominate the deep learning space. I think there's work being done on the AMD cards but it's still a while away. SOOOOO pumped you got it all working though!!
Heya, just updated the pinned post, all the install steps are there! These are the versions and source locations: Python: 3.7.4 - Windows: repo.anaconda.com/archive/Anaconda3-2019.07-Windows-x86_64.exe Mac: repo.anaconda.com/archive/Anaconda3-2019.07-MacOSX-x86_64.sh Linux: repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh Tensorflow: 2.3.1 - pip install tensorflow==2.3.1 OpenCV: 4.4.0 - pip install tensorflow==4.4.0 Protoc 3.13 - github.com/protocolbuffers/protobuf/releases. If using GPU - Cuda: 10.1 - developer.nvidia.com/cuda-10.1-download-archive-base - Cudnn: 7.6.5 - developer.nvidia.com/rdp/cudnn-download
in step 5 someone gave this error? 96 callable (pipeline_config_path) 97 with tf.io.gfile.GFile (pipeline_config_path, "r") as f: 98 proto_str = f.read () TypeError: 'module' object is not callable
@@ishmeetahuja9343 I got error during config file. When I run code config_util.get_configs_from_pipeline_file(CONFIG_PATH) Error is:- Message type "object_detectio.protos.TrainConfig"
@@shubhamnagalwade4642 hmm, that's the full error? Sounds like the protoc step might not ahve been run during installation. Can you try running through this: th-cam.com/video/dZh_ps8gKgs/w-d-xo.html
thank you for this great video .I just have one question. this code just recognize every sign that we give to it. if we want to have a code with all sign to recognize every sentences and words , what should we do?
You have to train your model to detect the signs that you want. So, you could add in all of the additional words you'd like to have recognized as part of your image collection and labelling @samaneh.
I have this error when reading the config file config = config_util.get_configs_from_pipeline_file(CONFIG_PATH): ParseError: 21:11 : Message type "object_detection.protos.Initializer" has no field named "random_normal_initializer".
Thank You so much for explaining the project code by code. I am facing a small issue. My TF records are not getting created. Do you have any idea why? I've gone through many videos of yours to understand where am I going wrong.
I am constantly getting some random errors when trying to test the system. Currently, I am having Tensorflow 2.11 and python 3.7.8. Which version should I download ??
Hey, I'm stuck at where you update labelmaps. When i run the code to create tfrecords, it shows an error Traceback (most recent call last): File "D:\RealTimeObjectDetection\Tensorflow\scripts\generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util File "C:\Users\amrit\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 21, in from object_detection.protos import string_int_label_map_pb2 ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (C:\Users\amrit\anaconda3\lib\site-packages\object_detection\protos\__init__.py) Traceback (most recent call last): File "D:\RealTimeObjectDetection\Tensorflow\scripts\generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util File "C:\Users\amrit\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 21, in from object_detection.protos import string_int_label_map_pb2 ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (C:\Users\amrit\anaconda3\lib\site-packages\object_detection\protos\__init__.py) Please help as soon as possible and thanks in advance..
[Errno 2] No such file or directory: 'Tensorflow/workspace/annotations\\label_map.pbtxt' I'm getting this error, can someone help me? (doing this on Collab, MacOS 10.15.3)
Heya @Siddaharth, try removing one of the slashes after annotations and flipping the other so you have: Tensorflow/workspace/annotations/label_map.pbtxt'
@@NicholasRenotte Would it matter if I did this in Collab instead of regular Jupyter notebook? I'm getting another error when doing it in Collab.. (I've already installed object-detection through pip) Traceback (most recent call last): File "/content/generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util ModuleNotFoundError: No module named 'object_detection' I'm really sorry for bothering you with this, I just am really thankful for your videos and time!
I'm always here to help, no stress@@sid4752. It should be relatively similar, that error is because the object detection API hasn't been installed, try running through the install video: th-cam.com/video/dZh_ps8gKgs/w-d-xo.html
you are definitely a best of the best in object detection man i need theses stuffd for NLP, ocr furthur image processing langchain and advanced gen ai too
Thanks for this amazing tutorial. I used it to train a model exactly as you did. Do you know what the best way to load the model I have trained into the C++ API of tensorflow? Thank you again!
Thank you so much, sir! I wonder what if I train about 100 different signs and gestures? Should I alter the layers in that config file? How to deal with overfitting and underfitting problem?
Heya @Nigar, all you need to do is ensure you have examples of all 100 signs and gestures as part of your images, update your labelmap so you have them listed and change your number of classes to 100 in the config.
Salam Nigar. I am from Azerbaijan. Are you also doing the project for Azerbaijani sign language? If so, could you please contact me for cooperation in some points? I am doing the project.
Hey Nicholas, in my first run I trained my model to 12000 steps. There is still a relatively high loss (0.25). How can I alter the training command to retrain starting from my latest checkpoint?
Heya, try changing your checkpoint in your config, point the line below to the folder where your new checkpoints are located: pipeline_config.train_config.fine_tune_checkpoint = PRETRAINED_MODEL_PATH+'/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/checkpoint/ckpt-0' Should be something like, change it to the appropriate checkpoint number based on what you've got. Then rerun the same training command. pipeline_config.train_config.fine_tune_checkpoint = CHECKPOINT_PATH +'ckpt-6'
Thanks for the tutorial. Is 'Creating TF Records part' necessary? Because I have a problem. While Creating TF Records, I encounter with an error which says File "Tensorflow/scripts/generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util ModuleNotFoundError: No module named 'object_detection' I search this error and I write pip install tensorflow-object-detection-api in cmd. Then I encounter another error which says, File "Tensorflow/scripts/generate_tfrecord.py", line 61, in label_map = label_map_util.load_labelmap(args.labels_path) File "C:\Python38\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap with tf.gfile.GFile(path, 'r') as fid: AttributeError: module 'tensorflow' has no attribute 'gfile' Do you have any ide how to fix? Or should I pass this part?
Great video. Appreciate your effort a lot! Two questions: If you would perform two gestures using both hands at the same time, would the model have detected both gestures at the same time? Is it possible to train for one class only? Best regards
Hi Raphael, in this case it would as I labelled images for each class using both hands. If I only used one hand per class e.g. right for hello, left for no, right for yes and trained for a while. Then there's an increased likelihood that it would only detect the class that matches the hand.
@@apnadekhtu How are you goin to train the model? For this the best is to use any dns to your routher like Open Dns Family Shield. Sorry for my poor english
Thanks for this amazing tutorial Nick. You explained everything so nicely. A quick question, if I trained this model previously for 20 pictures of each class, and now I wish to increase the training dataset to around 50 pics. Will I have to retrain the model from scratch? (Cause on CPU, it took me around 5 hours to train for 20k steps!)
You don't have to but you need to tweak your code if you want to pick up from where you left off. If so, you need to freeze your model, export it, then update your pipeline.config file to pick up training from that checkpoint (fine_tune_checkpoint parameter in the pipeline.config file!)
Hi I am also training the model on cpu since I don't have GPU. And 2500 steps were done in 2 hours! So should I continue or stop because my pc has become super slow...will it be ok to leave the pc overnight?
Hello, I am sorry for keep disturbing you, but I have no choice, i keep getting error, and this time I face the issue of this: 2021-03-22 20:54:24.030973: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2) When I start to train my dataset, it stop on this line and do nothing for a long time, could you know about this issue??
Thank you so much for this tutorial Nicholas ! One more thing I wanted to ask that is it possible to read out the phrases that gets recognized by the system? If yes, please do guide !
@@JamilKhan-hk1wl Hey. I'm halfway through the project. Can you pls tell me how many nodes are being used in this Project? And about activation function, if possible. I would really appreciate your reply.
Heya @Luca, I don't have it saved anymore unfortunately. I've got this one available but it only detects hello (not trained for that long though): github.com/nicknochnack/TFODRPi/blob/main/detect.tflite
Ah, you can't capture the images using colab. It's not able to access your webcam through the notebook. Try capturing the images locally and then training on colab if you need to!
@@NicholasRenotte i already have a test train. Education etc. everything ok. I came to the end. The last code have such an error. Detection-opencv part. If I do it locally I have to go back to the beginning : /
@@meryy.3779 awesome, ah you don't, you just need to bring your checkpoints over to your pc and run it from there. There is a way to access your webcam from colab it just takes a little more work.
23:15 I am getting error on CREATE TF RECORDS part. Error:- Traceback (most recent call last): File "Tensorflow/scripts/generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util ModuleNotFoundError: No module named 'object_detection' What should I do sir?
Hi Nicholas! Thank you so much! I got this, please help: error: OpenCV(4.4.0) /tmp/pip-req-build-dglzv4yn/opencv/modules/imgcodecs/src/loadsave.cpp:738: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'
Hello Nicholas, I know you made this project long ago, but still I would really be glad if you let know what are the algorithms used here. Can we use other algorithms to this for its better accuracy and results like KNN, logistic regression or decision tree, if yes, please guide how. And last, how to generate the classification report here. Please help as I`m really new even to Python language as I have been seasoned with JAVA by far.
@Nicholas Renotte I'm getting this error --> module 'tensorflow' has no attribute 'gfile'. Moreover, I have installed so many libraries but got struck at Creating TF records. Could you please help me out and provide me the requirements and the versions of the library we have to install. Also the solution for the above problem I'm facing.
Hey! Thank you for this amazing tutorial, I'm trying to create a video conferencing project and want to include this as a feature, can you please guide me on how I can do that?
Hey there! I have issue with this "2. Create TF records" step. I am trying to run this and it is processing from a very long time without any output. Is there something I need to do ?
@@NicholasRenotte Heyy. Thanks for replying. I am processing around 1000 images . The error is stated as follows "AttributeError: module 'tensorflow' has no attribute 'gfile'". (version of tensorflow is 2.3.1)
@@NicholasRenotte Hii . I resolved the earlier issue . Now there's a new error "Message type "object_detection.protos.TrainConfig" has no field named "fine_tune_checkpoint_version"." and yeah if I print config, there is no such field.
Hi I'm glad I found your video! First of all, You are awesome man! Keep it up! I'm planning to do a similar project as a research proposal for a graduate school application and I was wondering how can I train my model if the sign language uses hand movements rather than still poses.
Heya Jan, you can use a slightly different architecture to do it! I've been researching it lately and it looks like there's already a model out there that handles it, check out Tiny Video Net: tfhub.dev/google/tiny_video_net/mobile_1/1
bro i try to executed train model i got this kind of notification 2021-05-08 07:39:03.490195: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
Thank you so much for this content, you saved me with my senior project- which is ASL alphabet recognition (turns out MATLAB is terrible for someone new to this field)... however, how can we implement this style detector for letters like "j" and "z" which require movement? I have seen many papers about combining lstm's with cnn's but it seems like everyone is keeping their cards close to their chest and their are no actual good tutorials on this matter... what are the chances of you doing one of these within the next month or so lol?
MICK JAGGER! Yah, definitely it's on the cards. I don't know if it'll be out within the next month but I've already got action detection down in the next set of tutorials!
Hi Nicholas. Thank you for this amazing video! How long did it take you to train this model? I'm going to train a model for detection about 10-15 gestures, but I also want to make train dataset for each gesture slightly bigger. If you remember the approximate amount of time I think I can roughly estimate how long the training session will take for me.
@@Dogcatcowrat what id suggest is copying the code from the Jupyter files into python files and run them from terminal using the command: python3.11 [filename].py you shouldn’t need to modify the code if all the dependencies are there and installed into python 3.11. Lmk how it goes. Although, for what I was planning on using this for I’ve just went the ultralytics YOLOv8 route.
Hello Nicholas, I'm having trouble when I want to "create TF records" it said "line 133, in load_labelmap with tf.gfile.GFile(path, 'r') as fid: AttributeError: module 'tensorflow' has no attribute 'gfile'" can you help me with this?
Hello Nicholas. I have all the steps in your other video and trained the model. Our images have taken and labeled then moved to train and test folders inside the images folder. The model can recognize some photos but when use the webcam the model unable to detect and recognize any of the signs. Could you please gives some recommendations? We have 500 images for each of our 7 signs but we use other sign language not yours.
Hello Nicholas, I hope you’re doing well❤️ I would like to thank you for your video that helped us alot💘. Now I’m actually in the training step, I tried to train the model in my laptop “which doesn’t have a GPU “ so it took 10 hours to train 20 photos. Is there a way or a device that I can buy that will make the training process faster in my laptop?
Heya @Haifa, you can try using an external GPU (eGPU) but these tend to be a little more expensive then just getting a basic gaming computer with a half decent GPU.
@@NicholasRenotte heyy, thankyou so much for the reply, here is my error Traceback (most recent call last): File "Tensorflow/scripts/generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util ModuleNotFoundError: No module named 'object_detection' Traceback (most recent call last): File "Tensorflow/scripts/generate_tfrecord.py", line 29, in from object_detection.utils import dataset_util, label_map_util ModuleNotFoundError: No module named 'object_detection'
@@NicholasRenotte Is there name length limit for object in detection model? like in label [ ] ,'I Love You'.. if not then we can have labels like 'Hello How are you there.'
Dear Nicholas, I would first like to thank you for showing us these amazing tutorials, they are nothing short of educational and fun. I came here asking for help though, if it is ok with you. I am developing a similar project to yours where the Object detector would figure out which technique in Judo it is observing. I am trying to run the project and I followed the tutorial to a T. I am able to train the model, but the loss value always starts at NaN (technically I am not able to train the model, but step 6 is within reach, because I can execute the command). I have gone through the comments and have done all the suggestions, which include: 1. Double checking the labels 2. Decrease the learning rate (although that is only viable if the loss value does not start at NaN) 3. Used 2 different datasets (1st is the Judo dataset, the other is the image dataset that was created, the same as yours). 4. Followed the installation to everything on your previous videos (Tensorflow installation + CUDA/CUDNN and Face mask detection tutorial) It would be greatly appreciated if you do end up helping me. But if not, this is still a very interesting video.
Hmmmm @Vamshi, is that the full error? If it's saying Python is not a recognised command this is normally due to Python not being installed or not being added to your Path.
i just want to ask. so before we do "Real Time Sign Language Detection with Tensorflow Object Detection and Python" we should do "Install Tensorflow Object Detection From Scratch in 5 Steps"? or anything else?
@@ariyasaccautama5934 try taking a look at the new tutorial, it does the same but I've tweaked a lot of the code to be more resilient, plus I show how to work through the errors in it: th-cam.com/video/yqkISICHH-U/w-d-xo.html
Hi! Is it possible for me to generate a *.pb file so that I can use it the way I'm used to? By specifying a config path and settings it to the *.pbtxt and the weightPath which would be *.pb?
Heya @BinaryBunny, should be possible, I actually walk through an example of saving a frozen graph and coverting to TFJS here: th-cam.com/video/ZTSRZt04JkY/w-d-xo.html I believe there are some other converters available as part of the ODAPI in the models folder!
Could anyone tell me why I executed the code in 23:20 but I got error ? I use Pycharm to do that is this impact the result ? And what is -x, -l, -o and !python ?
hello nick, I tried to do this project, but I have a problem at 8:06 where i have a error where " module 'cv2.cv2' has no attribute 'VideoCaptured' ". can you please help me with this.. i need to do this for my final year project
@@NicholasRenotte ohh ya, thank you. but after i run it, i have a error " OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-5rb_9df3\opencv\modules\imgcodecs\src\loadsave.cpp:753: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite' "
@@amirulaizadkhairulhasnan9934 can you try restarting your notebook. This error normally occurs because your camera hasn't been released from a previous run and is in accessible.
had a great learning though i got a lots of errors in the way but that make me go deep into subject and taking this from scratch is awesome and again expectinga a lot like these from your side nick
Hi i just tried this out using my own dataset that consist of Indonesian sign languages, it works flawlessly, my question is can you deploy the object detection models?, maybe from the checkpoint files etc?,
sir i am getting this error when i Create TF record, what should I do? File "Tensorflow/scripts/generate_tfrecord.py", line 27, in import tensorflow.compat.v1 as tf ModuleNotFoundError: No module named 'tensorflow
Hey There's no module named "object_detection.utils import dataset_util, label_map_util". It's showing as no file exist. What to do... I'm following exactly the same as you did!! But you get that both got trained...
Hi Nicholas, Thank you for the tutorial. I get a few errors when I try to train the model.I'm using the tensorflow version 2.3.1 and it gives me the error:module 'tensorflow' has no attribute 'contrib'. When I try downgrading to any version below 2 it gives the error: module 'tensorflow._api.v1.compat.v2.compat' has no attribute 'v1' Please I'll be soo much gratefull if you could provide an answer for this
Hey y'all! Wrote up a couple of steps to setup your environment. I'm planning on doing a video on this but until then, here's a crash course post:
1. First up install Python 3.7.4. Download and install the package for your OS that has the words 2019.07 in it from here repo.anaconda.com/archive/. This should give you 3.7.4 to work with.
2. Then install Visual Studio C++ 2015 from here: go.microsoft.com/fwlink/?LinkId=691126. Tensorflow needs this in order to compile
3. OPTIONAL IF YOU HAVE A GPU - Install Cuda and Cudnn. Install Cuda first, then install Cudnn.
- Cuda: 10.1 - developer.nvidia.com/cuda-10.1-download-archive-base
- Cudnn: 7.6.5 - developer.nvidia.com/rdp/cudnn-download
Once Cudnn is installed you need to copy the Cudnn files into their respective folders inside the Cuda directory. I used this as a guide: towardsdatascience.com/installing-tensorflow-with-cuda-cudnn-and-gpu-support-on-windows-10-60693e46e781
4. Then install Protoc 3.13 from here: github.com/protocolbuffers/protobuf/releases. For windows, download the repository and then add it to your PATH file.
5. Then install python packages using the pip command:
Tensorflow: 2.3.1 - pip install tensorflow==2.3.1
OpenCV: 4.4.0 - pip install tensorflow==4.4.0
6. Install the object detection API. To do this, run these commands from a command prompt or terminal:
git clone github.com/tensorflow/models
cd tensorflow/models/research
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
I have followed all these steps ..but still i am getting error as object _detection module not found...
What should i do.. Please help me out here!!
@@rashmigaikwad1116 Same here. Did you manage to solve it?
OpenCV: 4.4.0 - pip install tensorflow==4.4.0 (is this a Typo do you mean pip install opencv-python )? at step 5!
will this work with later versions of python?
@@kenneths9839 did you ever figure this out?
The most logical and understandable guide on the subject I have seen. Great job.
Thanks so much for your kind words @Alan 🙏!
dude. you. are. sick.
thank you man. keep pushing. you could really become something big. super high quality content.
cheers
Thanks so much @Sam 🙏!
Dear Nich Sir, I was a software engineer student, yesterday my results has come out and I got a first-class honor for my BSc degree, For the final project, I got 80 marks. My final project was Sign language detection in my language (Sinhala language). That project was kinda Advanced, but your sign language detection videos series inspired me to make a better project for my finals. So Thank you soo much and wanna say this, again and again, YOU ARE THE BEST AI TEACHER IN TH-cam, Keep making these kinda videos and make others' life brighter like this. I think you should pin this comment. ⭐⭐⭐
This is amazing news!! Congratulations!!!
@@NicholasRenotte Thank you Sir
@@irugal8964 hey how did you do it? I'm not able to use tensorflow. I'm error version error. What should I do? Please please help me🥺
@@sukanyadessai6238 th-cam.com/video/dZh_ps8gKgs/w-d-xo.html this is the video i followed and setup all correctly. Also for the data training i hv used colab.
hey i'm working on same project and got few errors can u help to solve it
I was looking for helpful vids on my project and this guy already did my project. Nice
Ayyyeee, glad you found it @David!
How do i contact you?
hey @davidskopalik9073 did you do this project i am facing some issue could you help me out i'll be grateful if you could
@@aankitaaa i mean it has been years not even sure if i have the files but i can try what's your issue
Can you please help me in executing the same project?
Wouaouhhhhh... Man, your amazing :) ...
This is what I was searching for after some months of Machine Learing study
🙏🙏🙏 thanks so much, glad you enjoyed it!
@@NicholasRenotte No, thanks to you with your awesome works, awesome technics, ...But could you make a video on how to save this model ? ( Save the mobel in tflite format, tf.js format for example?)
@@nyharenafitahiantsoaraheri3557 definitely, it's coming in the next couple of videos!!
@@NicholasRenotte Ouuuupiiiii ,,, can't wait to those videos :)
@@NicholasRenotte I have already test an object Detection project in flutter application that uses the SSD mobilenet and YOLO and if I am not wrong I think by changing just the .tflite model and the label.txt by this one, I think it will work because I think your model extends to SSD mobilenet
Finally a video that makes sense !!!
🤣 Oh I know where you're coming from, it was a nightmare coming up with the walkthrough for this. The content and documentation is haphazard as hell. I just need to make an installation video now!
@@NicholasRenotte True
Haha I bet it was laborious, by far thought this the best video in TH-cam that implements some sort of tracking hand gesture that makes sense all the way through lol
@@ypm7369 thanks so much 🙏 , it honestly means a lot you saying that!! I'm working on how to export the models and work with them in Tensorflow.JS apps right now...there's also sooo little documentation for how to do it properly.
@@basics7930 better documentation anyone 😅?! #amirite?
Excuse me, I want to ask. At 11:01 minutes, in the program to take pictures automatically, my program has no errors at all, looks good. The camera is detected successfully, the frame appears, and the frame can display the image from the camera. After the program finishes (camera off) a new directory appears, but none of the images are saved. What happened? May I know the explanation? Thank you before!
I had the same issue - I solved it by using this function here, just copy paste it into the cell where his one is and you should be fine:
# Loop through each label and collect images
for label in labels:
# Create directory for the label
label_dir = os.path.join(IMAGES_PATH, label)
os.makedirs(label_dir, exist_ok=True)
cap = cv2.VideoCapture(0)
print("Collecting images for {}".format(label))
time.sleep(5)
for imgnum in range(number_of_images):
ret, frame = cap.read()
if not ret:
print("Failed to capture image")
continue
# Generate unique filename
imagename = os.path.join(label_dir, "{}.{}.jpg".format(label, str(uuid.uuid1())))
cv2.imwrite(imagename, frame)
cv2.imshow("frame", frame)
time.sleep(2)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows()
First of all, thank you, sir, for this great content.
For those trying this in 2024, I want to say that this program can still be compiled. However, there are some version gaps and compatibility issues between Apple and Windows OS in the code. But don’t give up-keep going!
Much love from Sri Lanka! ❤️
How do you get the code to compile using tensorflow 2.xx?
Im having trouble with creating tf record rn.
@@kouki7099 do u know how to solve it ?
@@rimbang_ ive given up
For those who came here after seeing the Indian girl's post, yeah Priyanjali Gupta plagiarised this repo 😂
😂😂 exactly here for that
Exactly, am just arriving from threads
can i get a link please
But she has mentioned that she used his tutorial for making this model. I think she was just trying it out.
lol it doesn't matter who made it. It matters who used it the best
You are my Prof in python. Thank you so much for all, the codes you share, the video and the tutorial you gave to us. 👍
How do you not have more views? This is amazing content!
We're getting there @Joseph! Either way, a tonnnn more videos coming! I've got 285 tutorials left on my list to do (and it keeps growing each week) 🤣!
Please, solve me, SyntaxError: invalid syntax how to ?
Nick, you are amazing! All thanks to you for making a well organised video with soo much clarity 💥💥 .... I did my first deep learning project based on your teaching and safe to say that it was a HIT among my professors.... I look forward to make more of such projects... Thank you so much Prof. Nick .... You are the BEST⭐⭐⭐⭐⭐
@yonipaul6077 how did you train the model with tensorflow 2x??
✦
Building a real-time sign language detector using TensorFlow Object Detection and Python
00:04
Collecting images using python and opencv, labeling them using label image package
Building the sign language detector using transfer learning and tensorflow object detection api
✦
Leverage transfer learning, pre-processing, and training code.
01:46
Collect images using OpenCV and webcam for training.
Set up label image and label the images for sign language detection. Update checkpoints and execute training.
✦
Imported necessary dependencies for image collection and processing
05:15
Imported cv2, os, time, and uuid for image collection and file handling
Specified the path for storing collected images and defined the labels for sign language poses
✦
Setting up labels and collecting images
07:08
Labels are created to represent different poses for image collection
Code is written to loop through labels, create directories for each label, and capture images using webcam
✦
Collecting and labeling images for object detection with Real Time Sign Language Detection
10:38
Using the label image package to label images for object detection
Organizing images into folders for each label in the workspace for TensorFlow
✦
Setting up label image and labeling images using TensorFlow Object Detection
13:11
Setting up label image involves a few steps including organizing the images into a single directory and running the python command to start the labeling process.
Labeling the images is done using label image, where the image directory and save directory are specified before starting the labeling process.
✦
XML files contain all necessary information for object representation.
16:50
XML files include image folder, file name, path, source, size, and object details.
Data partitioning is crucial for training and testing the object detection model.
✦
Organizing images and annotations for training and testing
18:24
Selecting images for training and testing folders based on classes
Moving both images and xml annotations into the appropriate folders
✦
Creating label map and tf records for object detection using TensorFlow.
21:33
The label map file should be present in the annotation folder with different labels and IDs.
To simplify the generation of tf records, use the script 'generate tf record' included in the GitHub repository.
✦
Created tf record files for training and test data
23:06
Generated successfully the tf record files for both training and test data partitions
Updated label map and generated tf records, ready to proceed to training
✦
Updating configuration parameters for model training
26:11
Changing batch size and fine-tune checkpoint for faster training
Updating annotation path, tf records, and checkpoint type for detection
✦
Training the deep learning model using command prompt
27:42
The time taken for training depends on the available hardware, such as GPU
The process involves running a command in the terminal, and monitoring the loss metrics for successful training
✦
Real-time sign language detection using pre-built model and training process.
30:39
Real-time detection demonstrated with accurate recognition of signs like 'hello', 'I love you', 'thank you', and 'no'.
Images captured with OpenCV, labeled with label image, and model trained through pre-built Jupyter notebook.
this guy is awesome, hope to work with you one day Nicholas
Oh thanks so much man!! ✌🏽
Nick - Love your channel - Thanks for this video. I was still struggling after the "face mask" video. This one clarified a lot of the important points. It gave me a much better understanding of what is going on than just watching the first object detection video twice... ok ten times ;-) . Speed of training - I have an AMD RX 580 video card instead of NVidia so I'm stuck with training via my AMD 3700X CPU (or am I?). No hindrance to the learning experience of course, but if I had only known last year when I built up my systems... sigh. Thanks again, you are truly a terrific teacher!
Ohhhhhh I know the pain of getting the GPU to work. Yep, unfortunately at the moment only NVIDIA cards seem to dominate the deep learning space. I think there's work being done on the AMD cards but it's still a while away. SOOOOO pumped you got it all working though!!
@@NicholasRenotte Your videos are among the scarce few worth watching, so yeah!
What version of python, tensorflow and opencv are you using?
Heya, just updated the pinned post, all the install steps are there! These are the versions and source locations:
Python: 3.7.4 -
Windows: repo.anaconda.com/archive/Anaconda3-2019.07-Windows-x86_64.exe
Mac: repo.anaconda.com/archive/Anaconda3-2019.07-MacOSX-x86_64.sh
Linux: repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh
Tensorflow: 2.3.1 - pip install tensorflow==2.3.1
OpenCV: 4.4.0 - pip install tensorflow==4.4.0
Protoc 3.13 - github.com/protocolbuffers/protobuf/releases.
If using GPU
- Cuda: 10.1 - developer.nvidia.com/cuda-10.1-download-archive-base
- Cudnn: 7.6.5 - developer.nvidia.com/rdp/cudnn-download
in step 5 someone gave this error? 96 callable (pipeline_config_path)
97 with tf.io.gfile.GFile (pipeline_config_path, "r") as f:
98 proto_str = f.read ()
TypeError: 'module' object is not callable
Have you completed and executed this code? Because there are certain errors that I am getting and I need some help
I'm loving the contents of this channel!
Thank you so much @Zaheer!
This is really impressive! Can't wait to try it out.
I finally completed this project
Thanks Nick for your wonderful explanation
and super simple guide lines 👍
Amazing video
YESSSS! Amazing work @Ishmeet!
@IshmeetAhuja Can your help for this project. I got error during running the tutorial code.
@@shubhamnagalwade4642 can you tell exactly which step
@@ishmeetahuja9343 I got error during config file. When I run code config_util.get_configs_from_pipeline_file(CONFIG_PATH)
Error is:- Message type "object_detectio.protos.TrainConfig"
@@shubhamnagalwade4642 hmm, that's the full error? Sounds like the protoc step might not ahve been run during installation. Can you try running through this: th-cam.com/video/dZh_ps8gKgs/w-d-xo.html
This is lit 🔥 - keep it coming!
Oh you know it! A tonnn more stuff coming in this space @Tenzin!
thank you for this great video .I just have one question. this code just recognize every sign that we give to it. if we want to have a code with all sign to recognize every sentences and words , what should we do?
You have to train your model to detect the signs that you want. So, you could add in all of the additional words you'd like to have recognized as part of your image collection and labelling @samaneh.
I have this error when reading the config file config = config_util.get_configs_from_pipeline_file(CONFIG_PATH):
ParseError: 21:11 : Message type "object_detection.protos.Initializer" has no field named "random_normal_initializer".
Heya @Kays El Kadhi, which version of Tensorflow are you using?
Awesome tutorial, thanks man! 🙌
Can someone explain me how that labelling works at 13.15
Hey did u get it? Please can you share how to set up labelimg
Thank You so much for explaining the project code by code. I am facing a small issue. My TF records are not getting created. Do you have any idea why? I've gone through many videos of yours to understand where am I going wrong.
hey have u got solution for this?i'm getting same issue
@@prathi.editss I am stuck on the same issue.Do you know its solution now?
hey, were you able to solve it? I'm stuck on the same issue
Awesome tutorial. I am really glad that I found you!
I am constantly getting some random errors when trying to test the system. Currently, I am having Tensorflow 2.11 and python 3.7.8. Which version should I download ??
Just in time, I'm developing a project for my master's degree about this topic, thanks for the content
hey did you do this ?? i am facing some issuues could ou help me out?
This is amazing
Great content....Really helped me with one of the projects I was working on
Keep making videos like these
Plenty more coming @Rohil, sooo glad you enjoyed it!
@@NicholasRenotte please help me
Hey, I'm stuck at where you update labelmaps. When i run the code to create tfrecords, it shows an error
Traceback (most recent call last):
File "D:\RealTimeObjectDetection\Tensorflow\scripts\generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
File "C:\Users\amrit\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 21, in
from object_detection.protos import string_int_label_map_pb2
ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (C:\Users\amrit\anaconda3\lib\site-packages\object_detection\protos\__init__.py)
Traceback (most recent call last):
File "D:\RealTimeObjectDetection\Tensorflow\scripts\generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
File "C:\Users\amrit\anaconda3\lib\site-packages\object_detection\utils\label_map_util.py", line 21, in
from object_detection.protos import string_int_label_map_pb2
ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (C:\Users\amrit\anaconda3\lib\site-packages\object_detection\protos\__init__.py)
Please help as soon as possible and thanks in advance..
hey did you get resolved this issue?
you must install object detection API
here's some tools that maybe you weren't installed pip install tensorflow
pip install tf-slim
pip install Cython
pip install contextlib2
pip install jupyter
pip install matplotlib
pip install pandas
pip install pillow
pip install lxml
pip install opencv-python
pip install pycocotools
pip install tensorflow-object-detection-api
[Errno 2] No such file or directory: 'Tensorflow/workspace/annotations\\label_map.pbtxt'
I'm getting this error, can someone help me? (doing this on Collab, MacOS 10.15.3)
Heya @Siddaharth, try removing one of the slashes after annotations and flipping the other so you have:
Tensorflow/workspace/annotations/label_map.pbtxt'
@@NicholasRenotte
Would it matter if I did this in Collab instead of regular Jupyter notebook?
I'm getting another error when doing it in Collab.. (I've already installed object-detection through pip)
Traceback (most recent call last):
File "/content/generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
I'm really sorry for bothering you with this, I just am really thankful for your videos and time!
I'm always here to help, no stress@@sid4752. It should be relatively similar, that error is because the object detection API hasn't been installed, try running through the install video: th-cam.com/video/dZh_ps8gKgs/w-d-xo.html
you are definitely a best of the best in object detection man i need theses stuffd for NLP, ocr furthur image processing langchain and advanced gen ai too
23:15 when i run this cell i get cannot import name error
How do i fix this?
did you solve this?
Thanks for this amazing tutorial. I used it to train a model exactly as you did. Do you know what the best way to load the model I have trained into the C++ API of tensorflow? Thank you again!
Could try loading the checkpoints that were saved to C++. In theory it should work, although haven't try it out yet man.
Can you help me in solving the error no module named object_detection in crete tf
Thank you so much, sir! I wonder what if I train about 100 different signs and gestures? Should I alter the layers in that config file? How to deal with overfitting and underfitting problem?
Heya @Nigar, all you need to do is ensure you have examples of all 100 signs and gestures as part of your images, update your labelmap so you have them listed and change your number of classes to 100 in the config.
Salam Nigar. I am from Azerbaijan. Are you also doing the project for Azerbaijani sign language? If so, could you please contact me for cooperation in some points? I am doing the project.
Hey Nicholas, in my first run I trained my model to 12000 steps. There is still a relatively high loss (0.25). How can I alter the training command to retrain starting from my latest checkpoint?
Same here
Heya, try changing your checkpoint in your config, point the line below to the folder where your new checkpoints are located:
pipeline_config.train_config.fine_tune_checkpoint = PRETRAINED_MODEL_PATH+'/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/checkpoint/ckpt-0'
Should be something like, change it to the appropriate checkpoint number based on what you've got. Then rerun the same training command.
pipeline_config.train_config.fine_tune_checkpoint = CHECKPOINT_PATH +'ckpt-6'
Nicholas! I have solved all errors. Although it was not easy, all codes worked well . Thank you so much for upload this tutorial!
THIS IS AMAZINGGG to hear! Thanks so much for powering through! Deployment to RPi next?
Im having an error with cv2.imwrite. any tips? thank you
@@simonconneely1615 got some errors for me?
can you help me please
Do you got error like lable not defined
Amazing work Nicholas
Thanks so much @JohnDoe!
Thanks for the tutorial. Is 'Creating TF Records part' necessary? Because I have a problem. While Creating TF Records, I encounter with an error which says
File "Tensorflow/scripts/generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
I search this error and I write pip install tensorflow-object-detection-api in cmd. Then I encounter another error which says,
File "Tensorflow/scripts/generate_tfrecord.py", line 61, in label_map = label_map_util.load_labelmap(args.labels_path) File "C:\Python38\lib\site-packages\object_detection\utils\label_map_util.py", line 132, in load_labelmap with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Do you have any ide how to fix? Or should I pass this part?
The second bit can be solved by replacing references to tf.gfile with tf.io.gfile in the code that's erroring out.
@@NicholasRenotte I currently have the same error is tried the fix you suggested. Didn't work for me. Any more suggestions?
Thanks.
Great video. Appreciate your effort a lot! Two questions: If you would perform two gestures using both hands at the same time, would the model have detected both gestures at the same time? Is it possible to train for one class only? Best regards
Hi Raphael, in this case it would as I labelled images for each class using both hands. If I only used one hand per class e.g. right for hello, left for no, right for yes and trained for a while. Then there's an increased likelihood that it would only detect the class that matches the hand.
@@apnadekhtu How are you goin to train the model? For this the best is to use any dns to your routher like Open Dns Family Shield. Sorry for my poor english
Thanks for this amazing tutorial Nick. You explained everything so nicely.
A quick question, if I trained this model previously for 20 pictures of each class, and now I wish to increase the training dataset to around 50 pics. Will I have to retrain the model from scratch? (Cause on CPU, it took me around 5 hours to train for 20k steps!)
You don't have to but you need to tweak your code if you want to pick up from where you left off. If so, you need to freeze your model, export it, then update your pipeline.config file to pick up training from that checkpoint (fine_tune_checkpoint parameter in the pipeline.config file!)
@@NicholasRenotte Hi! Is there a way where I can see an example of this? We are trying to train an Hebrew Sign Language model thanks to your video :)
Hi I am also training the model on cpu since I don't have GPU. And 2500 steps were done in 2 hours! So should I continue or stop because my pc has become super slow...will it be ok to leave the pc overnight?
Hello, I am sorry for keep disturbing you, but I have no choice, i keep getting error, and this time I face the issue of this:
2021-03-22 20:54:24.030973: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
When I start to train my dataset, it stop on this line and do nothing for a long time, could you know about this issue??
Heya, does it eventually kick off the training? I don't believe this is an error but instead it's a warning.
@@NicholasRenotte it's okay i solved it, and could i know how to plot the loss graph from this model??
@@WeiQin-n9y yup, check this out: th-cam.com/video/-HbCA0WGbBg/w-d-xo.html
Your videos are so encouraging... 🙌🙌🙌
Thank you so much for this tutorial Nicholas ! One more thing I wanted to ask that is it possible to read out the phrases that gets recognized by the system? If yes, please do guide !
Planned!
you can use a tts library for python
@@JamilKhan-hk1wl Hey. I'm halfway through the project. Can you pls tell me how many nodes are being used in this Project? And about activation function, if possible. I would really appreciate your reply.
could you include the audio output in your project? if yes then can you tell me how you did it?
Sir, when i capture the images they are not showing in the collectedimage folder. Please help
Same problem!
Normally this is because the file path isn't fully defined. Do you have a folder called collectedimages (I think that's what I called it in the vid).
@@NicholasRenotte i did everything same, all label folders are created inside collectedimages but there's no image in there.
Please help sir!
Hi Nicholas. Thank you. Do you also have the final model that you trained with your images? I'd like to convert it to tflite and try it.
Heya @Luca, I don't have it saved anymore unfortunately. I've got this one available but it only detects hello (not trained for that long though): github.com/nicknochnack/TFODRPi/blob/main/detect.tflite
Thank you NIcholas! Can this run on Tensorflow lite to embedded in a smartphone?
Sure can! Check out the 5hr tutorial where I show how to run the conversion!
@@NicholasRenotte Thank you sir!
Really good explanation.. and real time experience is awesome.. thank a lot.. 👏
is it working model ?
Are you awesome. Greetings from Colombia.
Thanks so much @Juliam, what's happening from Sydney!
This tutorial is great. Love the explanation
So glad you enjoyed it @Dan Jay!
ValueError : 'images' must have either 3 or 4 dimensions
Why :/
In the comment below, you wrote that rerun cap.release (). But I tried it and it didn't work. I use colab :/
Pls help🤦🏻♀️
Ah, you can't capture the images using colab. It's not able to access your webcam through the notebook. Try capturing the images locally and then training on colab if you need to!
@@NicholasRenotte i already have a test train. Education etc. everything ok. I came to the end. The last code have such an error. Detection-opencv part. If I do it locally I have to go back to the beginning : /
@@meryy.3779 awesome, ah you don't, you just need to bring your checkpoints over to your pc and run it from there. There is a way to access your webcam from colab it just takes a little more work.
23:15 I am getting error on CREATE TF RECORDS part.
Error:-
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
What should I do sir?
Heya @Jignesh, try restarting your notebook and it should pick it up.
Hi Nicholas! Thank you so much!
I got this, please help:
error: OpenCV(4.4.0) /tmp/pip-req-build-dglzv4yn/opencv/modules/imgcodecs/src/loadsave.cpp:738: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'
Heya @Nigar, at what part of the code is this occuring? :)
@@NicholasRenotte I got the same error for the line cv2.imwrite(imgname,frame) (code shown in 8:58 of the video)
How do we resolve this error?
@@tumtum6910 heya, let's check a few things 😁.
1. What do you get if you print frame before the cv2.imwrite line
2. Is your webcam activating?
maybe could try to check for the "cap.release", it needs to be at outside the for loop
Hello Nicholas, I know you made this project long ago, but still I would really be glad if you let know what are the algorithms used here. Can we use other algorithms to this for its better accuracy and results like KNN, logistic regression or decision tree, if yes, please guide how. And last, how to generate the classification report here. Please help as I`m really new even to Python language as I have been seasoned with JAVA by far.
Who are here after that LinkedIn post ? 😂
mee :D
me too...lol
haha 🤣
@@MohanSinng vit full form?
😂😂
@Nicholas Renotte I'm getting this error --> module 'tensorflow' has no attribute 'gfile'.
Moreover, I have installed so many libraries but got struck at Creating TF records.
Could you please help me out and provide me the requirements and the versions of the library we have to install.
Also the solution for the above problem I'm facing.
Heya, try substituting out tf.gfile for tf.io.gfile and that should solve that error!
Can you make this in Tensorflow 2.0? Unfortunately, I have many problems adapting this to Tensorflow 2.
Greetings from Germany
Hey! Thank you for this amazing tutorial, I'm trying to create a video conferencing project and want to include this as a feature, can you please guide me on how I can do that?
Haven't dug into integration with VC tools that much unfortunately @Sunidhi.
hey Sunidhi, I am also working on the same project. Could we discuss?
@@dhivyarooparavi1108 Hey Yuktaa! Yes sure, pls let me know how I can get in touch with you!
Hey there! I have issue with this "2. Create TF records" step. I am trying to run this and it is processing from a very long time without any output. Is there something I need to do ?
Heya @Amrutha, are there any errors? How many images are you processing?
@@NicholasRenotte Heyy. Thanks for replying. I am processing around 1000 images . The error is stated as follows "AttributeError: module 'tensorflow' has no attribute 'gfile'". (version of tensorflow is 2.3.1)
@@amruthashetty3546 if you run pip list is tensorflow AND tensorflow-gpu 2.3.1?
@@NicholasRenotte Hii . I resolved the earlier issue . Now there's a new error "Message type "object_detection.protos.TrainConfig" has no field named "fine_tune_checkpoint_version"." and yeah if I print config, there is no such field.
@@NicholasRenotte I also have this issue. pip list shows I'm running version 2.4.1
Hi I'm glad I found your video! First of all, You are awesome man! Keep it up!
I'm planning to do a similar project as a research proposal for a graduate school application and I was wondering how can I train my model if the sign language uses hand movements rather than still poses.
Heya Jan, you can use a slightly different architecture to do it! I've been researching it lately and it looks like there's already a model out there that handles it, check out Tiny Video Net: tfhub.dev/google/tiny_video_net/mobile_1/1
Hi iam also searching sign language research topic urs dun research topic
bro i try to executed train model i got this kind of notification 2021-05-08 07:39:03.490195: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
Heya this is normally just for Information (indicated by the I just after the datestamp). Is the training hanging though?
I wanted to add more gestures for recognition. Do i have to clear out previously created libraries or will it work with my older gestures???
Yep, there's another way but it's a bit more of a pain.
@@NicholasRenotte thanks for the amazing video! ❤️❤️
@@jupjyotkhosla4640 anytime! Glad you enjoyed it!
Thank you so much for this content, you saved me with my senior project- which is ASL alphabet recognition (turns out MATLAB is terrible for someone new to this field)... however, how can we implement this style detector for letters like "j" and "z" which require movement? I have seen many papers about combining lstm's with cnn's but it seems like everyone is keeping their cards close to their chest and their are no actual good tutorials on this matter... what are the chances of you doing one of these within the next month or so lol?
MICK JAGGER! Yah, definitely it's on the cards. I don't know if it'll be out within the next month but I've already got action detection down in the next set of tutorials!
Hi Nicholas. Thank you for this amazing video! How long did it take you to train this model? I'm going to train a model for detection about 10-15 gestures, but I also want to make train dataset for each gesture slightly bigger. If you remember the approximate amount of time I think I can roughly estimate how long the training session will take for me.
I am doing the same thing, can you help me with this? please. That'd be very nice if you offer to help me.
@@tejeswanisenapathi2708 hello, did you do it?
Has anyone done this in 2024? i am super confused on what version of tensor flow to use, nothing seems to be compatable
Tensorflow 2.15.0 you will have to run it through python 3.11
@@heuixis so i should avoid anaconda ?
@@Dogcatcowrat I’ve never used anaconda. So I wouldn’t know.
So you don't need to change anything in code bro
@@Dogcatcowrat what id suggest is copying the code from the Jupyter files into python files and run them from terminal using the command: python3.11 [filename].py you shouldn’t need to modify the code if all the dependencies are there and installed into python 3.11. Lmk how it goes. Although, for what I was planning on using this for I’ve just went the ultralytics YOLOv8 route.
Hello Nicholas, I'm having trouble when I want to "create TF records" it said
"line 133, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'"
can you help me with this?
Hello!
Were you able to solve this?
Hello Nicholas. I have all the steps in your other video and trained the model. Our images have taken and labeled then moved to train and test folders inside the images folder. The model can recognize some photos but when use the webcam the model unable to detect and recognize any of the signs. Could you please gives some recommendations? We have 500 images for each of our 7 signs but we use other sign language not yours.
Hello Nicholas, I hope you’re doing well❤️
I would like to thank you for your video that helped us alot💘. Now I’m actually in the training step, I tried to train the model in my laptop “which doesn’t have a GPU “ so it took 10 hours to train 20 photos. Is there a way or a device that I can buy that will make the training process faster in my laptop?
Heyyyy, can you please help me with my project. I'm stuck at this place. If you could help me please.
Heya @Haifa, you can try using an external GPU (eGPU) but these tend to be a little more expensive then just getting a basic gaming computer with a half decent GPU.
Definitely, what's up @Anaa?
@@NicholasRenotte heyy, thankyou so much for the reply, here is my error
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
Traceback (most recent call last):
File "Tensorflow/scripts/generate_tfrecord.py", line 29, in
from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'
@@anaashaikh7342 this looks like the OD API hasn't been fully installed. Try running through this first: th-cam.com/video/dZh_ps8gKgs/w-d-xo.html
Hey!! Mr, can you make video on how to Deploy object detection model online, plz😇.. And love your content as always🤗🤗
Here you go th-cam.com/video/2dwSXXMFhPY/w-d-xo.html 🙂
@@NicholasRenotte Is there name length limit for object in detection model?
like in label [ ] ,'I Love You'..
if not then we can have labels like 'Hello How are you there.'
@@DhruvPatel-mg6ou I don't believe so, I think you should be fine to include longer labels!
@@NicholasRenotte thank you for the reply..
Frame (Not responding)
???
Hey one girl has copied your code 😂 she is getting more fame than this video literally she is 😂😂😂😂😂😂😂😂😂😂😂
Chutt bhai
Ikr 😂
Iykyk😂
Whoooo?
Dear Nicholas, I would first like to thank you for showing us these amazing tutorials, they are nothing short of educational and fun. I came here asking for help though, if it is ok with you. I am developing a similar project to yours where the Object detector would figure out which technique in Judo it is observing. I am trying to run the project and I followed the tutorial to a T. I am able to train the model, but the loss value always starts at NaN (technically I am not able to train the model, but step 6 is within reach, because I can execute the command). I have gone through the comments and have done all the suggestions, which include:
1. Double checking the labels
2. Decrease the learning rate (although that is only viable if the loss value does not start at NaN)
3. Used 2 different datasets (1st is the Judo dataset, the other is the image dataset that was created, the same as yours).
4. Followed the installation to everything on your previous videos (Tensorflow installation + CUDA/CUDNN and Face mask detection tutorial)
It would be greatly appreciated if you do end up helping me. But if not, this is still a very interesting video.
same issue bro if get the solution please tell me
awesome!!!!! too happy to learn
VIT wale full credit lekr marketing kr rhe. koi to roko unhe 😂
i was wondering why that girl is getting so famous 😂
exactlyyyy
Bro some girl has copied ur code and she is getting more fame than u.. I also came on ur video after seeing her video..
Really like your smile, Nicholas👍
When I try labelling that's at 14:28, it's showing python is not an internal or external part. What can I do now?
Hmmmm @Vamshi, is that the full error? If it's saying Python is not a recognised command this is normally due to Python not being installed or not being added to your Path.
Hello @NicholasRenotte Sir, Thanks for the amazing tutorial! I am glad that I found this savior tutorial last minute....Thankyou so much :)
Hi please someone help me asap.
Im getting an error
ModuleNotFoundError: no module named 'libs.resources'
at 14:17 when i give python labelimg.py
Can you check the generate_tfrecords? It's not working and showing errors
i just want to ask.
so before we do "Real Time Sign Language Detection with Tensorflow Object Detection and Python"
we should do "Install Tensorflow Object Detection From Scratch in 5 Steps"? or anything else?
Correct! Nope nothing else.
@@NicholasRenotte but i cant install tensorflow
When i ran :
python -m pip install
It becomes red lines in the end (error)
@@ariyasaccautama5934 try taking a look at the new tutorial, it does the same but I've tweaked a lot of the code to be more resilient, plus I show how to work through the errors in it: th-cam.com/video/yqkISICHH-U/w-d-xo.html
Excellent explanation... Thanks for sharing!
Hi! Is it possible for me to generate a *.pb file so that I can use it the way I'm used to? By specifying a config path and settings it to the *.pbtxt and the weightPath which would be *.pb?
Heya @BinaryBunny, should be possible, I actually walk through an example of saving a frozen graph and coverting to TFJS here: th-cam.com/video/ZTSRZt04JkY/w-d-xo.html I believe there are some other converters available as part of the ODAPI in the models folder!
Could anyone tell me why I executed the code in 23:20 but I got error ?
I use Pycharm to do that
is this impact the result ?
And what is -x, -l, -o and !python ?
What's the error @Tim?
please help me i'm facing problem of no module named object detection while creating tf records
hello nick, I tried to do this project, but I have a problem at 8:06 where i have a error where " module 'cv2.cv2' has no attribute 'VideoCaptured' ". can you please help me with this.. i need to do this for my final year project
Looks like that might be a typo @Amirul. It should be cv2.VideoCapture(0) not cv2.VideoCaptured(0).
@@NicholasRenotte ohh ya, thank you. but after i run it, i have a error " OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-5rb_9df3\opencv\modules\imgcodecs\src\loadsave.cpp:753: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite' "
@@amirulaizadkhairulhasnan9934 can you try restarting your notebook. This error normally occurs because your camera hasn't been released from a previous run and is in accessible.
had a great learning though i got a lots of errors in the way but that make me go deep into subject and taking this from scratch is awesome and again expectinga a lot like these from your side nick
How did you train the model with tensorflow 2x?
@@rajasrithiruvarasan3164 same ques bro.......having alots of error
Guys i need a help on how to create a labelimg folders at 13:14. I got struck at this part. pls help
Hi i just tried this out using my own dataset that consist of Indonesian sign languages, it works flawlessly, my question is can you deploy the object detection models?, maybe from the checkpoint files etc?,
Thank you so much for this wonderful tutorial
Can you help in solving the error no module named object_detection in creating tf record
sir i am getting this error when i Create TF record, what should I do?
File "Tensorflow/scripts/generate_tfrecord.py", line 27, in
import tensorflow.compat.v1 as tf
ModuleNotFoundError: No module named 'tensorflow
Try running !pip install tensorflow from within your notebook.
@@NicholasRenotte you are the best😎😎
Hi can we use the same tutorial if i already have images taken instead of taking them using opencv?
11:01 I am getting an error when running this code, it says OpenCV(4.9.0) error (-215: Assertion failed)
Hey
There's no module named "object_detection.utils import dataset_util, label_map_util". It's showing as no file exist. What to do... I'm following exactly the same as you did!!
But you get that both got trained...
Hey found any solution for this?
Section 4 of tutorial.pynb
'cp' is not recognized as an internal or external command,
operable program or batch file.
Help please!
I'm here! Change cp to copy and all / to \\ and you should be soaring!
Hey Nicholas, Can you please upload an video regarding the labelling part that you skipped....I tried watching the Git link. Im getting stucked.
Thanks my guy!
only after i started working on this that i realise how much effort it for this 30min video
hey i am facing some issues could you please help me
@@aankitaaa sure,i will try to help, what are the issues
Now. I am trying these and i get so many error in tutorial jupyter notebook file. Do you have any updated code
Hi Nicholas, Thank you for the tutorial. I get a few errors when I try to train the model.I'm using the tensorflow version 2.3.1 and it gives me the error:module 'tensorflow' has no attribute 'contrib'. When I try downgrading to any version below 2 it gives the error: module 'tensorflow._api.v1.compat.v2.compat' has no attribute 'v1'
Please I'll be soo much gratefull if you could provide an answer for this
Are you runnning with both tf and tf-gpu > 2.3.1
Yes. But its alright I started with your other tutorial on 'Sign language detection using Action Recognition' and it worked for me. Thank you:)
@@Archana-jb3pr No I still get the error:/
hey i got same error...can u help me to resolve it