在tensorflow训练模型中,我想在绿色标签出现时发送消息

时间:2019-04-03 17:08:08

标签: python tensorflow neural-network object-detection

我想要一个条件,当绿色标签将在视频中看到时,消息将使用节点javascirpt(使用localhost服务器)或任何其他方式发送。

while(video.isOpened()):

# Acquire frame and expand frame dimensions to have shape: [1, None, None, 3]
# i.e. a single-column array, where each item in the column has the pixel RGB value
ret, frame = video.read()
frame_expanded = np.expand_dims(frame, axis=0)

# Perform the actual detection by running the model with the image as input
(boxes, scores, classes, num) = sess.run(
    [detection_boxes, detection_scores, detection_classes, num_detections],
    feed_dict={image_tensor: frame_expanded})

# Draw the results of the detection (aka 'visulaize the results')
vis_util.visualize_boxes_and_labels_on_image_array(
    frame,
    np.squeeze(boxes),
    np.squeeze(classes).astype(np.int32),
    np.squeeze(scores),
    category_index,
    use_normalized_coordinates=True,
    line_thickness=8,
    min_score_thresh=0.80)
#put condition here#

# All the results have been drawn on the frame, so it's time to display it.
cv2.imshow('Object detector', frame)
enter code here
# Press 'q' to quit
if cv2.waitKey(1) == ord('q'):
    break

0 个答案:

没有答案