728x90
반응형
3. 수집한 이미지 출력해보기
_04_cnn_training_2.py
from _04_cnn_training_1 import *
import cv2
import matplotlib.pyplot as plt
# Name list
names=['_0_forward','_1_right','_2_left','_3_stop']
def display_images(img_path, ax):
img=cv2.imread(os.path.join(dirname,img_path))
ax.imshow(cv2.cvtColor(img,cv2.COLOR_BGR2RGB))
fig=plt.figure(figsize=(10,3))
for i in range(4):
ax=fig.add_subplot(1,4,i+1,xticks=[], yticks=[])
ax.set_title(names[targets[i+4]], color='blue')
display_images(files[i+4],ax)
plt.show()
728x90
반응형
'즐거운프로그래밍' 카테고리의 다른 글
[딥러닝] 사용자 데이터로 CNN 학습하기- 5. 인공신경망 학습시키기 (0) | 2023.11.06 |
---|---|
[딥러닝] 사용자 데이터로 CNN 학습하기- 4. 훈련, 검증, 시험 데이터 분리하기 (0) | 2023.11.06 |
[딥러닝] 사용자 데이터로 CNN 학습하기- 2. 수집한 데이터 불러오기 (0) | 2023.11.06 |
[딥러닝] 사용자 데이터로 CNN 학습하기- 1. 라벨링하기 (0) | 2023.11.06 |
[딥러닝] VGG16 바탕으로 신경망 구성하기, 배치 정규화, 드롭아웃 적용하기 (0) | 2023.11.02 |