Search code examples
pythonpython-2.7computer-visionyolo

BBox labeling tool


I am trying to train YOLOv2 on custom images and am following this link https://timebutt.github.io/static/how-to-train-yolov2-to-detect-custom-objects/

For annotating the objects I am using the BBox Labeling Tool. The above link asked me to change the directory in line 126 in the main.py file in BBox Labeling Tool folder. After I changed the line, the code looks like this.

s = r'../DATA/001/'

When I run the code and click 'load images' button I encouter the following error

File "C:\Users\user\Anaconda3\envs\yolo_training\lib\lib-tk\Tkinter.py", line 1541, in __call__
    return self.func(*args)
  File "main.py", line 127, in loadDir
    self.category = int(s)
ValueError: invalid literal for int() with base 10: ''

I created a virtual environment with anaconda with python 2.7 as the BBox labeling tool requires python 2.7.

I dont know what i am doing wrong. Please help me.

Thank you

PS: all the images in the 001 folder are jpeg files as this is also a requirement of the BBox-labeling tool


Solution

  • From what I understood this is supposed to be the path to the tool itself.

    s = r'D:\workspace\python\labelGUI'
    

    I don't see where in the instructions it asks you to change this path. This concerns the debugging I think. I advice you to restore the path as it was.

    In your case, you just need to create a folder called "00X" (X should be a number) inside the folder Images in the tool's directory, just like they show in the example. After you create the folder let's say "005" you put your images inside there. Before loading, choose the number 5 to specify your folder.