@@ -352,7 +352,7 @@ def _validate_gt_annotations(self):
352
352
353
353
if (
354
354
excluded_gt_info .excluded_count
355
- > excluded_gt_info .total_count * self .max_discarded_threshold
355
+ > ceil ( excluded_gt_info .total_count * self .max_discarded_threshold )
356
356
):
357
357
raise TooFewSamples (
358
358
"Too many GT boxes discarded, canceling job creation. Errors: {}" .format (
@@ -512,7 +512,7 @@ def _validate_skeleton(skeleton: dm.Skeleton, *, sample_bbox: dm.Bbox):
512
512
513
513
if (
514
514
excluded_points_info .excluded_count
515
- > excluded_points_info .total_count * self .max_discarded_threshold
515
+ > ceil ( excluded_points_info .total_count * self .max_discarded_threshold )
516
516
):
517
517
raise TooFewSamples (
518
518
"Too many points discarded, canceling job creation. Errors: {}" .format (
@@ -614,7 +614,7 @@ def _prepare_gt(self):
614
614
sample_id = gt_sample .id ,
615
615
sample_subset = gt_sample .subset ,
616
616
)
617
- excluded_gt_info . excluded_count += 1
617
+ # Don't need to count as excluded, because it's not an error in annotations
618
618
continue
619
619
elif len (matched_skeletons ) == 0 :
620
620
# Handle unmatched boxes
@@ -650,7 +650,7 @@ def _prepare_gt(self):
650
650
651
651
if (
652
652
excluded_gt_info .excluded_count
653
- > excluded_gt_info .total_count * self .max_discarded_threshold
653
+ > ceil ( excluded_gt_info .total_count * self .max_discarded_threshold )
654
654
):
655
655
raise DatasetValidationError (
656
656
"Too many GT boxes discarded ({} out of {}). "
@@ -1327,7 +1327,7 @@ def _validate_skeleton(skeleton: dm.Skeleton, *, sample_bbox: dm.Bbox):
1327
1327
1328
1328
if (
1329
1329
excluded_gt_info .excluded_count
1330
- > excluded_gt_info .total_count * self .max_discarded_threshold
1330
+ > ceil ( excluded_gt_info .total_count * self .max_discarded_threshold )
1331
1331
):
1332
1332
raise TooFewSamples (
1333
1333
"Too many GT skeletons discarded, canceling job creation. Errors: {}" .format (
@@ -1430,7 +1430,7 @@ def _validate_boxes_annotations(self):
1430
1430
1431
1431
if (
1432
1432
excluded_boxes_info .excluded_count
1433
- > excluded_boxes_info .total_count * self .max_discarded_threshold
1433
+ > ceil ( excluded_boxes_info .total_count * self .max_discarded_threshold )
1434
1434
):
1435
1435
raise TooFewSamples (
1436
1436
"Too many boxes discarded, canceling job creation. Errors: {}" .format (
@@ -1580,7 +1580,7 @@ def _prepare_gt(self):
1580
1580
sample_id = gt_sample .id ,
1581
1581
sample_subset = gt_sample .subset ,
1582
1582
)
1583
- excluded_gt_info . excluded_count += 1
1583
+ # Don't need to count as excluded, because it's not an error in annotations
1584
1584
continue
1585
1585
elif len (matched_boxes ) == 0 :
1586
1586
# Handle unmatched boxes
@@ -1620,8 +1620,8 @@ def _prepare_gt(self):
1620
1620
)
1621
1621
1622
1622
if (
1623
- len ( skeleton_bbox_mapping )
1624
- < ( 1 - self .max_discarded_threshold ) * excluded_gt_info .total_count
1623
+ excluded_gt_info . excluded_count
1624
+ > ceil ( self .max_discarded_threshold * excluded_gt_info .total_count )
1625
1625
):
1626
1626
raise DatasetValidationError (
1627
1627
"Too many GT skeletons discarded ({} out of {}). "
0 commit comments