This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow.core.framework import types_pb2, graph_pb2, attr_value_pb2 | |
from tensorflow.tools.graph_transforms import TransformGraph | |
from google.protobuf import text_format | |
import numpy as np | |
# object detection api input and output nodes | |
input_name = "image_tensor" | |
output_names = ["detection_boxes", "detection_classes", "detection_scores", "num_detections"] | |
# Const should be float32 in object detection api during nms (see here: https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/non-max-suppression-v4.html) |