@@ -501,12 +501,12 @@ def crop_pad_image(
501501 pad_image_location = compute_crop_pad_image_location (bbox_tight , image )
502502 # roi_left = min(pad_image_location.x1, (image.shape[1] - 1))
503503 # roi_bottom = min(pad_image_location.y1, (image.shape[0] - 1))
504- roi_left = min (pad_image_location [0 ], (image .shape [1 ] - 1 ))
505- roi_bottom = min (pad_image_location [1 ], (image .shape [0 ] - 1 ))
504+ roi_left = min (pad_image_location [0 ], (image .shape [1 ] - 1 )) # type: ignore
505+ roi_bottom = min (pad_image_location [1 ], (image .shape [0 ] - 1 )) # type: ignore
506506 # roi_width = min(image.shape[1], max(1.0, math.ceil(pad_image_location.x2 - pad_image_location.x1)))
507507 # roi_height = min(image.shape[0], max(1.0, math.ceil(pad_image_location.y2 - pad_image_location.y1)))
508- roi_width = min (image .shape [1 ], max (1.0 , math .ceil (pad_image_location [2 ] - pad_image_location [0 ])))
509- roi_height = min (image .shape [0 ], max (1.0 , math .ceil (pad_image_location [3 ] - pad_image_location [1 ])))
508+ roi_width = min (image .shape [1 ], max (1.0 , math .ceil (pad_image_location [2 ] - pad_image_location [0 ]))) # type: ignore
509+ roi_height = min (image .shape [0 ], max (1.0 , math .ceil (pad_image_location [3 ] - pad_image_location [1 ]))) # type: ignore
510510
511511 err = 0.000000001 # To take care of floating point arithmetic errors
512512 cropped_image = image [
@@ -525,8 +525,8 @@ def crop_pad_image(
525525
526526 # edge_spacing_x = min(bbox_tight.edge_spacing_x(), (image.shape[1] - 1))
527527 # edge_spacing_y = min(bbox_tight.edge_spacing_y(), (image.shape[0] - 1))
528- edge_spacing_x = min (edge_spacing_x_f (bbox_tight ), (image .shape [1 ] - 1 ))
529- edge_spacing_y = min (edge_spacing_y_f (bbox_tight ), (image .shape [0 ] - 1 ))
528+ edge_spacing_x = min (edge_spacing_x_f (bbox_tight ), (image .shape [1 ] - 1 )) # type: ignore
529+ edge_spacing_y = min (edge_spacing_y_f (bbox_tight ), (image .shape [0 ] - 1 )) # type: ignore
530530
531531 # rounding should be done to match the width and height
532532 output_image [
0 commit comments