
579
14
장
합성곱 신경망을 사용한 컴퓨터 비전
top_K = keras.applications.resnet50.decode_predictions(Y_proba, top=3)
for image_index in range(len(images)):
print("이미지 #{}".format(image_index))
for class_id, name, y_proba in top_K[image_index]:
print(" {} - {:12s} {:.2f}%".format(class_id, name, y_proba * 100))
print()
출력은 다음과 같습니다.
이미지
#0
n03877845 - palace 42.87%
n02825657 - bell_cote 40.57%
n03781244 - monastery 14.56%
이미지
#1
n04522168 - vase 46.83%
n07930864 - cup 7.78%
n11939491 - daisy 4.87%
두 이미지의 정답 클래스(
monastery
와
daisy
)가 상위 결과
3
개 안에 포함되어 있습니다. 모
델이
1
,
000
개의 클래스 중에서 찾는다는 것을 고려하면 꽤 괜찮은 결과입니다.
여기서 볼 수 있듯이 사전훈련된 모델을 사용해 좋은 이미지 분류기를 만드는 것은 아주 쉽습
니다.
keras
.
applications ...