diff --git a/detectron/utils/blob.py b/detectron/utils/blob.py index b4fa50c9d..59cecc519 100644 --- a/detectron/utils/blob.py +++ b/detectron/utils/blob.py @@ -106,7 +106,7 @@ def prep_im_for_blob(im, pixel_means, target_size, max_size): the scale factors that were used to compute each returned image. """ im = im.astype(np.float32, copy=False) - im -= pixel_means + im = cv2.subtract(im, pixel_means.reshape((1,) + im.shape[-1:])) im_shape = im.shape im_size_min = np.min(im_shape[0:2]) im_size_max = np.max(im_shape[0:2])