PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

ppyoloe_plus: the images are not normalized during network training ?

Open EudicL opened this issue 3 years ago • 1 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

When inferring, I used the following code,but there is no results on the image

def preprocess(self, srcimg):
    img = cv2.cvtColor(srcimg, cv2.COLOR_BGR2RGB)
    img = cv2.resize(img, self.input_size, interpolation=cv2.INTER_LINEAR)
    img = img.astype(np.float32)
    img = img / 255.
    img -= self.mean_[None, None, :]
    img /= self.std_[None, None, :]
    img = np.transpose(img, [2, 0, 1])

    return img

However, when I remove the code below, the result is normal

    img = img / 255.
    img -= self.mean_[None, None, :]
    img /= self.std_[None, None, :]

EudicL avatar Sep 18 '22 06:09 EudicL

see https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/data/transform/operators.py#L399 divide 255 is executed, but just modify the norm_type to None for fast speed.

nemonameless avatar Sep 19 '22 02:09 nemonameless