본문 바로가기

지식생활/A.I.

카페2(caffe2) 튜토리얼 Image Pre-Processing (Color Issues)


## 카페2 공부를 위해 튜토리얼 확인

## 공식 페이지에 있는 소스는 일부분만 표시되어있어 실행시 문제없도록

예제 부분을 완성해보았습니다.


############################################################################


import skimage

import skimage.io as io

import numpy as np

import matplotlib.pyplot as pyplot


IMAGE_LOCATION = "https://cdn.pixabay.com/photo/2015/02/10/21/28/flower-631765_1280.jpg"

img = skimage.img_as_float(skimage.io.imread(IMAGE_LOCATION)).astype(np.float32)


pyplot.figure()

pyplot.subplot(1,2,1)

pyplot.imshow(img)

pyplot.axis('on')

pyplot.title('Original image = RGB\nbigsun84')


imgBGR = img[:, :, (2, 1, 0)]



pyplot.subplot(1,2,2)

pyplot.imshow(imgBGR)

pyplot.axis('on')

pyplot.title('bigsun84 OpenCV, Caffe2 = BGR\nbigsun84')

pyplot.show() 



############################################################################


## xwindow 및 jupyter를 이용해서 출력시 나타나는 화면입니다.