@@ -1527,10 +1527,10 @@ def build_detection_targets(rpn_rois, gt_class_ids, gt_boxes, gt_masks, config):
1527
1527
# Fill the rest with repeated bg rois.
1528
1528
keep_extra_ids = np .random .choice (keep_bg_ids , remaining , replace = True )
1529
1529
keep = np .concatenate ([keep , keep_extra_ids ])
1530
- assert (
1531
- keep . shape [ 0 ] == config . TRAIN_ROIS_PER_IMAGE
1532
- ), "keep doesn't match ROI batch size {}, {}" . format (
1533
- keep . shape [ 0 ], config . TRAIN_ROIS_PER_IMAGE
1530
+ assert keep . shape [ 0 ] == config . TRAIN_ROIS_PER_IMAGE , (
1531
+ " keep doesn't match ROI batch size {}, {}" . format (
1532
+ keep . shape [ 0 ], config . TRAIN_ROIS_PER_IMAGE
1533
+ )
1534
1534
)
1535
1535
1536
1536
# Reset the gt boxes assigned to BG ROIs.
@@ -2876,9 +2876,9 @@ def detect(self, images, verbosity=0):
2876
2876
verbose form in case of verbosity == 3, not 1
2877
2877
"""
2878
2878
assert self .mode == "inference" , "Create model in inference mode."
2879
- assert (
2880
- len (images ) == self . config . BATCH_SIZE
2881
- ), "len(images) must be equal to BATCH_SIZE"
2879
+ assert len ( images ) == self . config . BATCH_SIZE , (
2880
+ " len(images) must be equal to BATCH_SIZE"
2881
+ )
2882
2882
2883
2883
if verbosity == 3 :
2884
2884
log ("Processing {} images" .format (len (images )))
@@ -2892,9 +2892,9 @@ def detect(self, images, verbosity=0):
2892
2892
# All images in a batch MUST be of the same size
2893
2893
image_shape = molded_images [0 ].shape
2894
2894
for g in molded_images [1 :]:
2895
- assert (
2896
- g . shape == image_shape
2897
- ), "After resizing, all images must have the same size. Check IMAGE_RESIZE_MODE and image sizes."
2895
+ assert g . shape == image_shape , (
2896
+ "After resizing, all images must have the same size. Check IMAGE_RESIZE_MODE and image sizes."
2897
+ )
2898
2898
2899
2899
# Anchors
2900
2900
anchors = self .get_anchors (image_shape )
@@ -2950,9 +2950,9 @@ def detect_molded(self, molded_images, image_metas, verbose=0):
2950
2950
masks: [H, W, N] instance binary masks
2951
2951
"""
2952
2952
assert self .mode == "inference" , "Create model in inference mode."
2953
- assert (
2954
- len ( molded_images ) == self . config . BATCH_SIZE
2955
- ), "Number of images must be equal to BATCH_SIZE"
2953
+ assert len ( molded_images ) == self . config . BATCH_SIZE , (
2954
+ "Number of images must be equal to BATCH_SIZE"
2955
+ )
2956
2956
2957
2957
if verbose :
2958
2958
log ("Processing {} images" .format (len (molded_images )))
0 commit comments