plt.imshow

기린이·2021년 10월 29일
0

모아두기🔧

목록 보기
15/39

pytorch 모델의 weight는 float여서 image도 float로 들어가야된다.

그런데 plt에서는 float는 0~1 사이를 받는다.

그러므로

        images = cv2.imread(os.path.join(dataset_path, image_infos['file_name']))
        images = cv2.cvtColor(images, cv2.COLOR_BGR2RGB).astype(np.float32)
        images /= 255.0

해서 정규화해서 해결한다.

profile
중요한 것은 속력이 아니라 방향성, 공부하며 메모를 남기는 공간입니다.

0개의 댓글