Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

num_classes=8 creates off-by-one error with number of predictions #5

Open
villanuevab opened this issue May 3, 2017 · 1 comment
Open

Comments

@villanuevab
Copy link

Thanks for this implementation. In ssd_common.py using default params we have num_classes=8; this is consistent with what is in datasets/kitti*. I understand why no_annotations_label=9, and think I see that these labels > num_classes are handled in tf_bboxes_filter_labels. However, in ssd_common.py we have:

# Predictions, removing first void class.
sub_predictions = predictions_layer[:, :, 1:]
idxes = np.where(sub_predictions > threshold)
classes = idxes[-1]+1
scores = sub_predictions[idxes]

Does this cause an off-by-one error? I understand that the 0th index represents 'none': (0, 'Background'), but in this case should we have specified num_classes=9? Otherwise we do not consider the 'misc' class for KITTI ('Misc': (8, 'Misc'), since label < num_classes is false in this case)?

Given we have num_cls_pred = num_anchors * num_classes predictions (see ssd_vgg_300.py), this means that if num_classes=8 then subpredictions would only consider 7 classes. Is this correct?

@villanuevab villanuevab changed the title num_classes=8 would result in ignoring misc class? num_classes=8 creates off-by-one error with number of predictions May 3, 2017
@xinyugaotudelft
Copy link

Hi Blanca,

Interesting question! May I ask how did you solve this in the end?

Much thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants