Skip to content

Commit

Permalink
Fix how tcn test considers total num classes automatically
Browse files Browse the repository at this point in the history
Some detection inputs have "missing" categories due to their being
skipped during detection inference. This creates a discrepancy between
quantity of listed categories vs category IDs that can be listed.
Instead consider the max category ID + 1, on the assumption that
category IDs start at 0, which is a strong assumption due to considering
category IDs as the index of prediction outputs to which that category
applies.
  • Loading branch information
Purg committed Dec 18, 2024
1 parent d8015c5 commit edba78c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcn_hpl/data/tcn_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def test_dataset_for_input(
# TODO: Some method of configuring which vectorizer to use.
from tcn_hpl.data.vectorize.locs_and_confs import LocsAndConfs

num_object_classes = len(dets_coco.cats)
num_object_classes = max(dets_coco.cats) + 1
vectorize = LocsAndConfs(
top_k=1,
num_classes=num_object_classes,
Expand Down

0 comments on commit edba78c

Please sign in to comment.