(image_data, labels, bboxes, shape, iscrowd)
return example
Build an Example proto for an image example.

    Args:
      image_data: string, JPEG encoding of RGB image;
      labels: list of integers, identifier for the ground truth;
      bboxes: list of bounding boxes; each box is a list of integers;
          specifying [xmin, ymin, xmax, ymax]. All boxes are assumed to belong
          to the same label as the image label.
      shape: 3 integers, image shapes in pixels.
    Returns:
      Example proto
Build an Example proto for an image example.
Build an Example proto for an image example .
def _convert_to_example(image_data, labels, bboxes, shape, iscrowd):
    """Build an Example proto for an image example.

    Args:
      image_data: string, JPEG encoding of RGB image;
      labels: list of integers, identifier for the ground truth;
      bboxes: list of bounding boxes; each box is a list of integers;
          specifying [xmin, ymin, xmax, ymax]. All boxes are assumed to belong
          to the same label as the image label.
      shape: 3 integers, image shapes in pixels.
    Returns:
      Example proto
    """
    xmin = []
    ymin = []
    xmax = []
    ymax = []
    for b in bboxes:
        assert len(b) == 4
        # pylint: disable=expression-not-assigned
        #          [(ymin_0, xmin_0, ymax_0, xmax_0), (ymin_1, xmin_1, ymax_1, xmax_1), ....]
        #                                            |
        # [ymin_0, ymin_1, ...], [xmin_0, xmin_1, ...], [ymax_0, ymax_1, ...], [xmax_0, xmax_1, ...]
        [l.append(point) for l, point in zip([ymin, xmin, ymax, xmax], b)]
        # pylint: enable=expression-not-assigned

    image_format = b'JPEG'
    example = tf.train.Example(features=tf.train.Features(feature={
            'image/height': int64_feature(shape[0]),
            'image/width': int64_feature(shape[1]),
            'image/channels': int64_feature(3),
            'image/shape': int64_feature([shape[0], shape[1], 3]),
            'image/object/bbox/xmin': float_feature(xmin),
            'image/object/bbox/xmax': float_feature(xmax),
            'image/object/bbox/ymin': float_feature(ymin),
            'image/object/bbox/ymax': float_feature(ymax),
            'image/object/bbox/label': int64_feature(labels),
            'image/object/bbox/iscrowd': int64_feature(iscrowd),
            'image/format': bytes_feature(image_format),
            'image/encoded': bytes_feature(image_data)}))
    return example
def _convert_to_example ( image_data , labels , bboxes , shape , iscrowd ) : xmin = [ ] ymin = [ ] xmax = [ ] ymax = [ ] for b in bboxes : assert len ( b ) == 4 # pylint: disable=expression-not-assigned #          [(ymin_0, xmin_0, ymax_0, xmax_0), (ymin_1, xmin_1, ymax_1, xmax_1), ....] #                                            | # [ymin_0, ymin_1, ...], [xmin_0, xmin_1, ...], [ymax_0, ymax_1, ...], [xmax_0, xmax_1, ...] [ l . append ( point ) for l , point in zip ( [ ymin , xmin , ymax , xmax ] , b ) ] # pylint: enable=expression-not-assigned image_format = b'JPEG' example = tf . train . Example ( features = tf . train . Features ( feature = { 'image/height' : int64_feature ( shape [ 0 ] ) , 'image/width' : int64_feature ( shape [ 1 ] ) , 'image/channels' : int64_feature ( 3 ) , 'image/shape' : int64_feature ( [ shape [ 0 ] , shape [ 1 ] , 3 ] ) , 'image/object/bbox/xmin' : float_feature ( xmin ) , 'image/object/bbox/xmax' : float_feature ( xmax ) , 'image/object/bbox/ymin' : float_feature ( ymin ) , 'image/object/bbox/ymax' : float_feature ( ymax ) , 'image/object/bbox/label' : int64_feature ( labels ) , 'image/object/bbox/iscrowd' : int64_feature ( iscrowd ) , 'image/format' : bytes_feature ( image_format ) , 'image/encoded' : bytes_feature ( image_data ) } ) ) return example