Search code examples
tensorflow-lite

Adding images with no bounding box to tflite model maker object detection dataset


I want to add images without any bounding boxes to the dataset used to train an object detector using tflite model maker.

According to the docs I can add

one row for each image with no bounding box (such as row 4 below).

 TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,,
 TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,,
 UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3
 TEST,gs://folder/im3.png,,,,,,,,,

When doing so I am getting a ValueError "could not convert string to float", which is caused by an attempt to cast the None object to a float in the following line:

    xmin, ymin = float(line[3]) * width, float(line[4]) * height

Does anyone know how to properly add such images without bounding boxes? Are these empty images even helpful towards training the model?


Solution

  • Model Maker doesn't support images without any bounding boxes. Neither will the images used in the training. Thus Please avoid such data.