我使用 graph = tf.Graph()获取图。现在,我使用TensorFlow(更快的RCNN)创建一个图形。
import cv2
import time
import numpy as np
import core.utils as utils
import TensorFlow as tf
from PIL import Image
return_elements = ["input/input_data:0", "pred_sbbox/concat_2:0", "pred_mbbox/concat_2:0",
"pred_lbbox/concat_2:0"]
pb_file = "./yolov3_coco.pb"
video_path = "./docs/images/road.mp4"
# video_path = 0
num_classes = 80
input_size = 416
graph = tf.Graph()
return_tensors = utils.read_pb_return_tensors(graph, pb_file, return_elements)
with tf.Session(graph=graph) as sess:
vid = cv2.VideoCapture(video_path)
如何进一步将此图用于物体检测。