# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for object_detection.data_decoders.tf_example_decoder."""

import os
import numpy as np
import six
import tensorflow.compat.v1 as tf

from object_detection.core import standard_fields as fields
from object_detection.data_decoders import tf_example_decoder
from object_detection.protos import input_reader_pb2
from object_detection.utils import dataset_util
from object_detection.utils import test_case


class TfExampleDecoderTest(test_case.TestCase):

  def _create_encoded_and_decoded_data(self, data, encoding_type):
    if encoding_type == 'jpeg':
      encode_fn = tf.image.encode_jpeg
      decode_fn = tf.image.decode_jpeg
    elif encoding_type == 'png':
      encode_fn = tf.image.encode_png
      decode_fn = tf.image.decode_png
    else:
      raise ValueError('Invalid encoding type.')

    def prepare_data_fn():
      encoded_data = encode_fn(data)
      decoded_data = decode_fn(encoded_data)
      return encoded_data, decoded_data

    return self.execute_cpu(prepare_data_fn, [])

  def testDecodeAdditionalChannels(self):
    image = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(image, 'jpeg')

    additional_channel = np.random.randint(256, size=(4, 5, 1)).astype(np.uint8)
    (encoded_additional_channel,
     decoded_additional_channel) = self._create_encoded_and_decoded_data(
         additional_channel, 'jpeg')

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/additional_channels/encoded':
                      dataset_util.bytes_list_feature(
                          [encoded_additional_channel] * 2),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/source_id':
                      dataset_util.bytes_feature(six.b('image_id')),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          num_additional_channels=2)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        np.concatenate([decoded_additional_channel] * 2, axis=2),
        tensor_dict[fields.InputDataFields.image_additional_channels])

  def testDecodeJpegImage(self):
    image = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, decoded_jpeg = self._create_encoded_and_decoded_data(
        image, 'jpeg')

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/source_id':
                      dataset_util.bytes_feature(six.b('image_id')),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))
      self.assertAllEqual(
          (output[fields.InputDataFields.image].get_shape().as_list()),
          [None, None, 3])
      self.assertAllEqual(
          (output[fields.InputDataFields.original_image_spatial_shape]
           .get_shape().as_list()), [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(decoded_jpeg, tensor_dict[fields.InputDataFields.image])
    self.assertAllEqual([4, 5], tensor_dict[fields.InputDataFields.
                                            original_image_spatial_shape])
    self.assertEqual(
        six.b('image_id'), tensor_dict[fields.InputDataFields.source_id])

  def testDecodeImageKeyAndFilename(self):
    image = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(image, 'jpeg')

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/key/sha256':
                      dataset_util.bytes_feature(six.b('abc')),
                  'image/filename':
                      dataset_util.bytes_feature(six.b('filename'))
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertEqual(six.b('abc'), tensor_dict[fields.InputDataFields.key])
    self.assertEqual(
        six.b('filename'), tensor_dict[fields.InputDataFields.filename])

  def testDecodePngImage(self):
    image = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_png, decoded_png = self._create_encoded_and_decoded_data(
        image, 'png')

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_png),
                  'image/format':
                      dataset_util.bytes_feature(six.b('png')),
                  'image/source_id':
                      dataset_util.bytes_feature(six.b('image_id'))
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))
      self.assertAllEqual(
          (output[fields.InputDataFields.image].get_shape().as_list()),
          [None, None, 3])
      self.assertAllEqual(
          (output[fields.InputDataFields.original_image_spatial_shape]
           .get_shape().as_list()), [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(decoded_png, tensor_dict[fields.InputDataFields.image])
    self.assertAllEqual([4, 5], tensor_dict[fields.InputDataFields.
                                            original_image_spatial_shape])
    self.assertEqual(
        six.b('image_id'), tensor_dict[fields.InputDataFields.source_id])

  def testDecodePngInstanceMasks(self):
    image = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_png, _ = self._create_encoded_and_decoded_data(image, 'png')
    mask_1 = np.random.randint(0, 2, size=(10, 10, 1)).astype(np.uint8)
    mask_2 = np.random.randint(0, 2, size=(10, 10, 1)).astype(np.uint8)
    encoded_png_1, _ = self._create_encoded_and_decoded_data(mask_1, 'png')
    decoded_png_1 = np.squeeze(mask_1.astype(np.float32))
    encoded_png_2, _ = self._create_encoded_and_decoded_data(mask_2, 'png')
    decoded_png_2 = np.squeeze(mask_2.astype(np.float32))
    encoded_masks = [encoded_png_1, encoded_png_2]
    decoded_masks = np.stack([decoded_png_1, decoded_png_2])

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_png),
                  'image/format':
                      dataset_util.bytes_feature(six.b('png')),
                  'image/object/mask':
                      dataset_util.bytes_list_feature(encoded_masks)
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_instance_masks=True,
          instance_mask_type=input_reader_pb2.PNG_MASKS)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        decoded_masks,
        tensor_dict[fields.InputDataFields.groundtruth_instance_masks])

  def testDecodeEmptyPngInstanceMasks(self):
    image_tensor = np.random.randint(256, size=(10, 10, 3)).astype(np.uint8)
    encoded_png, _ = self._create_encoded_and_decoded_data(image_tensor, 'png')
    encoded_masks = []

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_png),
                  'image/format':
                      dataset_util.bytes_feature(six.b('png')),
                  'image/object/mask':
                      dataset_util.bytes_list_feature(encoded_masks),
                  'image/height':
                      dataset_util.int64_feature(10),
                  'image/width':
                      dataset_util.int64_feature(10),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_instance_masks=True,
          instance_mask_type=input_reader_pb2.PNG_MASKS)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        tensor_dict[fields.InputDataFields.groundtruth_instance_masks].shape,
        [0, 10, 10])

  def testDecodeBoundingBox(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))
      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_boxes].get_shape().as_list()),
                          [None, 4])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    expected_boxes = np.vstack([bbox_ymins, bbox_xmins, bbox_ymaxs,
                                bbox_xmaxs]).transpose()
    self.assertAllEqual(expected_boxes,
                        tensor_dict[fields.InputDataFields.groundtruth_boxes])

  def testDecodeKeypointDepth(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    keypoint_ys = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
    keypoint_xs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
    keypoint_visibility = [1, 2, 0, 1, 0, 2]
    keypoint_depths = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]
    keypoint_depth_weights = [1.0, 0.9, 0.8, 0.7, 0.6, 0.5]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/keypoint/y':
                      dataset_util.float_list_feature(keypoint_ys),
                  'image/object/keypoint/x':
                      dataset_util.float_list_feature(keypoint_xs),
                  'image/object/keypoint/z':
                      dataset_util.float_list_feature(keypoint_depths),
                  'image/object/keypoint/z/weights':
                      dataset_util.float_list_feature(keypoint_depth_weights),
                  'image/object/keypoint/visibility':
                      dataset_util.int64_list_feature(keypoint_visibility),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          num_keypoints=3, load_keypoint_depth_features=True)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual(
          (output[fields.InputDataFields.groundtruth_keypoint_depths].get_shape(
          ).as_list()), [2, 3])
      self.assertAllEqual(
          (output[fields.InputDataFields.groundtruth_keypoint_depth_weights]
           .get_shape().as_list()), [2, 3])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    expected_keypoint_depths = [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]]
    self.assertAllClose(
        expected_keypoint_depths,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_depths])

    expected_keypoint_depth_weights = [[1.0, 0.9, 0.8], [0.7, 0.6, 0.5]]
    self.assertAllClose(
        expected_keypoint_depth_weights,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_depth_weights])

  def testDecodeKeypointDepthNoDepth(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    keypoint_ys = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
    keypoint_xs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
    keypoint_visibility = [1, 2, 0, 1, 0, 2]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/keypoint/y':
                      dataset_util.float_list_feature(keypoint_ys),
                  'image/object/keypoint/x':
                      dataset_util.float_list_feature(keypoint_xs),
                  'image/object/keypoint/visibility':
                      dataset_util.int64_list_feature(keypoint_visibility),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          num_keypoints=3, load_keypoint_depth_features=True)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    expected_keypoints_depth_default = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
    self.assertAllClose(
        expected_keypoints_depth_default,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_depths])
    self.assertAllClose(
        expected_keypoints_depth_default,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_depth_weights])

  def testDecodeKeypoint(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    keypoint_ys = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
    keypoint_xs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
    keypoint_visibility = [1, 2, 0, 1, 0, 2]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/keypoint/y':
                      dataset_util.float_list_feature(keypoint_ys),
                  'image/object/keypoint/x':
                      dataset_util.float_list_feature(keypoint_xs),
                  'image/object/keypoint/visibility':
                      dataset_util.int64_list_feature(keypoint_visibility),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(num_keypoints=3)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_boxes].get_shape().as_list()),
                          [None, 4])
      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_keypoints].get_shape().as_list()),
                          [2, 3, 2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    expected_boxes = np.vstack([bbox_ymins, bbox_xmins, bbox_ymaxs,
                                bbox_xmaxs]).transpose()
    self.assertAllEqual(expected_boxes,
                        tensor_dict[fields.InputDataFields.groundtruth_boxes])

    expected_keypoints = [
        [[0.0, 1.0], [1.0, 2.0], [np.nan, np.nan]],
        [[3.0, 4.0], [np.nan, np.nan], [5.0, 6.0]]]
    self.assertAllClose(
        expected_keypoints,
        tensor_dict[fields.InputDataFields.groundtruth_keypoints])

    expected_visibility = (
        (np.array(keypoint_visibility) > 0).reshape((2, 3)))
    self.assertAllEqual(
        expected_visibility,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_visibilities])

  def testDecodeKeypointNoVisibilities(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    keypoint_ys = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
    keypoint_xs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/keypoint/y':
                      dataset_util.float_list_feature(keypoint_ys),
                  'image/object/keypoint/x':
                      dataset_util.float_list_feature(keypoint_xs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(num_keypoints=3)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_boxes].get_shape().as_list()),
                          [None, 4])
      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_keypoints].get_shape().as_list()),
                          [2, 3, 2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    expected_boxes = np.vstack([bbox_ymins, bbox_xmins, bbox_ymaxs,
                                bbox_xmaxs]).transpose()
    self.assertAllEqual(expected_boxes,
                        tensor_dict[fields.InputDataFields.groundtruth_boxes])

    expected_keypoints = (
        np.vstack([keypoint_ys, keypoint_xs]).transpose().reshape((2, 3, 2)))
    self.assertAllEqual(
        expected_keypoints,
        tensor_dict[fields.InputDataFields.groundtruth_keypoints])

    expected_visibility = np.ones((2, 3))
    self.assertAllEqual(
        expected_visibility,
        tensor_dict[fields.InputDataFields.groundtruth_keypoint_visibilities])

  def testDecodeDefaultGroundtruthWeights(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_boxes].get_shape().as_list()),
                          [None, 4])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllClose(tensor_dict[fields.InputDataFields.groundtruth_weights],
                        np.ones(2, dtype=np.float32))

  def testDecodeObjectLabel(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes = [0, 1]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(bbox_classes),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(bbox_classes,
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeMultiClassScores(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    flattened_multiclass_scores = [100., 50.] + [20., 30.]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/multiclass_scores':
                      dataset_util.float_list_feature(
                          flattened_multiclass_scores),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_multiclass_scores=True)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(flattened_multiclass_scores,
                        tensor_dict[fields.InputDataFields.multiclass_scores])

  def testDecodeEmptyMultiClassScores(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_multiclass_scores=True)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertEqual(
        (0,), tensor_dict[fields.InputDataFields.multiclass_scores].shape)

  def testDecodeObjectLabelNoText(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes = [1, 2]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(bbox_classes),
              })).SerializeToString()
      label_map_string = """
        item {
          id:1
          name:'cat'
        }
        item {
          id:2
          name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)

      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [None])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(bbox_classes,
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectLabelWithText(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes_text = [six.b('cat'), six.b('dog')]
    # Annotation label gets overridden by labelmap id.
    annotated_bbox_classes = [3, 4]
    expected_bbox_classes = [1, 2]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(annotated_bbox_classes),
              })).SerializeToString()
      label_map_string = """
        item {
          id:1
          name:'cat'
        }
        item {
          id:2
          name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)

      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(expected_bbox_classes,
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectLabelUnrecognizedName(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes_text = [six.b('cat'), six.b('cheetah')]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
              })).SerializeToString()

      label_map_string = """
        item {
          id:2
          name:'cat'
        }
        item {
          id:1
          name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)
      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      output = example_decoder.decode(tf.convert_to_tensor(example))
      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [None])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual([2, -1],
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectLabelWithMappingWithDisplayName(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes_text = [six.b('cat'), six.b('dog')]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
              })).SerializeToString()

      label_map_string = """
        item {
          id:3
          display_name:'cat'
        }
        item {
          id:1
          display_name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)
      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [None])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual([3, 1],
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectLabelUnrecognizedNameWithMappingWithDisplayName(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes_text = [six.b('cat'), six.b('cheetah')]
    bbox_classes_id = [5, 6]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(bbox_classes_id),
              })).SerializeToString()

      label_map_string = """
        item {
          name:'/m/cat'
          id:3
          display_name:'cat'
        }
        item {
          name:'/m/dog'
          id:1
          display_name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)
      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual([3, -1],
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectLabelWithMappingWithName(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_classes_text = [six.b('cat'), six.b('dog')]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
              })).SerializeToString()

      label_map_string = """
        item {
          id:3
          name:'cat'
        }
        item {
          id:1
          name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)
      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [None])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual([3, 1],
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testDecodeObjectArea(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    object_area = [100., 174.]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/area':
                      dataset_util.float_list_feature(object_area),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_area].get_shape().as_list()), [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(object_area,
                        tensor_dict[fields.InputDataFields.groundtruth_area])

  def testDecodeVerifiedNegClasses(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    neg_category_ids = [0, 5, 8]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/neg_category_ids':
                      dataset_util.int64_list_feature(neg_category_ids),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        neg_category_ids,
        tensor_dict[fields.InputDataFields.groundtruth_verified_neg_classes])

  def testDecodeNotExhaustiveClasses(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    not_exhaustive_category_ids = [0, 5, 8]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/not_exhaustive_category_ids':
                      dataset_util.int64_list_feature(
                          not_exhaustive_category_ids),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        not_exhaustive_category_ids,
        tensor_dict[fields.InputDataFields.groundtruth_not_exhaustive_classes])

  def testDecodeObjectIsCrowd(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    object_is_crowd = [0, 1]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/is_crowd':
                      dataset_util.int64_list_feature(object_is_crowd),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_is_crowd].get_shape().as_list()),
                          [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        [bool(item) for item in object_is_crowd],
        tensor_dict[fields.InputDataFields.groundtruth_is_crowd])

  def testDecodeObjectDifficult(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    object_difficult = [0, 1]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/difficult':
                      dataset_util.int64_list_feature(object_difficult),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_difficult].get_shape().as_list()),
                          [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        [bool(item) for item in object_difficult],
        tensor_dict[fields.InputDataFields.groundtruth_difficult])

  def testDecodeObjectGroupOf(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    object_group_of = [0, 1]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/group_of':
                      dataset_util.int64_list_feature(object_group_of),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_group_of].get_shape().as_list()),
                          [2])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        [bool(item) for item in object_group_of],
        tensor_dict[fields.InputDataFields.groundtruth_group_of])

  def testDecodeObjectWeight(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    object_weights = [0.75, 1.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/weight':
                      dataset_util.float_list_feature(object_weights),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_weights].get_shape().as_list()),
                          [None])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(object_weights,
                        tensor_dict[fields.InputDataFields.groundtruth_weights])

  def testDecodeClassConfidence(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    class_confidence = [0.0, 1.0, 0.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/class/confidence':
                      dataset_util.float_list_feature(class_confidence),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual(
          (output[fields.InputDataFields.groundtruth_image_confidences]
           .get_shape().as_list()), [3])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllEqual(
        class_confidence,
        tensor_dict[fields.InputDataFields.groundtruth_image_confidences])

  def testDecodeInstanceSegmentation(self):
    num_instances = 4
    image_height = 5
    image_width = 3

    # Randomly generate image.
    image_tensor = np.random.randint(
        256, size=(image_height, image_width, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')

    # Randomly generate instance segmentation masks.
    instance_masks = (
        np.random.randint(2, size=(num_instances, image_height,
                                   image_width)).astype(np.float32))
    instance_masks_flattened = np.reshape(instance_masks, [-1])

    # Randomly generate class labels for each instance.
    object_classes = np.random.randint(
        100, size=(num_instances)).astype(np.int64)

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/height':
                      dataset_util.int64_feature(image_height),
                  'image/width':
                      dataset_util.int64_feature(image_width),
                  'image/object/mask':
                      dataset_util.float_list_feature(instance_masks_flattened),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(object_classes)
              })).SerializeToString()
      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_instance_masks=True)
      output = example_decoder.decode(tf.convert_to_tensor(example))

      self.assertAllEqual(
          (output[fields.InputDataFields.groundtruth_instance_masks].get_shape(
          ).as_list()), [4, 5, 3])

      self.assertAllEqual((output[
          fields.InputDataFields.groundtruth_classes].get_shape().as_list()),
                          [4])
      return output

    tensor_dict = self.execute_cpu(graph_fn, [])

    self.assertAllEqual(
        instance_masks.astype(np.float32),
        tensor_dict[fields.InputDataFields.groundtruth_instance_masks])
    self.assertAllEqual(object_classes,
                        tensor_dict[fields.InputDataFields.groundtruth_classes])

  def testInstancesNotAvailableByDefault(self):
    num_instances = 4
    image_height = 5
    image_width = 3
    # Randomly generate image.
    image_tensor = np.random.randint(
        256, size=(image_height, image_width, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')

    # Randomly generate instance segmentation masks.
    instance_masks = (
        np.random.randint(2, size=(num_instances, image_height,
                                   image_width)).astype(np.float32))
    instance_masks_flattened = np.reshape(instance_masks, [-1])

    # Randomly generate class labels for each instance.
    object_classes = np.random.randint(
        100, size=(num_instances)).astype(np.int64)

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/height':
                      dataset_util.int64_feature(image_height),
                  'image/width':
                      dataset_util.int64_feature(image_width),
                  'image/object/mask':
                      dataset_util.float_list_feature(instance_masks_flattened),
                  'image/object/class/label':
                      dataset_util.int64_list_feature(object_classes)
              })).SerializeToString()
      example_decoder = tf_example_decoder.TfExampleDecoder()
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertNotIn(fields.InputDataFields.groundtruth_instance_masks,
                     tensor_dict)

  def testDecodeImageLabels(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')

    def graph_fn_1():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded': dataset_util.bytes_feature(encoded_jpeg),
                  'image/format': dataset_util.bytes_feature(six.b('jpeg')),
                  'image/class/label': dataset_util.int64_list_feature([1, 2]),
              })).SerializeToString()
      example_decoder = tf_example_decoder.TfExampleDecoder()
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn_1, [])
    self.assertIn(fields.InputDataFields.groundtruth_image_classes, tensor_dict)
    self.assertAllEqual(
        tensor_dict[fields.InputDataFields.groundtruth_image_classes],
        np.array([1, 2]))

    def graph_fn_2():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/class/text':
                      dataset_util.bytes_list_feature(
                          [six.b('dog'), six.b('cat')]),
              })).SerializeToString()
      label_map_string = """
        item {
          id:3
          name:'cat'
        }
        item {
          id:1
          name:'dog'
        }
      """
      label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
      with tf.gfile.Open(label_map_path, 'wb') as f:
        f.write(label_map_string)
      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn_2, [])
    self.assertIn(fields.InputDataFields.groundtruth_image_classes, tensor_dict)
    self.assertAllEqual(
        tensor_dict[fields.InputDataFields.groundtruth_image_classes],
        np.array([1, 3]))

  def testDecodeContextFeatures(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    num_features = 8
    context_feature_length = 10
    context_features = np.random.random(num_features*context_feature_length)

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/context_features':
                      dataset_util.float_list_feature(context_features),
                  'image/context_feature_length':
                      dataset_util.int64_feature(context_feature_length),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_context_features=True)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertAllClose(
        context_features.reshape(num_features, context_feature_length),
        tensor_dict[fields.InputDataFields.context_features])
    self.assertAllEqual(
        context_feature_length,
        tensor_dict[fields.InputDataFields.context_feature_length])

  def testContextFeaturesNotAvailableByDefault(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    num_features = 10
    context_feature_length = 10
    context_features = np.random.random(num_features*context_feature_length)

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/context_features':
                      dataset_util.float_list_feature(context_features),
                  'image/context_feature_length':
                      dataset_util.int64_feature(context_feature_length),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder()
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])
    self.assertNotIn(fields.InputDataFields.context_features,
                     tensor_dict)

  def testExpandLabels(self):
    label_map_string = """
      item {
        id:1
        name:'cat'
        ancestor_ids: 2
      }
      item {
        id:2
        name:'animal'
        descendant_ids: 1
      }
      item {
        id:3
        name:'man'
        ancestor_ids: 5
      }
      item {
        id:4
        name:'woman'
        display_name:'woman'
        ancestor_ids: 5
      }
      item {
        id:5
        name:'person'
        descendant_ids: 3
        descendant_ids: 4
      }
    """

    label_map_path = os.path.join(self.get_temp_dir(), 'label_map.pbtxt')
    with tf.gfile.Open(label_map_path, 'wb') as f:
      f.write(label_map_string)
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0]
    bbox_xmins = [1.0, 5.0]
    bbox_ymaxs = [2.0, 6.0]
    bbox_xmaxs = [3.0, 7.0]
    bbox_classes_text = [six.b('cat'), six.b('cat')]
    bbox_group_of = [0, 1]
    image_class_text = [six.b('cat'), six.b('person')]
    image_confidence = [1.0, 0.0]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/class/text':
                      dataset_util.bytes_list_feature(bbox_classes_text),
                  'image/object/group_of':
                      dataset_util.int64_list_feature(bbox_group_of),
                  'image/class/text':
                      dataset_util.bytes_list_feature(image_class_text),
                  'image/class/confidence':
                      dataset_util.float_list_feature(image_confidence),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          label_map_proto_file=label_map_path, expand_hierarchy_labels=True)
      return example_decoder.decode(tf.convert_to_tensor(example))

    tensor_dict = self.execute_cpu(graph_fn, [])

    boxes = np.vstack([bbox_ymins, bbox_xmins, bbox_ymaxs,
                       bbox_xmaxs]).transpose()
    expected_boxes = np.stack(
        [boxes[0, :], boxes[0, :], boxes[1, :], boxes[1, :]], axis=0)
    expected_boxes_class = np.array([1, 2, 1, 2])
    expected_boxes_group_of = np.array([0, 0, 1, 1])
    expected_image_class = np.array([1, 2, 3, 4, 5])
    expected_image_confidence = np.array([1.0, 1.0, 0.0, 0.0, 0.0])
    self.assertAllEqual(expected_boxes,
                        tensor_dict[fields.InputDataFields.groundtruth_boxes])
    self.assertAllEqual(expected_boxes_class,
                        tensor_dict[fields.InputDataFields.groundtruth_classes])
    self.assertAllEqual(
        expected_boxes_group_of,
        tensor_dict[fields.InputDataFields.groundtruth_group_of])
    self.assertAllEqual(
        expected_image_class,
        tensor_dict[fields.InputDataFields.groundtruth_image_classes])
    self.assertAllEqual(
        expected_image_confidence,
        tensor_dict[fields.InputDataFields.groundtruth_image_confidences])

  def testDecodeDensePose(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0, 2.0]
    bbox_xmins = [1.0, 5.0, 8.0]
    bbox_ymaxs = [2.0, 6.0, 1.0]
    bbox_xmaxs = [3.0, 7.0, 3.3]
    densepose_num = [0, 4, 2]
    densepose_part_index = [2, 2, 3, 4, 2, 9]
    densepose_x = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]
    densepose_y = [0.9, 0.8, 0.7, 0.6, 0.5, 0.4]
    densepose_u = [0.01, 0.02, 0.03, 0.04, 0.05, 0.06]
    densepose_v = [0.99, 0.98, 0.97, 0.96, 0.95, 0.94]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/densepose/num':
                      dataset_util.int64_list_feature(densepose_num),
                  'image/object/densepose/part_index':
                      dataset_util.int64_list_feature(densepose_part_index),
                  'image/object/densepose/x':
                      dataset_util.float_list_feature(densepose_x),
                  'image/object/densepose/y':
                      dataset_util.float_list_feature(densepose_y),
                  'image/object/densepose/u':
                      dataset_util.float_list_feature(densepose_u),
                  'image/object/densepose/v':
                      dataset_util.float_list_feature(densepose_v),

              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_dense_pose=True)
      output = example_decoder.decode(tf.convert_to_tensor(example))
      dp_num_points = output[fields.InputDataFields.groundtruth_dp_num_points]
      dp_part_ids = output[fields.InputDataFields.groundtruth_dp_part_ids]
      dp_surface_coords = output[
          fields.InputDataFields.groundtruth_dp_surface_coords]
      return dp_num_points, dp_part_ids, dp_surface_coords

    dp_num_points, dp_part_ids, dp_surface_coords = self.execute_cpu(
        graph_fn, [])

    expected_dp_num_points = [0, 4, 2]
    expected_dp_part_ids = [
        [0, 0, 0, 0],
        [2, 2, 3, 4],
        [2, 9, 0, 0]
    ]
    expected_dp_surface_coords = np.array(
        [
            # Instance 0 (no points).
            [[0., 0., 0., 0.],
             [0., 0., 0., 0.],
             [0., 0., 0., 0.],
             [0., 0., 0., 0.]],
            # Instance 1 (4 points).
            [[0.9, 0.1, 0.99, 0.01],
             [0.8, 0.2, 0.98, 0.02],
             [0.7, 0.3, 0.97, 0.03],
             [0.6, 0.4, 0.96, 0.04]],
            # Instance 2 (2 points).
            [[0.5, 0.5, 0.95, 0.05],
             [0.4, 0.6, 0.94, 0.06],
             [0., 0., 0., 0.],
             [0., 0., 0., 0.]],
        ], dtype=np.float32)

    self.assertAllEqual(dp_num_points, expected_dp_num_points)
    self.assertAllEqual(dp_part_ids, expected_dp_part_ids)
    self.assertAllClose(dp_surface_coords, expected_dp_surface_coords)

  def testDecodeTrack(self):
    image_tensor = np.random.randint(256, size=(4, 5, 3)).astype(np.uint8)
    encoded_jpeg, _ = self._create_encoded_and_decoded_data(
        image_tensor, 'jpeg')
    bbox_ymins = [0.0, 4.0, 2.0]
    bbox_xmins = [1.0, 5.0, 8.0]
    bbox_ymaxs = [2.0, 6.0, 1.0]
    bbox_xmaxs = [3.0, 7.0, 3.3]
    track_labels = [0, 1, 2]

    def graph_fn():
      example = tf.train.Example(
          features=tf.train.Features(
              feature={
                  'image/encoded':
                      dataset_util.bytes_feature(encoded_jpeg),
                  'image/format':
                      dataset_util.bytes_feature(six.b('jpeg')),
                  'image/object/bbox/ymin':
                      dataset_util.float_list_feature(bbox_ymins),
                  'image/object/bbox/xmin':
                      dataset_util.float_list_feature(bbox_xmins),
                  'image/object/bbox/ymax':
                      dataset_util.float_list_feature(bbox_ymaxs),
                  'image/object/bbox/xmax':
                      dataset_util.float_list_feature(bbox_xmaxs),
                  'image/object/track/label':
                      dataset_util.int64_list_feature(track_labels),
              })).SerializeToString()

      example_decoder = tf_example_decoder.TfExampleDecoder(
          load_track_id=True)
      output = example_decoder.decode(tf.convert_to_tensor(example))
      track_ids = output[fields.InputDataFields.groundtruth_track_ids]
      return track_ids

    track_ids = self.execute_cpu(graph_fn, [])

    expected_track_labels = [0, 1, 2]

    self.assertAllEqual(track_ids, expected_track_labels)


