# Path: object_detection/utils/dataset_util.py
# def int64_feature(value):
# def int64_list_feature(value):
# def bytes_feature(value):
# def bytes_list_feature(value):
# def float_list_feature(value):
# def read_examples_list(path):
# def recursive_parse_xml_to_dict(xml):


import hashlib
import io
import PIL.Image
import os
import tensorflow as tf
from object_detection.utils import dataset_util
    from object_detection.create_dataset import label_map_dict
    encoded_jpg_io = io.BytesIO(encoded_jpg)
    image = PIL.Image.open(encoded_jpg_io)
    if image.format != 'JPEG':
        raise ValueError('Image format not JPEG')
    key = hashlib.sha256(encoded_jpg).hexdigest()

    width = img['width']
    height = img['height']

    xmin = []
    ymin = []
    xmax = []
    ymax = []
    classes = []
    classes_text = []
    truncated = []
    poses = []
    difficult_obj = []
    for obj in data['detections']:
        difficult_obj.append(obj.get('difficult', False))  # TODO(SS): not being parsed
        truncated.append(0)  # not parsed
        poses.append(obj.get('poses', 'Unspecified').encode('utf-8'))  # not parsed
        xmin.append(obj['left'] / width)
        ymin.append(obj['bottom'] / height)
        xmax.append(obj['right'] / width)
        ymax.append(obj['top'] / height)
        classes_text.append(obj['label'].lower().encode('utf8'))
        classes.append(label_map_dict[obj['label'].lower()])
    filename = os.path.basename(img_path).encode('utf8')
    example = tf.train.Example(features=tf.train.Features(feature={

# Path: object_detection/utils/dataset_util.py
# def int64_feature(value):
# def int64_list_feature(value):
# def bytes_feature(value):
# def bytes_list_feature(value):
# def float_list_feature(value):
# def read_examples_list(path):
# def recursive_parse_xml_to_dict(xml):


# Path: object_detection/vod_converter/tf_record.py
import hashlib
import io
import PIL.Image
import os
import tensorflow as tf
from object_detection.utils import dataset_util
    from object_detection.create_dataset import label_map_dict

    encoded_jpg_io = io.BytesIO(encoded_jpg)
    image = PIL.Image.open(encoded_jpg_io)
    if image.format != 'JPEG':
        raise ValueError('Image format not JPEG')
    key = hashlib.sha256(encoded_jpg).hexdigest()

    width = img['width']
    height = img['height']

    xmin = []
    ymin = []
    xmax = []
    ymax = []
    classes = []
    classes_text = []
    truncated = []
    poses = []
    difficult_obj = []
    for obj in data['detections']:
        difficult_obj.append(obj.get('difficult', False))  # TODO(SS): not being parsed
        truncated.append(0)  # not parsed
        poses.append(obj.get('poses', 'Unspecified').encode('utf-8'))  # not parsed
        xmin.append(obj['left'] / width)
        ymin.append(obj['bottom'] / height)
        xmax.append(obj['right'] / width)
        ymax.append(obj['top'] / height)
        classes_text.append(obj['label'].lower().encode('utf8'))
        classes.append(label_map_dict[obj['label'].lower()])
    filename = os.path.basename(img_path).encode('utf8')
    example = tf.train.Example(features=tf.train.Features(feature={

        'image/height': dataset_util.int64_feature(height),