Skip to content

Commit

Permalink
Specify num_classes = 2 for my custom dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
woctezuma committed Aug 21, 2022
1 parent 92a9c8e commit c08ccbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ def build(args):
# for panoptic, we just add a num_classes that is large enough to hold
# max_obj_id + 1, but the exact value doesn't really matter
num_classes = 250
if args.dataset_file == 'custom':
# "You should always use num_classes = max_id + 1 where max_id is the highest class ID that you have in your dataset."
# Reference: https://github.com/facebookresearch/detr/issues/108#issuecomment-650269223
num_classes = 2
device = torch.device(args.device)

backbone = build_backbone(args)
Expand Down

0 comments on commit c08ccbc

Please sign in to comment.