TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 | TensorFlow Object Detection Classifier for multiple object | Machine Learning library

 by   EdjeElectronics Python Version: Current License: Apache-2.0

kandi X-RAY | TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 Summary

kandi X-RAY | TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 Summary

TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 is a Python library typically used in Telecommunications, Media, Media, Entertainment, Artificial Intelligence, Machine Learning, Deep Learning, Tensorflow applications. TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. However TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 build file is not available. You can download it from GitHub.

The purpose of this tutorial is to explain how to train your own convolutional neural network object detection classifier for multiple objects, starting from scratch. At the end of this tutorial, you will have a program that can identify and draw boxes around specific objects in pictures, videos, or in a webcam feed. There are several good tutorials available for how to use TensorFlow’s Object Detection API to train a classifier for a single object. However, these usually assume you are using a Linux operating system. If you’re like me, you might be a little hesitant to install Linux on your high-powered gaming PC that has the sweet graphics card you’re using to train a classifier. The Object Detection API seems to have been developed on a Linux-based OS. To set up TensorFlow to train a model on Windows, there are several workarounds that need to be used in place of commands that would work fine on Linux. Also, this tutorial provides instructions for training a classifier that can detect multiple objects, not just one. The tutorial is written for Windows 10, and it will also work for Windows 7 and 8. The general procedure can also be used for Linux operating systems, but file paths and package installation commands will need to change accordingly. I used TensorFlow-GPU v1.5 while writing the initial version of this tutorial, but it will likely work for future versions of TensorFlow. TensorFlow-GPU allows your PC to use the video card to provide extra processing power while training, so it will be used for this tutorial. In my experience, using TensorFlow-GPU instead of regular TensorFlow reduces training time by a factor of about 8 (3 hours to train instead of 24 hours). The CPU-only version of TensorFlow can also be used for this tutorial, but it will take longer. If you use CPU-only TensorFlow, you do not need to install CUDA and cuDNN in Step 1.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 has a medium active ecosystem.
              It has 2859 star(s) with 1307 fork(s). There are 86 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 400 open issues and 158 have been closed. On average issues are closed in 130 days. There are 13 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 is current.

            kandi-Quality Quality

              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 has 0 bugs and 0 code smells.

            kandi-Security Security

              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 releases are not available. You will need to build from source code and install.
              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions, examples and code snippets are available.
              TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 saves you 6472 person hours of effort in developing the same functionality from scratch.
              It has 13455 lines of code, 6 functions and 370 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 and discovered the below as its top functions. This is intended to give you an instant insight into TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 implemented functionality, and help decide if they suit your requirements.
            • Create a tf example
            • Convert a class label text to an integer
            • Convert xml file to csv
            • Split a Pandas DataFrame
            Get all kandi verified functions for this library.

            TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 Key Features

            No Key Features are available at this moment for TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10.

            TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 Examples and Code Snippets

            copy iconCopy
             object_name = labels[int(classes[i])] # Look up object name from "labels" array using class index
             if object_name == 'person':
            
            #see what the difference in centroids is after every x frames to determine direction of movement and tally up total numbe  

            Community Discussions

            QUESTION

            AttributeError: module 'object_detection.protos.faster_rcnn_pb2' has no attribute 'AttentionPosition' - upon resuming training
            Asked 2022-Feb-13 at 12:52

            I am following this tutorial https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10.

            System - Windows 10, Anaconda Prompt, Python 3.6, tensorflow 1.15.0

            Initial setup and training are successful. Upon pausing the training and resuming I get the error message from the title. Any help would be greatly appreciated.

            ...

            ANSWER

            Answered 2022-Feb-13 at 12:52

            I realized that every time I reenter the environment from the anaconda prompt I should reset the python path. This solved the problem:

            set PYTHONPATH=C:\tensorflow1\models;C:\tensorflow1\models\research;C:\tensorflow1\models\research\slim

            Source https://stackoverflow.com/questions/71079477

            QUESTION

            What is the input size of the image to CNN when performing object detection with the model created by Tensorflow Object Detection API?
            Asked 2021-Jan-21 at 06:43

            I used the Tensorflow Object Detection API (TF1) and created a file of frozen_inference_graph.pb of Faster R-CNN. After that, I was able to apply object detection to the image using "Object_detection_image.py" in the GitHub repository below.

            EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

            When I use this code, how large is the input size of images to Faster R-CNN? I set both "min_dimension" and "max_dimension" of "image_resizer {" in the config file to 768. When I perform object detection, is the input size of images to Faster R-CNN automatically resized to this size? The size of my images I prepared is 1920 x 1080 pixels, and I think it has been resized to 768 x 768 pixels.

            If anyone knows about this, please let me know.

            Thank you!

            ...

            ANSWER

            Answered 2021-Jan-21 at 06:43

            Assuming you're using Object_detection_image.py you can modify the code to print out the size of image being used:

            Source https://stackoverflow.com/questions/65814474

            QUESTION

            protoc "tried to write file twice"
            Asked 2020-Jun-29 at 22:01

            I'm was to follow this https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 . I realized part way through that I was running into problems because not all of my files in the protos folder were converted to python files? So i tried to do each file separately again.

            this is what i put into command prompt. it's telling me "tried to write file twice". and in the folder there is still no center_net_pb2.py file.

            ...

            ANSWER

            Answered 2020-Jun-29 at 22:01

            You have included the input file name twice:

            Source https://stackoverflow.com/questions/62646662

            QUESTION

            Improving a pre-trained tensorflow object detection model
            Asked 2020-May-17 at 12:11

            I want to use tensorflow for detecting cars in an embedded system, so I tried ssd_mobilenet_v2 and it actually did pretty well for me, except for some specific car types which are not very common and I think that is why the model does not recognize them. I have a dataset of these cases and I want to improve the model by fine-tuning it. I should also note that I need a .tflite file because I'm using tflite_runtime in python. I followed these instructions https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 and I could train the model and reached a reasonable loss value. I then used export_tflite_ssd_graph.py in the object detection API to build inference_graph from the trained model. Afterwards I used toco tool to build a .tflite file out of it.

            But here is the problem, after I've done all that; not only the model did not improve, but now it does not detect any cars. I got confused and do not know what is the problem, I searched a lot and did not find any tutorial about doing what I need to do. They just added a new object to a model and then exported it, which I tried and I was successful doing that. I also tried to build a .tflite file without training the model and directly from the Tensorflow detection model zoo and it worked fine. So I think the problem has something to do with the training process. Maybe I am missing something there.

            Another thing that I did not find in documents is that whether is it possible to "add" a class to the current classes of an object detection model. For example, let's assume the mobilenet ssd v2 detects 90 different object classes, I would like to add another class so that the model detects 91 different classes instead of 90 classes. As far as I understand and tested after doing transfer learning using object detection API, I could only detect the objects that I had in my dataset and the old classes will be gone. So how do I do what I explained?

            ...

            ANSWER

            Answered 2020-May-17 at 12:11

            I found out that there is no way to 'add' a class to the previously trained classes but with providing a little amount of data of that class you can have your model detect it. The reason is that the last layer of the model changes when transfer learning is applied. In my case I labeled around 3k frames containing about 12k objects because my frames would be complicated. But for simpler tasks as I saw in tutorials 200-300 annotated images would be enough.

            And for the part that the model did not detect anything it has something to do with the convert command that I used. I should have used tflite_convert instead of toco. I explained more here.

            Source https://stackoverflow.com/questions/61304977

            QUESTION

            How to convert tflite_graph.pb to detect.tflite properly
            Asked 2020-May-17 at 12:08

            I am using tensorflow object-detection api for training a custom model using ssdlite_mobilenet_v2_coco_2018_05_09 from tensorflow model zoo.

            I successfully trained the model and test it out using a script provided in this tutorial.

            Here is the problem, I need a detect.tflite to use it in my target machine (an embedded system). But when I actually make a tflite out of my model, it outputs almost nothing and when it does, its a wrong detection. To make the .tflite file, I first used export_tflite_ssd_graph.py and then toco on the output with this command by following the doc and some google searches:

            toco --graph_def_file=$OUTPUT_DIR/tflite_graph.pb --output_file=$OUTPUT_DIR/detect.tflite --input_shapes=1,300,300,3 --input_arrays=normalized_input_image_tensor --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' --allow_custom_ops

            Also, the code I'm using for detection task from .tflite is working properly, as I tested it with ssd_mobilenet_v3_small_coco detect.tflite file.

            ...

            ANSWER

            Answered 2020-May-17 at 12:08

            The problem was with the toco command. Some documents that I used were outdated and mislead me. toco is deprecated and I should have used tflite_convert tool instead.

            Here is the full command I used (run from your training directory):

            tflite_convert --graph_def_file tflite_inference_graph/tflite_graph.pb --output_file=./detect.tflite --output_format=TFLITE --input_shapes=1,300,300,3 --input_arrays=normalized_input_image_tensor --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' --inference_type=QUANTIZED_UINT8 --mean_values=128 --std_dev_values=127 --change_concat_input_ranges=false --allow_custom_ops

            I did the training on ssdlite_mobilenet_v2_coco_2018_05_09 model and added this at the end of my .config file.

            Source https://stackoverflow.com/questions/61749548

            QUESTION

            how to get the coordinate? (tensorflow label model object detection)
            Asked 2020-Apr-27 at 11:32

            HI all could someone please help me?

            I want to know the rectangle coordinate

            (left up and right dow) I reference this https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/blob/master/Object_detection_webcam.py

            is it need to use the 'boxes'? and how let tensorflow know which is the rectangle coordinate?

            is the following right? and is it need to be int? x_left = 1280*(np.squeeze(boxes[0,0,1]))

            y_left = 640 *(np.squeeze(boxes[0,0,0]))

            x_right = 1280*(np.squeeze(boxes[0,0,3]))

            y_right = 640 *(np.squeeze(boxes[0,0,2])) ------------------------------------------------------------------is it need to be int?

            x_left = int(round(x_left))

            y_left = int(round(y_left))

            x_right= int(round(x_right))

            y_right= #int(round(y_right))

            enter image description here

            enter image description here

            enter image description here

            enter image description here

            enter image description here

            ...

            ANSWER

            Answered 2020-Apr-27 at 11:32

            boxes is an array of normalized coordinates. The length of the boxes array is equal to the number of detection. For index i,

            Source https://stackoverflow.com/questions/61451464

            QUESTION

            Python to ML.NET Custom Object Detection in image
            Asked 2020-Feb-07 at 10:06

            I trained a custom model that can find custom objects in the image. I used a terrific article

            Many thanks to Evan EdjeElectronics.

            This python code works fine:

            ...

            ANSWER

            Answered 2020-Feb-07 at 10:06

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

            Anaconda is a software toolkit that creates virtual Python environments so you can install and use Python libraries without worrying about creating version conflicts with existing installations. Anaconda works well on Windows, and enables you to use many Python libraries that normally would only work on a Linux system. It provides a simple method for installing TensorFlow (which we'll do in Step 2d). It also automatically installs the CUDA and cuDNN versions you need for using TensorFlow on a GPU. Download Anaconda for Windows from their webpage (you have to scroll down a ways to get to the download links). Once it's downloaded, execute the installer file and work through the installation steps. If you are using a version of TensorFlow older than TF v1.13, make sure you use the CUDA and cuDNN versions that are compatible with the TensorFlow version you are using. Here is a table showing which version of TensorFlow requires which versions of CUDA and cuDNN. Anaconda will automatically install the correct version of CUDA and cuDNN for the version of TensorFlow you are using, so you shouldn't have to worry about this.
            The TensorFlow Object Detection API requires using the specific directory structure provided in its GitHub repository. It also requires several additional Python packages, specific additions to the PATH and PYTHONPATH variables, and a few extra setup commands to get everything set up to run or train an object detection model. This portion of the tutorial goes over the full set up required. It is fairly meticulous, but follow the instructions closely, because improper setup can cause unwieldy errors down the road. Create a folder directly in C: and name it “tensorflow1”. This working directory will contain the full TensorFlow object detection framework, as well as your training images, training data, trained classifier, configuration files, and everything else needed for the object detection classifier. Download the full TensorFlow object detection repository located at https://github.com/tensorflow/models by clicking the “Clone or Download” button and downloading the zip file. Open the downloaded zip file and extract the “models-master” folder directly into the C:\tensorflow1 directory you just created. Rename “models-master” to just “models”. If you are using an older version of TensorFlow, here is a table showing which GitHub commit of the repository you should use. I generated this by going to the release branches for the models repository and getting the commit before the last commit for the branch. (They remove the research folder as the last commit before they create the official version release.). This tutorial was originally done using TensorFlow v1.5 and this GitHub commit of the TensorFlow Object Detection API. If portions of this tutorial do not work, it may be necessary to install TensorFlow v1.5 and use this exact commit rather than the most up-to-date version. TensorFlow provides several object detection models (pre-trained classifiers with specific neural network architectures) in its model zoo. Some models (such as the SSD-MobileNet model) have an architecture that allows for faster detection but with less accuracy, while some models (such as the Faster-RCNN model) give slower detection but with more accuracy. I initially started with the SSD-MobileNet-V1 model, but it didn’t do a very good job identifying the cards in my images. I re-trained my detector on the Faster-RCNN-Inception-V2 model, and the detection worked considerably better, but with a noticeably slower speed. You can choose which model to train your objection detection classifier on. If you are planning on using the object detector on a device with low computational power (such as a smart phone or Raspberry Pi), use the SDD-MobileNet model. If you will be running your detector on a decently powered laptop or desktop PC, use one of the RCNN models. This tutorial will use the Faster-RCNN-Inception-V2 model. Download the model here. Open the downloaded faster_rcnn_inception_v2_coco_2018_01_28.tar.gz file with a file archiver such as WinZip or 7-Zip and extract the faster_rcnn_inception_v2_coco_2018_01_28 folder to the C:\tensorflow1\models\research\object_detection folder. (Note: The model date and version will likely change in the future, but it should still work with this tutorial.). Download the full repository located on this page (scroll to the top and click Clone or Download) and extract all the contents directly into the C:\tensorflow1\models\research\object_detection directory. (You can overwrite the existing "README.md" file.) This establishes a specific directory structure that will be used for the rest of the tutorial.
            All files in \object_detection\images\train and \object_detection\images\test
            The “test_labels.csv” and “train_labels.csv” files in \object_detection\images
            All files in \object_detection\training
            All files in \object_detection\inference_graph

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10.git

          • CLI

            gh repo clone EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

          • sshUrl

            git@github.com:EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link