How to Create a Custom Object Detector with TensorFlow in 2020




[ad_1]

Hey guys welcome back, Ben again! Today we are continuing the project we left off on last time. This time we are learning to detect custom objects using TensorFlow’s Object Detection API. This video goes over installing LabelImg for creating our labels, generating csv files, and creating TFrecord files. The next video in this series will be training our custom model and testing it.

How to Train a Custom Model: https://youtu.be/_gGI91BmIdk

Commands:
 python generate_tfrecord.py –csv_input=data/test_labels.csv –output_path=data/test.record –image_dir=images/
 python generate_tfrecord.py –csv_input=data/train_labels.csv –output_path=data/train.record –image_dir=images/

Useful Links:
My GitHub: https://github.com/Bengemon825/TF_Object_Detection2020
LabelImg: https://github.com/tzutalin/labelImg
datitran’s GitHub with raw files: https://github.com/datitran/raccoon_dataset
Fatkun Batch Downloader: https://chrome.google.com/webstore/detail/fatkun-batch-download-ima/nnjjahlikiabnchcpehcpkdeckfgnohf?hl=en
sentdex’s YouTube: https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ

Source


[ad_2]

Comment List

  • Lazy Tech
    November 15, 2020

    Hey Ben, thanks for the video. Could you release the step by step document?

  • Lazy Tech
    November 15, 2020

    Please zoom your screen otherwise there is no point uploading this video.

  • Lazy Tech
    November 15, 2020

    Nice video, suscribed

  • Lazy Tech
    November 15, 2020

    Thank You Bro. That was very Helpful.👍👍 Ur a gr8 Teacher.😎😎

  • Lazy Tech
    November 15, 2020

    Hi! Cool tutorial. I do however get the following error when I want to label the second image:
    Traceback (most recent call last):

    File "labelImg.py", line 1355, in openNextImg

    self.loadFile(filename)

    File "labelImg.py", line 1096, in loadFile

    self.showBoundingBoxFromAnnotationFile(filePath)

    File "labelImg.py", line 1114, in showBoundingBoxFromAnnotationFile

    filedir = filePath.split(basename)[0].split("/")[-2:-1][0]

    IndexError: list index out of range

    Any possible help?

  • Lazy Tech
    November 15, 2020

    I cannot run the final code
    File "generate_tfrecord.py", line 24, in <module>

    from object_detection.utils import dataset_util

    ModuleNotFoundError: No module named 'object_detection'

    what should i do?

  • Lazy Tech
    November 15, 2020

    zoom, please

  • Lazy Tech
    November 15, 2020

    Hey! What if I got my data set pictures from my own camera and not the web. Would I still need the xml to cvs step?

  • Lazy Tech
    November 15, 2020

    Hey bro im getting an error after this command even if im in the correct directory :
    pyrcc5 -o libs/resources.py resources.qrc

    it says :
    'C:/Users/Rahul' is not recognized as an internal or external command,

    operable program or batch file.

    please help

  • Lazy Tech
    November 15, 2020

    getting some pandas error in generate_tfrecord.py...can nyone help or can you tell how to execute that generate_tfrecord.py file in google colab….
    please can anyone help?

  • Lazy Tech
    November 15, 2020

    bota mais empenho meu

  • Lazy Tech
    November 15, 2020
  • Lazy Tech
    November 15, 2020

    Hey Ben can you share the research paper pls..

  • Lazy Tech
    November 15, 2020

    if anyone's getting the error image not found or no such directory use this
    python generate_tfrecord.py –csv_input=data/train_labels.csv –output_path=data/train.record –image_dir=images/train
    and similarly for test

  • Lazy Tech
    November 15, 2020

    ты крут

  • Lazy Tech
    November 15, 2020

    Hey guys! When I run python xml_to_csv.py, it doesn't show anything inside in test_label.csv(There are pictures in the test folder btw). Also, it is written only in column A in train_label.csv. How can i solve all these?

  • Lazy Tech
    November 15, 2020

    Awesome but whats the website to download that bulk pics

  • Lazy Tech
    November 15, 2020

    2020-08-21 12:59:35.290432: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found

    2020-08-21 12:59:35.312836: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

    WARNING:tensorflow:From generate_tfrecord.py:108: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

    WARNING:tensorflow:From generate_tfrecord.py:94: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.

    W0821 13:01:51.289680 12848 module_wrapper.py:139] From generate_tfrecord.py:94: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.

    Traceback (most recent call last):

    File "generate_tfrecord.py", line 108, in <module>

    tf.app.run()

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagestensorflow_corepythonplatformapp.py", line 40, in run

    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagesabslapp.py", line 300, in run

    _run_main(main, args)

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagesabslapp.py", line 251, in _run_main

    sys.exit(main(argv))

    File "generate_tfrecord.py", line 97, in main

    grouped = split(examples, 'filename')

    File "generate_tfrecord.py", line 48, in split

    gb = df.groupby(group)

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagespandascoreframe.py", line 6514, in groupby

    dropna=dropna,

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagespandascoregroupbygroupby.py", line 533, in _init_

    dropna=self.dropna,

    File "C:Userspooja nairAppDataLocalProgramsPythonPython37libsite-packagespandascoregroupbygrouper.py", line 777, in get_grouper

    raise KeyError(gpr)

    getting these error I am using python 3.7 Tensorflow 1.15 and did everything mentioned ………..could you please help me.

  • Lazy Tech
    November 15, 2020

    hey dude! Am getting the error – "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa8 in position 11: invalid start byte" again and again. I tried everything possible . Help me out!

  • Lazy Tech
    November 15, 2020

    Nice work man

  • Lazy Tech
    November 15, 2020

    Hey great job Ben nice videos !
    If someone gets the tensorflow module errror it seems like the versions of tensorflow dont work together so try to change the line inside files
    import tensorflow as tf to import tensorflow.compat.v1 as tf and it will work

  • Lazy Tech
    November 15, 2020

    can you make a vid for tf 2.0

  • Lazy Tech
    November 15, 2020

    bro upload marks folder so we can test the training !

  • Lazy Tech
    November 15, 2020

    Hey Ben, I am not able to resolve this error can you please help me out with this. Here's the error I keep getting:
    NewRandomAccessFile failed to Create/Open: C:UsersAvinashDocumentsCodes and DataSetsDeep Learningtf_object_detection_custom_datasetimages/img (112).jpg

    : The system cannot find the file specified.

    ; No such file or directory

  • Lazy Tech
    November 15, 2020

    Hey Ben, these videos are exactly what I was looking for. Are you going to do the training in colab or locally? Im trying to make it work with colab and google drive, but since I cannot just execute the model_main_tf2.py, I tried running it in an .ipynb within the object detection folder with

    !python "//content//gdrive//My Drive//models-master//research//object_detection/model_main_tf2.py"

    –pipeline_config_path= {pipeline.config}

    –model_dir={training}

    –alsologtostderr

    –num_train_steps=1

    –num_eval_steps=1

    ,which does not work as there are a lot of problems with the paths.

    It would be great if you would show how to implement the training online and I cannot wait for the next part of the series!

  • Lazy Tech
    November 15, 2020

    Great work, thanks.
    Is possible to convert this custom model in Tensorflow Lite (runnable on Android device)?

  • Lazy Tech
    November 15, 2020

    Great work bro!!

  • Lazy Tech
    November 15, 2020

    Good work, my man(like Denzel says it).When is the next part coming out?. And can u explain the main code in the next part line by line perhaps?
    Other tensorflow tutorials(by other creators) are convoluted for me, thanks.

  • Lazy Tech
    November 15, 2020

    Thanks for the video, great work!

Write a comment