I want to use tensorflow MobileNet (https://www.tensorflow.org/hub/tutorials/image_retraining#training) to detect that object in a video. I have tried many ways to put video frame from videocapture opencv into tensorflow image but I still fail to run it. How do we detect that object in a video in tensorflow?
This is the way to detect the category of that object in an image
python label_image.py \
--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt \
--input_layer=Placeholder \
--output_layer=final_result \
--input_height=224 --input_width=224 \
--image=$HOME/flower_photos/daisy/21652746_cc379e0eea_m.jpg
And I want to apply it on a video like
while(cap.isOpened()):
ret, frame = cap.read()
if ret:
label_image --graph=../tf_files/retrained_graph.pb --image=frame
But I could not put opencv video frame into tensorflow function