if __name__ == '__main__':
  tf.test.main()

[((66083, 66097), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (66095, 66097), True, 'import tensorflow.compat.v1 as tf\n'), ((7657, 7697), 'numpy.stack', 'np.stack', (['[decoded_png_1, decoded_png_2]'], {}), '([decoded_png_1, decoded_png_2])\n', (7665, 7697), True, 'import numpy as np\n'), ((22006, 22021), 'numpy.ones', 'np.ones', (['(2, 3)'], {}), '((2, 3))\n', (22013, 22021), True, 'import numpy as np\n'), ((47474, 47506), 'numpy.reshape', 'np.reshape', (['instance_masks', '[-1]'], {}), '(instance_masks, [-1])\n', (47484, 47506), True, 'import numpy as np\n'), ((49805, 49837), 'numpy.reshape', 'np.reshape', (['instance_masks', '[-1]'], {}), '(instance_masks, [-1])\n', (49815, 49837), True, 'import numpy as np\n'), ((53685, 53740), 'numpy.random.random', 'np.random.random', (['(num_features * context_feature_length)'], {}), '(num_features * context_feature_length)\n', (53701, 53740), True, 'import numpy as np\n'), ((55688, 55743), 'numpy.random.random', 'np.random.random', (['(num_features * context_feature_length)'], {}), '(num_features * context_feature_length)\n', (55704, 55743), True, 'import numpy as np\n'), ((59821, 59899), 'numpy.stack', 'np.stack', (['[boxes[(0), :], boxes[(0), :], boxes[(1), :], boxes[(1), :]]'], {'axis': '(0)'}), '([boxes[(0), :], boxes[(0), :], boxes[(1), :], boxes[(1), :]], axis=0)\n', (59829, 59899), True, 'import numpy as np\n'), ((59928, 59950), 'numpy.array', 'np.array', (['[1, 2, 1, 2]'], {}), '([1, 2, 1, 2])\n', (59936, 59950), True, 'import numpy as np\n'), ((59981, 60003), 'numpy.array', 'np.array', (['[0, 0, 1, 1]'], {}), '([0, 0, 1, 1])\n', (59989, 60003), True, 'import numpy as np\n'), ((60031, 60056), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (60039, 60056), True, 'import numpy as np\n'), ((60089, 60124), 'numpy.array', 'np.array', (['[1.0, 1.0, 0.0, 0.0, 0.0]'], {}), '([1.0, 1.0, 0.0, 0.0, 0.0])\n', (60097, 60124), True, 'import numpy as np\n'), ((63616, 63943), 'numpy.array', 'np.array', (['[[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, \n    0.0, 0.0, 0.0]], [[0.9, 0.1, 0.99, 0.01], [0.8, 0.2, 0.98, 0.02], [0.7,\n    0.3, 0.97, 0.03], [0.6, 0.4, 0.96, 0.04]], [[0.5, 0.5, 0.95, 0.05], [\n    0.4, 0.6, 0.94, 0.06], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]'], {'dtype': 'np.float32'}), '([[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0],\n    [0.0, 0.0, 0.0, 0.0]], [[0.9, 0.1, 0.99, 0.01], [0.8, 0.2, 0.98, 0.02],\n    [0.7, 0.3, 0.97, 0.03], [0.6, 0.4, 0.96, 0.04]], [[0.5, 0.5, 0.95, 0.05\n    ], [0.4, 0.6, 0.94, 0.06], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]],\n    dtype=np.float32)\n', (63624, 63943), True, 'import numpy as np\n'), ((2763, 2825), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'num_additional_channels': '(2)'}), '(num_additional_channels=2)\n', (2798, 2825), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((2987, 3043), 'numpy.concatenate', 'np.concatenate', (['([decoded_additional_channel] * 2)'], {'axis': '(2)'}), '([decoded_additional_channel] * 2, axis=2)\n', (3001, 3043), True, 'import numpy as np\n'), ((3797, 3834), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (3832, 3834), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((4493, 4510), 'six.b', 'six.b', (['"""image_id"""'], {}), "('image_id')\n", (4498, 4510), False, 'import six\n'), ((5231, 5268), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (5266, 5268), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((5407, 5419), 'six.b', 'six.b', (['"""abc"""'], {}), "('abc')\n", (5412, 5419), False, 'import six\n'), ((5492, 5509), 'six.b', 'six.b', (['"""filename"""'], {}), "('filename')\n", (5497, 5509), False, 'import six\n'), ((6231, 6268), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (6266, 6268), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((6926, 6943), 'six.b', 'six.b', (['"""image_id"""'], {}), "('image_id')\n", (6931, 6943), False, 'import six\n'), ((8182, 8294), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_instance_masks': '(True)', 'instance_mask_type': 'input_reader_pb2.PNG_MASKS'}), '(load_instance_masks=True,\n    instance_mask_type=input_reader_pb2.PNG_MASKS)\n', (8217, 8294), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((9435, 9547), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_instance_masks': '(True)', 'instance_mask_type': 'input_reader_pb2.PNG_MASKS'}), '(load_instance_masks=True,\n    instance_mask_type=input_reader_pb2.PNG_MASKS)\n', (9470, 9547), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((10942, 10979), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (10977, 10979), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((13510, 13601), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'num_keypoints': '(3)', 'load_keypoint_depth_features': '(True)'}), '(num_keypoints=3,\n    load_keypoint_depth_features=True)\n', (13545, 13601), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((16100, 16191), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'num_keypoints': '(3)', 'load_keypoint_depth_features': '(True)'}), '(num_keypoints=3,\n    load_keypoint_depth_features=True)\n', (16135, 16191), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((18333, 18385), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'num_keypoints': '(3)'}), '(num_keypoints=3)\n', (18368, 18385), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((21016, 21068), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'num_keypoints': '(3)'}), '(num_keypoints=3)\n', (21051, 21068), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((23305, 23342), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (23340, 23342), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((23736, 23764), 'numpy.ones', 'np.ones', (['(2)'], {'dtype': 'np.float32'}), '(2, dtype=np.float32)\n', (23743, 23764), True, 'import numpy as np\n'), ((24487, 24524), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (24522, 24524), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((26298, 26362), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_multiclass_scores': '(True)'}), '(load_multiclass_scores=True)\n', (26333, 26362), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((27769, 27833), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_multiclass_scores': '(True)'}), '(load_multiclass_scores=True)\n', (27804, 27833), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((29110, 29182), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (29145, 29182), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((29836, 29848), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (29841, 29848), False, 'import six\n'), ((29850, 29862), 'six.b', 'six.b', (['"""dog"""'], {}), "('dog')\n", (29855, 29862), False, 'import six\n'), ((30936, 31008), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (30971, 31008), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((31509, 31521), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (31514, 31521), False, 'import six\n'), ((31523, 31539), 'six.b', 'six.b', (['"""cheetah"""'], {}), "('cheetah')\n", (31528, 31539), False, 'import six\n'), ((32362, 32434), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (32397, 32434), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((33099, 33111), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (33104, 33111), False, 'import six\n'), ((33113, 33125), 'six.b', 'six.b', (['"""dog"""'], {}), "('dog')\n", (33118, 33125), False, 'import six\n'), ((33964, 34036), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (33999, 34036), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((34717, 34729), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (34722, 34729), False, 'import six\n'), ((34731, 34747), 'six.b', 'six.b', (['"""cheetah"""'], {}), "('cheetah')\n", (34736, 34747), False, 'import six\n'), ((35781, 35853), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (35816, 35853), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((36342, 36354), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (36347, 36354), False, 'import six\n'), ((36356, 36368), 'six.b', 'six.b', (['"""dog"""'], {}), "('dog')\n", (36361, 36368), False, 'import six\n'), ((37191, 37263), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (37226, 37263), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((38392, 38429), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (38427, 38429), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((39538, 39575), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (39573, 39575), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((40643, 40680), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (40678, 40680), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((41688, 41725), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (41723, 41725), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((42883, 42920), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (42918, 42920), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((44076, 44113), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (44111, 44113), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((45266, 45303), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (45301, 45303), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((46453, 46490), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (46488, 46490), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((48463, 48524), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_instance_masks': '(True)'}), '(load_instance_masks=True)\n', (48498, 48524), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((50794, 50831), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (50829, 50831), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((51672, 51709), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (51707, 51709), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((52014, 52030), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (52022, 52030), True, 'import numpy as np\n'), ((52885, 52957), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path'}), '(label_map_proto_file=label_map_path)\n', (52920, 52957), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((53273, 53289), 'numpy.array', 'np.array', (['[1, 3]'], {}), '([1, 3])\n', (53281, 53289), True, 'import numpy as np\n'), ((54802, 54865), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_context_features': '(True)'}), '(load_context_features=True)\n', (54837, 54865), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((56805, 56842), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {}), '()\n', (56840, 56842), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((57658, 57693), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (57671, 57693), True, 'import tensorflow.compat.v1 as tf\n'), ((58035, 58047), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (58040, 58047), False, 'import six\n'), ((58049, 58061), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (58054, 58061), False, 'import six\n'), ((58114, 58126), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (58119, 58126), False, 'import six\n'), ((58128, 58143), 'six.b', 'six.b', (['"""person"""'], {}), "('person')\n", (58133, 58143), False, 'import six\n'), ((59461, 59567), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'label_map_proto_file': 'label_map_path', 'expand_hierarchy_labels': '(True)'}), '(label_map_proto_file=label_map_path,\n    expand_hierarchy_labels=True)\n', (59496, 59567), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((62901, 62958), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_dense_pose': '(True)'}), '(load_dense_pose=True)\n', (62936, 62958), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((65676, 65731), 'object_detection.data_decoders.tf_example_decoder.TfExampleDecoder', 'tf_example_decoder.TfExampleDecoder', ([], {'load_track_id': '(True)'}), '(load_track_id=True)\n', (65711, 65731), False, 'from object_detection.data_decoders import tf_example_decoder\n'), ((1751, 1789), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (1768, 1789), True, 'import numpy as np\n'), ((1908, 1946), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 1)'}), '(256, size=(4, 5, 1))\n', (1925, 1946), True, 'import numpy as np\n'), ((2873, 2902), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (2893, 2902), True, 'import tensorflow.compat.v1 as tf\n'), ((3162, 3200), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (3179, 3200), True, 'import numpy as np\n'), ((3873, 3902), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (3893, 3902), True, 'import tensorflow.compat.v1 as tf\n'), ((4615, 4653), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (4632, 4653), True, 'import numpy as np\n'), ((5305, 5334), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (5325, 5334), True, 'import tensorflow.compat.v1 as tf\n'), ((5602, 5640), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (5619, 5640), True, 'import numpy as np\n'), ((6307, 6336), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (6327, 6336), True, 'import tensorflow.compat.v1 as tf\n'), ((7045, 7083), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (7062, 7083), True, 'import numpy as np\n'), ((7187, 7228), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)'], {'size': '(10, 10, 1)'}), '(0, 2, size=(10, 10, 1))\n', (7204, 7228), True, 'import numpy as np\n'), ((7259, 7300), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)'], {'size': '(10, 10, 1)'}), '(0, 2, size=(10, 10, 1))\n', (7276, 7300), True, 'import numpy as np\n'), ((8348, 8377), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (8368, 8377), True, 'import tensorflow.compat.v1 as tf\n'), ((8614, 8654), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(10, 10, 3)'}), '(256, size=(10, 10, 3))\n', (8631, 8654), True, 'import numpy as np\n'), ((9601, 9630), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (9621, 9630), True, 'import tensorflow.compat.v1 as tf\n'), ((9861, 9899), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (9878, 9899), True, 'import numpy as np\n'), ((11018, 11047), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (11038, 11047), True, 'import tensorflow.compat.v1 as tf\n'), ((11288, 11347), 'numpy.vstack', 'np.vstack', (['[bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs]'], {}), '([bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs])\n', (11297, 11347), True, 'import numpy as np\n'), ((11568, 11606), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (11585, 11606), True, 'import numpy as np\n'), ((13647, 13676), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (13667, 13676), True, 'import tensorflow.compat.v1 as tf\n'), ((14520, 14558), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (14537, 14558), True, 'import numpy as np\n'), ((16237, 16266), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (16257, 16266), True, 'import tensorflow.compat.v1 as tf\n'), ((16753, 16791), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (16770, 16791), True, 'import numpy as np\n'), ((18424, 18453), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (18444, 18453), True, 'import tensorflow.compat.v1 as tf\n'), ((18847, 18906), 'numpy.vstack', 'np.vstack', (['[bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs]'], {}), '([bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs])\n', (18856, 18906), True, 'import numpy as np\n'), ((19611, 19649), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (19628, 19649), True, 'import numpy as np\n'), ((21107, 21136), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (21127, 21136), True, 'import tensorflow.compat.v1 as tf\n'), ((21530, 21589), 'numpy.vstack', 'np.vstack', (['[bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs]'], {}), '([bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs])\n', (21539, 21589), True, 'import numpy as np\n'), ((22224, 22262), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (22241, 22262), True, 'import numpy as np\n'), ((23381, 23410), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (23401, 23410), True, 'import tensorflow.compat.v1 as tf\n'), ((23821, 23859), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (23838, 23859), True, 'import numpy as np\n'), ((24563, 24592), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (24583, 24592), True, 'import tensorflow.compat.v1 as tf\n'), ((24989, 25027), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (25006, 25027), True, 'import numpy as np\n'), ((26410, 26439), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (26430, 26439), True, 'import tensorflow.compat.v1 as tf\n'), ((26688, 26726), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (26705, 26726), True, 'import numpy as np\n'), ((27881, 27910), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (27901, 27910), True, 'import tensorflow.compat.v1 as tf\n'), ((28120, 28158), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (28137, 28158), True, 'import numpy as np\n'), ((29009, 29044), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (29022, 29044), True, 'import tensorflow.compat.v1 as tf\n'), ((29232, 29261), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (29252, 29261), True, 'import tensorflow.compat.v1 as tf\n'), ((29664, 29702), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (29681, 29702), True, 'import numpy as np\n'), ((30835, 30870), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (30848, 30870), True, 'import tensorflow.compat.v1 as tf\n'), ((31056, 31085), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (31076, 31085), True, 'import tensorflow.compat.v1 as tf\n'), ((31337, 31375), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (31354, 31375), True, 'import numpy as np\n'), ((32262, 32297), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (32275, 32297), True, 'import tensorflow.compat.v1 as tf\n'), ((32484, 32513), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (32504, 32513), True, 'import tensorflow.compat.v1 as tf\n'), ((32927, 32965), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (32944, 32965), True, 'import numpy as np\n'), ((33864, 33899), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (33877, 33899), True, 'import tensorflow.compat.v1 as tf\n'), ((34086, 34115), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (34106, 34115), True, 'import tensorflow.compat.v1 as tf\n'), ((34545, 34583), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (34562, 34583), True, 'import numpy as np\n'), ((35681, 35716), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (35694, 35716), True, 'import tensorflow.compat.v1 as tf\n'), ((35901, 35930), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (35921, 35930), True, 'import tensorflow.compat.v1 as tf\n'), ((36170, 36208), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (36187, 36208), True, 'import numpy as np\n'), ((37091, 37126), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (37104, 37126), True, 'import tensorflow.compat.v1 as tf\n'), ((37313, 37342), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (37333, 37342), True, 'import tensorflow.compat.v1 as tf\n'), ((37729, 37767), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (37746, 37767), True, 'import numpy as np\n'), ((38468, 38497), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (38488, 38497), True, 'import tensorflow.compat.v1 as tf\n'), ((38863, 38901), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (38880, 38901), True, 'import numpy as np\n'), ((39614, 39643), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (39634, 39643), True, 'import tensorflow.compat.v1 as tf\n'), ((39908, 39946), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (39925, 39946), True, 'import numpy as np\n'), ((40719, 40748), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (40739, 40748), True, 'import tensorflow.compat.v1 as tf\n'), ((41019, 41057), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (41036, 41057), True, 'import numpy as np\n'), ((41764, 41793), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (41784, 41793), True, 'import tensorflow.compat.v1 as tf\n'), ((42211, 42249), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (42228, 42249), True, 'import numpy as np\n'), ((42959, 42988), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (42979, 42988), True, 'import tensorflow.compat.v1 as tf\n'), ((43407, 43445), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (43424, 43445), True, 'import numpy as np\n'), ((44152, 44181), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (44172, 44181), True, 'import tensorflow.compat.v1 as tf\n'), ((44596, 44634), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (44613, 44634), True, 'import numpy as np\n'), ((45342, 45371), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (45362, 45371), True, 'import tensorflow.compat.v1 as tf\n'), ((45772, 45810), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (45789, 45810), True, 'import numpy as np\n'), ((46529, 46558), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (46549, 46558), True, 'import tensorflow.compat.v1 as tf\n'), ((47056, 47115), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(image_height, image_width, 3)'}), '(256, size=(image_height, image_width, 3))\n', (47073, 47115), True, 'import numpy as np\n'), ((47318, 47387), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': '(num_instances, image_height, image_width)'}), '(2, size=(num_instances, image_height, image_width))\n', (47335, 47387), True, 'import numpy as np\n'), ((47585, 47627), 'numpy.random.randint', 'np.random.randint', (['(100)'], {'size': 'num_instances'}), '(100, size=num_instances)\n', (47602, 47627), True, 'import numpy as np\n'), ((48574, 48603), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (48594, 48603), True, 'import tensorflow.compat.v1 as tf\n'), ((49387, 49446), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(image_height, image_width, 3)'}), '(256, size=(image_height, image_width, 3))\n', (49404, 49446), True, 'import numpy as np\n'), ((49649, 49718), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': '(num_instances, image_height, image_width)'}), '(2, size=(num_instances, image_height, image_width))\n', (49666, 49718), True, 'import numpy as np\n'), ((49916, 49958), 'numpy.random.randint', 'np.random.randint', (['(100)'], {'size': 'num_instances'}), '(100, size=num_instances)\n', (49933, 49958), True, 'import numpy as np\n'), ((50868, 50897), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (50888, 50897), True, 'import tensorflow.compat.v1 as tf\n'), ((51110, 51148), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (51127, 51148), True, 'import numpy as np\n'), ((51746, 51775), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (51766, 51775), True, 'import tensorflow.compat.v1 as tf\n'), ((52785, 52820), 'tensorflow.compat.v1.gfile.Open', 'tf.gfile.Open', (['label_map_path', '"""wb"""'], {}), "(label_map_path, 'wb')\n", (52798, 52820), True, 'import tensorflow.compat.v1 as tf\n'), ((53005, 53034), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (53025, 53034), True, 'import tensorflow.compat.v1 as tf\n'), ((53350, 53388), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (53367, 53388), True, 'import numpy as np\n'), ((54913, 54942), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (54933, 54942), True, 'import tensorflow.compat.v1 as tf\n'), ((55352, 55390), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (55369, 55390), True, 'import numpy as np\n'), ((56879, 56908), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (56899, 56908), True, 'import tensorflow.compat.v1 as tf\n'), ((57751, 57789), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (57768, 57789), True, 'import numpy as np\n'), ((59611, 59640), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (59631, 59640), True, 'import tensorflow.compat.v1 as tf\n'), ((59705, 59764), 'numpy.vstack', 'np.vstack', (['[bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs]'], {}), '([bbox_ymins, bbox_xmins, bbox_ymaxs, bbox_xmaxs])\n', (59714, 59764), True, 'import numpy as np\n'), ((60809, 60847), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (60826, 60847), True, 'import numpy as np\n'), ((63008, 63037), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (63028, 63037), True, 'import tensorflow.compat.v1 as tf\n'), ((64431, 64469), 'numpy.random.randint', 'np.random.randint', (['(256)'], {'size': '(4, 5, 3)'}), '(256, size=(4, 5, 3))\n', (64448, 64469), True, 'import numpy as np\n'), ((65781, 65810), 'tensorflow.compat.v1.convert_to_tensor', 'tf.convert_to_tensor', (['example'], {}), '(example)\n', (65801, 65810), True, 'import tensorflow.compat.v1 as tf\n'), ((19360, 19389), 'numpy.array', 'np.array', (['keypoint_visibility'], {}), '(keypoint_visibility)\n', (19368, 19389), True, 'import numpy as np\n'), ((21789, 21826), 'numpy.vstack', 'np.vstack', (['[keypoint_ys, keypoint_xs]'], {}), '([keypoint_ys, keypoint_xs])\n', (21798, 21826), True, 'import numpy as np\n'), ((2282, 2322), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (2308, 2322), False, 'from object_detection.utils import dataset_util\n'), ((2401, 2466), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['([encoded_additional_channel] * 2)'], {}), '([encoded_additional_channel] * 2)\n', (2432, 2466), False, 'from object_detection.utils import dataset_util\n'), ((3487, 3527), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (3513, 3527), False, 'from object_detection.utils import dataset_util\n'), ((4920, 4960), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (4946, 4960), False, 'from object_detection.utils import dataset_util\n'), ((5924, 5963), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_png'], {}), '(encoded_png)\n', (5950, 5963), False, 'from object_detection.utils import dataset_util\n'), ((7872, 7911), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_png'], {}), '(encoded_png)\n', (7898, 7911), False, 'from object_detection.utils import dataset_util\n'), ((8072, 8118), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['encoded_masks'], {}), '(encoded_masks)\n', (8103, 8118), False, 'from object_detection.utils import dataset_util\n'), ((8949, 8988), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_png'], {}), '(encoded_png)\n', (8975, 8988), False, 'from object_detection.utils import dataset_util\n'), ((9149, 9195), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['encoded_masks'], {}), '(encoded_masks)\n', (9180, 9195), False, 'from object_detection.utils import dataset_util\n'), ((9253, 9283), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['(10)'], {}), '(10)\n', (9279, 9283), False, 'from object_detection.utils import dataset_util\n'), ((9340, 9370), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['(10)'], {}), '(10)\n', (9366, 9370), False, 'from object_detection.utils import dataset_util\n'), ((10294, 10334), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (10320, 10334), False, 'from object_detection.utils import dataset_util\n'), ((10501, 10544), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (10532, 10544), False, 'from object_detection.utils import dataset_util\n'), ((10612, 10655), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (10643, 10655), False, 'from object_detection.utils import dataset_util\n'), ((10723, 10766), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (10754, 10766), False, 'from object_detection.utils import dataset_util\n'), ((10834, 10877), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (10865, 10877), False, 'from object_detection.utils import dataset_util\n'), ((12257, 12297), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (12283, 12297), False, 'from object_detection.utils import dataset_util\n'), ((12464, 12507), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (12495, 12507), False, 'from object_detection.utils import dataset_util\n'), ((12575, 12618), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (12606, 12618), False, 'from object_detection.utils import dataset_util\n'), ((12686, 12729), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (12717, 12729), False, 'from object_detection.utils import dataset_util\n'), ((12797, 12840), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (12828, 12840), False, 'from object_detection.utils import dataset_util\n'), ((12909, 12953), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_ys'], {}), '(keypoint_ys)\n', (12940, 12953), False, 'from object_detection.utils import dataset_util\n'), ((13022, 13066), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_xs'], {}), '(keypoint_xs)\n', (13053, 13066), False, 'from object_detection.utils import dataset_util\n'), ((13135, 13183), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_depths'], {}), '(keypoint_depths)\n', (13166, 13183), False, 'from object_detection.utils import dataset_util\n'), ((13260, 13315), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_depth_weights'], {}), '(keypoint_depth_weights)\n', (13291, 13315), False, 'from object_detection.utils import dataset_util\n'), ((13393, 13445), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['keypoint_visibility'], {}), '(keypoint_visibility)\n', (13424, 13445), False, 'from object_detection.utils import dataset_util\n'), ((15096, 15136), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (15122, 15136), False, 'from object_detection.utils import dataset_util\n'), ((15303, 15346), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (15334, 15346), False, 'from object_detection.utils import dataset_util\n'), ((15414, 15457), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (15445, 15457), False, 'from object_detection.utils import dataset_util\n'), ((15525, 15568), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (15556, 15568), False, 'from object_detection.utils import dataset_util\n'), ((15636, 15679), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (15667, 15679), False, 'from object_detection.utils import dataset_util\n'), ((15748, 15792), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_ys'], {}), '(keypoint_ys)\n', (15779, 15792), False, 'from object_detection.utils import dataset_util\n'), ((15861, 15905), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_xs'], {}), '(keypoint_xs)\n', (15892, 15905), False, 'from object_detection.utils import dataset_util\n'), ((15983, 16035), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['keypoint_visibility'], {}), '(keypoint_visibility)\n', (16014, 16035), False, 'from object_detection.utils import dataset_util\n'), ((17329, 17369), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (17355, 17369), False, 'from object_detection.utils import dataset_util\n'), ((17536, 17579), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (17567, 17579), False, 'from object_detection.utils import dataset_util\n'), ((17647, 17690), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (17678, 17690), False, 'from object_detection.utils import dataset_util\n'), ((17758, 17801), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (17789, 17801), False, 'from object_detection.utils import dataset_util\n'), ((17869, 17912), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (17900, 17912), False, 'from object_detection.utils import dataset_util\n'), ((17981, 18025), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_ys'], {}), '(keypoint_ys)\n', (18012, 18025), False, 'from object_detection.utils import dataset_util\n'), ((18094, 18138), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_xs'], {}), '(keypoint_xs)\n', (18125, 18138), False, 'from object_detection.utils import dataset_util\n'), ((18216, 18268), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['keypoint_visibility'], {}), '(keypoint_visibility)\n', (18247, 18268), False, 'from object_detection.utils import dataset_util\n'), ((20142, 20182), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (20168, 20182), False, 'from object_detection.utils import dataset_util\n'), ((20349, 20392), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (20380, 20392), False, 'from object_detection.utils import dataset_util\n'), ((20460, 20503), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (20491, 20503), False, 'from object_detection.utils import dataset_util\n'), ((20571, 20614), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (20602, 20614), False, 'from object_detection.utils import dataset_util\n'), ((20682, 20725), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (20713, 20725), False, 'from object_detection.utils import dataset_util\n'), ((20794, 20838), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_ys'], {}), '(keypoint_ys)\n', (20825, 20838), False, 'from object_detection.utils import dataset_util\n'), ((20907, 20951), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['keypoint_xs'], {}), '(keypoint_xs)\n', (20938, 20951), False, 'from object_detection.utils import dataset_util\n'), ((22657, 22697), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (22683, 22697), False, 'from object_detection.utils import dataset_util\n'), ((22864, 22907), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (22895, 22907), False, 'from object_detection.utils import dataset_util\n'), ((22975, 23018), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (23006, 23018), False, 'from object_detection.utils import dataset_util\n'), ((23086, 23129), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (23117, 23129), False, 'from object_detection.utils import dataset_util\n'), ((23197, 23240), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (23228, 23240), False, 'from object_detection.utils import dataset_util\n'), ((24168, 24208), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (24194, 24208), False, 'from object_detection.utils import dataset_util\n'), ((24377, 24422), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['bbox_classes'], {}), '(bbox_classes)\n', (24408, 24422), False, 'from object_detection.utils import dataset_util\n'), ((25481, 25521), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (25507, 25521), False, 'from object_detection.utils import dataset_util\n'), ((25702, 25762), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['flattened_multiclass_scores'], {}), '(flattened_multiclass_scores)\n', (25733, 25762), False, 'from object_detection.utils import dataset_util\n'), ((25857, 25900), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (25888, 25900), False, 'from object_detection.utils import dataset_util\n'), ((25968, 26011), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (25999, 26011), False, 'from object_detection.utils import dataset_util\n'), ((26079, 26122), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (26110, 26122), False, 'from object_detection.utils import dataset_util\n'), ((26190, 26233), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (26221, 26233), False, 'from object_detection.utils import dataset_util\n'), ((27121, 27161), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (27147, 27161), False, 'from object_detection.utils import dataset_util\n'), ((27328, 27371), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (27359, 27371), False, 'from object_detection.utils import dataset_util\n'), ((27439, 27482), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (27470, 27482), False, 'from object_detection.utils import dataset_util\n'), ((27550, 27593), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (27581, 27593), False, 'from object_detection.utils import dataset_util\n'), ((27661, 27704), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (27692, 27704), False, 'from object_detection.utils import dataset_util\n'), ((28467, 28507), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (28493, 28507), False, 'from object_detection.utils import dataset_util\n'), ((28676, 28721), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['bbox_classes'], {}), '(bbox_classes)\n', (28707, 28721), False, 'from object_detection.utils import dataset_util\n'), ((30164, 30204), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (30190, 30204), False, 'from object_detection.utils import dataset_util\n'), ((30372, 30422), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (30403, 30422), False, 'from object_detection.utils import dataset_util\n'), ((30492, 30547), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['annotated_bbox_classes'], {}), '(annotated_bbox_classes)\n', (30523, 30547), False, 'from object_detection.utils import dataset_util\n'), ((31715, 31755), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (31741, 31755), False, 'from object_detection.utils import dataset_util\n'), ((31923, 31973), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (31954, 31973), False, 'from object_detection.utils import dataset_util\n'), ((33301, 33341), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (33327, 33341), False, 'from object_detection.utils import dataset_util\n'), ((33509, 33559), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (33540, 33559), False, 'from object_detection.utils import dataset_util\n'), ((34952, 34992), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (34978, 34992), False, 'from object_detection.utils import dataset_util\n'), ((35160, 35210), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (35191, 35210), False, 'from object_detection.utils import dataset_util\n'), ((35280, 35328), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['bbox_classes_id'], {}), '(bbox_classes_id)\n', (35311, 35328), False, 'from object_detection.utils import dataset_util\n'), ((36544, 36584), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (36570, 36584), False, 'from object_detection.utils import dataset_util\n'), ((36752, 36802), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (36783, 36802), False, 'from object_detection.utils import dataset_util\n'), ((38081, 38121), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (38107, 38121), False, 'from object_detection.utils import dataset_util\n'), ((38283, 38327), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['object_area'], {}), '(object_area)\n', (38314, 38327), False, 'from object_detection.utils import dataset_util\n'), ((39217, 39257), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (39243, 39257), False, 'from object_detection.utils import dataset_util\n'), ((39424, 39473), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['neg_category_ids'], {}), '(neg_category_ids)\n', (39455, 39473), False, 'from object_detection.utils import dataset_util\n'), ((40273, 40313), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (40299, 40313), False, 'from object_detection.utils import dataset_util\n'), ((40491, 40551), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['not_exhaustive_category_ids'], {}), '(not_exhaustive_category_ids)\n', (40522, 40551), False, 'from object_detection.utils import dataset_util\n'), ((41369, 41409), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (41395, 41409), False, 'from object_detection.utils import dataset_util\n'), ((41575, 41623), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['object_is_crowd'], {}), '(object_is_crowd)\n', (41606, 41623), False, 'from object_detection.utils import dataset_util\n'), ((42562, 42602), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (42588, 42602), False, 'from object_detection.utils import dataset_util\n'), ((42769, 42818), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['object_difficult'], {}), '(object_difficult)\n', (42800, 42818), False, 'from object_detection.utils import dataset_util\n'), ((43757, 43797), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (43783, 43797), False, 'from object_detection.utils import dataset_util\n'), ((43963, 44011), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['object_group_of'], {}), '(object_group_of)\n', (43994, 44011), False, 'from object_detection.utils import dataset_util\n'), ((44950, 44990), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (44976, 44990), False, 'from object_detection.utils import dataset_util\n'), ((45154, 45201), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['object_weights'], {}), '(object_weights)\n', (45185, 45201), False, 'from object_detection.utils import dataset_util\n'), ((46132, 46172), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (46158, 46172), False, 'from object_detection.utils import dataset_util\n'), ((46339, 46388), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['class_confidence'], {}), '(class_confidence)\n', (46370, 46388), False, 'from object_detection.utils import dataset_util\n'), ((47830, 47870), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (47856, 47870), False, 'from object_detection.utils import dataset_util\n'), ((48027, 48067), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['image_height'], {}), '(image_height)\n', (48053, 48067), False, 'from object_detection.utils import dataset_util\n'), ((48124, 48163), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['image_width'], {}), '(image_width)\n', (48150, 48163), False, 'from object_detection.utils import dataset_util\n'), ((48226, 48283), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['instance_masks_flattened'], {}), '(instance_masks_flattened)\n', (48257, 48283), False, 'from object_detection.utils import dataset_util\n'), ((48353, 48400), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['object_classes'], {}), '(object_classes)\n', (48384, 48400), False, 'from object_detection.utils import dataset_util\n'), ((50161, 50201), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (50187, 50201), False, 'from object_detection.utils import dataset_util\n'), ((50358, 50398), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['image_height'], {}), '(image_height)\n', (50384, 50398), False, 'from object_detection.utils import dataset_util\n'), ((50455, 50494), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['image_width'], {}), '(image_width)\n', (50481, 50494), False, 'from object_detection.utils import dataset_util\n'), ((50557, 50614), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['instance_masks_flattened'], {}), '(instance_masks_flattened)\n', (50588, 50614), False, 'from object_detection.utils import dataset_util\n'), ((50684, 50731), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['object_classes'], {}), '(object_classes)\n', (50715, 50731), False, 'from object_detection.utils import dataset_util\n'), ((51411, 51451), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (51437, 51451), False, 'from object_detection.utils import dataset_util\n'), ((51569, 51608), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['[1, 2]'], {}), '([1, 2])\n', (51600, 51608), False, 'from object_detection.utils import dataset_util\n'), ((52208, 52248), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (52234, 52248), False, 'from object_detection.utils import dataset_util\n'), ((53913, 53953), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (53939, 53953), False, 'from object_detection.utils import dataset_util\n'), ((54120, 54169), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['context_features'], {}), '(context_features)\n', (54151, 54169), False, 'from object_detection.utils import dataset_util\n'), ((54243, 54293), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['context_feature_length'], {}), '(context_feature_length)\n', (54269, 54293), False, 'from object_detection.utils import dataset_util\n'), ((54361, 54404), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (54392, 54404), False, 'from object_detection.utils import dataset_util\n'), ((54472, 54515), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (54503, 54515), False, 'from object_detection.utils import dataset_util\n'), ((54583, 54626), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (54614, 54626), False, 'from object_detection.utils import dataset_util\n'), ((54694, 54737), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (54725, 54737), False, 'from object_detection.utils import dataset_util\n'), ((55916, 55956), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (55942, 55956), False, 'from object_detection.utils import dataset_util\n'), ((56123, 56172), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['context_features'], {}), '(context_features)\n', (56154, 56172), False, 'from object_detection.utils import dataset_util\n'), ((56246, 56296), 'object_detection.utils.dataset_util.int64_feature', 'dataset_util.int64_feature', (['context_feature_length'], {}), '(context_feature_length)\n', (56272, 56296), False, 'from object_detection.utils import dataset_util\n'), ((56364, 56407), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (56395, 56407), False, 'from object_detection.utils import dataset_util\n'), ((56475, 56518), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (56506, 56518), False, 'from object_detection.utils import dataset_util\n'), ((56586, 56629), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (56617, 56629), False, 'from object_detection.utils import dataset_util\n'), ((56697, 56740), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (56728, 56740), False, 'from object_detection.utils import dataset_util\n'), ((58353, 58393), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (58379, 58393), False, 'from object_detection.utils import dataset_util\n'), ((58560, 58603), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (58591, 58603), False, 'from object_detection.utils import dataset_util\n'), ((58671, 58714), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (58702, 58714), False, 'from object_detection.utils import dataset_util\n'), ((58782, 58825), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (58813, 58825), False, 'from object_detection.utils import dataset_util\n'), ((58893, 58936), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (58924, 58936), False, 'from object_detection.utils import dataset_util\n'), ((59005, 59055), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['bbox_classes_text'], {}), '(bbox_classes_text)\n', (59036, 59055), False, 'from object_detection.utils import dataset_util\n'), ((59122, 59168), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['bbox_group_of'], {}), '(bbox_group_of)\n', (59153, 59168), False, 'from object_detection.utils import dataset_util\n'), ((59230, 59279), 'object_detection.utils.dataset_util.bytes_list_feature', 'dataset_util.bytes_list_feature', (['image_class_text'], {}), '(image_class_text)\n', (59261, 59279), False, 'from object_detection.utils import dataset_util\n'), ((59347, 59396), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['image_confidence'], {}), '(image_confidence)\n', (59378, 59396), False, 'from object_detection.utils import dataset_util\n'), ((61546, 61586), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (61572, 61586), False, 'from object_detection.utils import dataset_util\n'), ((61753, 61796), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (61784, 61796), False, 'from object_detection.utils import dataset_util\n'), ((61864, 61907), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (61895, 61907), False, 'from object_detection.utils import dataset_util\n'), ((61975, 62018), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (62006, 62018), False, 'from object_detection.utils import dataset_util\n'), ((62086, 62129), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (62117, 62129), False, 'from object_detection.utils import dataset_util\n'), ((62201, 62247), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['densepose_num'], {}), '(densepose_num)\n', (62232, 62247), False, 'from object_detection.utils import dataset_util\n'), ((62326, 62379), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['densepose_part_index'], {}), '(densepose_part_index)\n', (62357, 62379), False, 'from object_detection.utils import dataset_util\n'), ((62449, 62493), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['densepose_x'], {}), '(densepose_x)\n', (62480, 62493), False, 'from object_detection.utils import dataset_util\n'), ((62563, 62607), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['densepose_y'], {}), '(densepose_y)\n', (62594, 62607), False, 'from object_detection.utils import dataset_util\n'), ((62677, 62721), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['densepose_u'], {}), '(densepose_u)\n', (62708, 62721), False, 'from object_detection.utils import dataset_util\n'), ((62791, 62835), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['densepose_v'], {}), '(densepose_v)\n', (62822, 62835), False, 'from object_detection.utils import dataset_util\n'), ((64913, 64953), 'object_detection.utils.dataset_util.bytes_feature', 'dataset_util.bytes_feature', (['encoded_jpeg'], {}), '(encoded_jpeg)\n', (64939, 64953), False, 'from object_detection.utils import dataset_util\n'), ((65120, 65163), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymins'], {}), '(bbox_ymins)\n', (65151, 65163), False, 'from object_detection.utils import dataset_util\n'), ((65231, 65274), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmins'], {}), '(bbox_xmins)\n', (65262, 65274), False, 'from object_detection.utils import dataset_util\n'), ((65342, 65385), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_ymaxs'], {}), '(bbox_ymaxs)\n', (65373, 65385), False, 'from object_detection.utils import dataset_util\n'), ((65453, 65496), 'object_detection.utils.dataset_util.float_list_feature', 'dataset_util.float_list_feature', (['bbox_xmaxs'], {}), '(bbox_xmaxs)\n', (65484, 65496), False, 'from object_detection.utils import dataset_util\n'), ((65566, 65611), 'object_detection.utils.dataset_util.int64_list_feature', 'dataset_util.int64_list_feature', (['track_labels'], {}), '(track_labels)\n', (65597, 65611), False, 'from object_detection.utils import dataset_util\n'), ((2578, 2591), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (2583, 2591), False, 'import six\n'), ((2680, 2697), 'six.b', 'six.b', (['"""image_id"""'], {}), "('image_id')\n", (2685, 2697), False, 'import six\n'), ((3612, 3625), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (3617, 3625), False, 'import six\n'), ((3714, 3731), 'six.b', 'six.b', (['"""image_id"""'], {}), "('image_id')\n", (3719, 3731), False, 'import six\n'), ((5049, 5061), 'six.b', 'six.b', (['"""abc"""'], {}), "('abc')\n", (5054, 5061), False, 'import six\n'), ((5149, 5166), 'six.b', 'six.b', (['"""filename"""'], {}), "('filename')\n", (5154, 5166), False, 'import six\n'), ((6048, 6060), 'six.b', 'six.b', (['"""png"""'], {}), "('png')\n", (6053, 6060), False, 'import six\n'), ((6149, 6166), 'six.b', 'six.b', (['"""image_id"""'], {}), "('image_id')\n", (6154, 6166), False, 'import six\n'), ((7996, 8008), 'six.b', 'six.b', (['"""png"""'], {}), "('png')\n", (8001, 8008), False, 'import six\n'), ((9073, 9085), 'six.b', 'six.b', (['"""png"""'], {}), "('png')\n", (9078, 9085), False, 'import six\n'), ((10419, 10432), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (10424, 10432), False, 'import six\n'), ((12382, 12395), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (12387, 12395), False, 'import six\n'), ((15221, 15234), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (15226, 15234), False, 'import six\n'), ((17454, 17467), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (17459, 17467), False, 'import six\n'), ((20267, 20280), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (20272, 20280), False, 'import six\n'), ((22782, 22795), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (22787, 22795), False, 'import six\n'), ((24293, 24306), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (24298, 24306), False, 'import six\n'), ((25606, 25619), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (25611, 25619), False, 'import six\n'), ((27246, 27259), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (27251, 27259), False, 'import six\n'), ((28592, 28605), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (28597, 28605), False, 'import six\n'), ((30289, 30302), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (30294, 30302), False, 'import six\n'), ((31840, 31853), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (31845, 31853), False, 'import six\n'), ((33426, 33439), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (33431, 33439), False, 'import six\n'), ((35077, 35090), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (35082, 35090), False, 'import six\n'), ((36669, 36682), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (36674, 36682), False, 'import six\n'), ((38206, 38219), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (38211, 38219), False, 'import six\n'), ((39342, 39355), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (39347, 39355), False, 'import six\n'), ((40398, 40411), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (40403, 40411), False, 'import six\n'), ((41494, 41507), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (41499, 41507), False, 'import six\n'), ((42687, 42700), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (42692, 42700), False, 'import six\n'), ((43882, 43895), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (43887, 43895), False, 'import six\n'), ((45075, 45088), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (45080, 45088), False, 'import six\n'), ((46257, 46270), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (46262, 46270), False, 'import six\n'), ((47955, 47968), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (47960, 47968), False, 'import six\n'), ((50286, 50299), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (50291, 50299), False, 'import six\n'), ((51514, 51527), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (51519, 51527), False, 'import six\n'), ((52333, 52346), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (52338, 52346), False, 'import six\n'), ((54038, 54051), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (54043, 54051), False, 'import six\n'), ((56041, 56054), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (56046, 56054), False, 'import six\n'), ((58478, 58491), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (58483, 58491), False, 'import six\n'), ((61671, 61684), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (61676, 61684), False, 'import six\n'), ((65038, 65051), 'six.b', 'six.b', (['"""jpeg"""'], {}), "('jpeg')\n", (65043, 65051), False, 'import six\n'), ((52469, 52481), 'six.b', 'six.b', (['"""dog"""'], {}), "('dog')\n", (52474, 52481), False, 'import six\n'), ((52483, 52495), 'six.b', 'six.b', (['"""cat"""'], {}), "('cat')\n", (52488, 52495), False, 'import six\n')]