더북(TheBook)

다음 코드로 탐지 결과를 이미지 위에 시각화합니다. 이 과정으로 탐지된 객체의 경계 상자, 클래스 ID, 그리고 점수를 이미지에 표시하여 결과를 직관적으로 확인할 수 있게 해줍니다.

viz_utils.visualize_boxes_and_labels_on_image_array(
    image_np_with_detections[0], result['detection_boxes'][0],
    (result['detection_classes'][0] + label_id_offset).astype(int),
    result['detection_scores'][0], category_index, use_normalized_coordinates=True, max_boxes_to_draw=200, min_score_thresh=.30, agnostic_mode=False)

plt.figure(figsize=(12, 12))
plt.imshow(image_np_with_detections[0])
plt.show()

visualize_boxes_and_labels_on_image_array는 텐서플로 Object Detection API에서 제공하는 함수로, 이미지 위에 탐지된 객체의 정보를 시각화합니다. 다음은 함수 인수의 세부 정보 정보입니다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.