Tensorflow와 Opencv를 활용한 Streaming Object Detection

Tensorflow와 Opencv를 활용한 Streaming Object Detection 이전 포스팅에서 진행되었던 Tensorflow 설치와 Opencv 설치를 완료하셨다면 이번 예제를 간단하게 다룰 수 있습니다. 준비물 : USB 웹캠(노트북은 내장 카메라로 가능합니다.) 아래 그림과 같이 파이참에서 새로운 파이썬 파일을 만들어 줍니다. 새로운 파이썬 파일을 만드셨다면 아래 코드를 복사하여 붙여 넣습니다. import numpy as np import os import six . moves . urllib as urllib import sys import tarfile import tensorflow as tf import zipfile from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image import cv2 cap = cv2 . VideoCapture ( 1 ) # This is needed since the notebook is stored in the object_detection folder. sys . path . append ( ".." ) # ## Object detection imports # Here are the imports from the object detection module. # In[3]: from utils import label_map_util from utils import visualization_utils as vis_util # # Model preparation # ## Variables # # Any model exported using the `export_inference_graph.py` tool can be ...