// Because initialization of the tf.Session is expensive we share// 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)
def _run_inference_and_generate_detections(self, tfrecord_entry):