Different Values of Bounding Boxes for different classes.

I am working on matlab example of object detection using YOLO v3.
I am using multiple classes (vehicles: cars,bus,trucks,sedan etc).
There was written that :(Bounding boxes can not containing zeros/NaNs/Infs/empty), also the values of the bounding boxes should be finite, positive, non-fractional, non-NaN and should be within the image boundary with a positive height and width. So, say i am working with 5 classes. In an image, if there are two classes present, then it will give error for the bounding boxes of 3 other classes.
Can bounding boxes be just [0] for a class not present in an image. or is it an error ?
Can some one explain this?

 Accepted Answer

I don't think so. If the bounding box was [0], it would not even have produced that bounding box in the first place.

9 Comments

Thankyou for answering. I can't understand clearly. Dear sir, i loaded dataset of images in image labeller app. Started labelling 6 classes. So, in an image not all classes are present.So for lets say image 0, pedestrian,bicycle,motorcycle,work_van,motorized_vehicle has bbox=[] , so according to example these bboxes will be considered invalid. Will they consider invalid ? Or are they okay ?
They are invalid. Bounding boxes are only returned for the particular class if it thinks an object of that class exists in the image. All other bounding boxes will be null/empty.
Okay sir, so the bounding boxes value can be null/empty ? Its not invalid.
But sir, the site(matlab example) says.
Use validateInputData to detect invalid images, bounding boxes or labels i.e.,
  • Samples with invalid image format or containing NaNs
  • Bounding boxes containing zeros/NaNs/Infs/empty
  • Missing/non-categorical labels.
Depends on your definition of invalid. Here we take it to mean that the bounding box is not a real bounding box because there is no such object of that class in the image so there can be no bounding box for it. So, since the table must have something in that location, it sets the array to empty for that location. Empty (null) is a valid state for a cell in a table or cell array to have. They can legally have that value. Now whether ismissing(), fillmissing(), or validateInputData() would flag those cells as different is just something you'd have to try and see. It looks like validateInputData() considers them invalid. So having an empty array is a valid condition but an empty array is not a valid bounding box.
Thankyou so much for you kind responses. So bounding box values=[] are okay of cell array to have to show no real bounding box. We can proceed further because this is an accepted form.
Also can we use these values for training a network just to confirm as you said, empty(null) value [] is valid state, will it work properly for training purposes ?
Also can you please comment here why this error occurs, i have encountered similar problems. What can be the reason of the error as shown in website?
Error using vision.internal.cnn.validation.checkTrainingBoxes (line 12)
Training data from a read of the input datastore contains invalid bounding boxes. Bounding boxes must be non-empty, fully contained within their associated image and must have positive width and height. Use datastore transform method and remove invalid bounding boxes..
I don't know exactly how you're generating the table and how you're passing the table to the training software, but evidently you can only pass in a bounding box that is not empty, so make sure that is the case.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!