855d29dba61a53553e8fc89237773368fd7e9cdf,research/object_detection/dataset_tools/context_rcnn/generate_detection_data.py,GenerateDetectionDataFn,_load_inference_model,#GenerateDetectionDataFn#,83

Before Change


    // one instance across all threads in the worker. This is possible since
    // tf.Session.run() is thread safe.
    with self.session_lock:
      if self._session is None:
        graph = tf.Graph()
        self._session = tf.Session(graph=graph)
        with graph.as_default():
          meta_graph = tf.saved_model.loader.load(
              self._session, [tf.saved_model.tag_constants.SERVING],
              self._model_dir)
        signature = meta_graph.signature_def["serving_default"]
        input_tensor_name = signature.inputs["inputs"].name
        self._input = graph.get_tensor_by_name(input_tensor_name)
        self._boxes_node = graph.get_tensor_by_name(
            signature.outputs["detection_boxes"].name)
        self._scores_node = graph.get_tensor_by_name(
            signature.outputs["detection_scores"].name)
        self._num_detections_node = graph.get_tensor_by_name(
            signature.outputs["num_detections"].name)

  def process(self, tfrecord_entry):
    return self._run_inference_and_generate_detections(tfrecord_entry)

  def _run_inference_and_generate_detections(self, tfrecord_entry):

After Change


    // one instance across all threads in the worker. This is possible since
    // tf.Session.run() is thread safe.
    with self.session_lock:
      self._detect_fn = tf.saved_model.load(self._model_dir)

  def process(self, tfrecord_entry):
    return self._run_inference_and_generate_detections(tfrecord_entry)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: tensorflow/models
Commit Name: 855d29dba61a53553e8fc89237773368fd7e9cdf
Time: 2020-07-29
Author: sbeery@google.com
File Name: research/object_detection/dataset_tools/context_rcnn/generate_detection_data.py
Class Name: GenerateDetectionDataFn
Method Name: _load_inference_model


Project Name: HyperGAN/HyperGAN
Commit Name: cf72dcaef367bf5625aa3a83a8bce8bbe823d892
Time: 2020-02-14
Author: martyn@255bits.com
File Name: examples/experimental/next-frame.py
Class Name:
Method Name:


Project Name: PavlosMelissinos/enet-keras
Commit Name: fd5fdd2507cb26d746324ae7bfd6c280580dd5e6
Time: 2017-05-04
Author: pmelissi@iti.gr
File Name: src/predict.py
Class Name:
Method Name: