(dataset_name, batch_size, shortside_len, is_training)
return img_name_batch, img_batch, gtboxes_and_label_batch, num_obs_batch, img_h_batch, img_w_batch
:return:
    img_name_batch: shape(1, 1)
    img_batch: shape:(1, new_imgH, new_imgW, C)
    gtboxes_and_label_batch: shape(1, Num_Of_objects, 5] .each row is [x1, y1, x2, y2, label]
:return:
    img_name_batch: shape(1, 1)
    img_batch: shape:(1, new_imgH, new_imgW, C)
    gtboxes_and_label_batch: shape(1, Num_Of_objects, 5] .each row is [x1, y1, x2, y2, label]
: return : img_name_batch : shape ( 1 1 ) img_batch : shape : ( 1 new_imgH new_imgW C ) gtboxes_and_label_batch : shape ( 1 Num_Of_objects 5 ] . each row is [ x1 y1 x2 y2 label ]
def next_batch(dataset_name, batch_size, shortside_len, is_training):
    '''
    :return:
    img_name_batch: shape(1, 1)
    img_batch: shape:(1, new_imgH, new_imgW, C)
    gtboxes_and_label_batch: shape(1, Num_Of_objects, 5] .each row is [x1, y1, x2, y2, label]
    '''
    # assert batch_size == 1, "we only support batch_size is 1.We may support large batch_size in the future"

    valid_dataset= ['ship', 'ICDAR2015', 'pascal', 'coco', 'bdd100k', 'DOTA', 'DOTA800', 'DOTA600', 'HRSC2016']
    if dataset_name not in valid_dataset:
        raise ValueError('dataSet name must be in {}'.format(valid_dataset))

    if is_training:
        pattern = os.path.join('../data/tfrecord', dataset_name + '_train*')
    else:
        pattern = os.path.join('../data/tfrecord', dataset_name + '_test*')

    print('tfrecord path is -->', os.path.abspath(pattern))

    filename_tensorlist = tf.train.match_filenames_once(pattern)

    filename_queue = tf.train.string_input_producer(filename_tensorlist)

    img_name, img, gtboxes_and_label, num_obs, img_h, img_w = read_and_prepocess_single_img(filename_queue, shortside_len,
                                                                                            is_training=is_training)
    img_name_batch, img_batch, gtboxes_and_label_batch, num_obs_batch, img_h_batch, img_w_batch = \
        tf.train.batch(
                       [img_name, img, gtboxes_and_label, num_obs, img_h, img_w],
                       batch_size=batch_size,
                       capacity=16,
                       num_threads=16,
                       dynamic_pad=True)

    return img_name_batch, img_batch, gtboxes_and_label_batch, num_obs_batch, img_h_batch, img_w_batch
def next_batch ( dataset_name , batch_size , shortside_len , is_training ) : # assert batch_size == 1, "we only support batch_size is 1.We may support large batch_size in the future" valid_dataset = [ 'ship' , 'ICDAR2015' , 'pascal' , 'coco' , 'bdd100k' , 'DOTA' , 'DOTA800' , 'DOTA600' , 'HRSC2016' ] if dataset_name not in valid_dataset : raise ValueError ( 'dataSet name must be in {}' . format ( valid_dataset ) ) if is_training : pattern = os . path . join ( '../data/tfrecord' , dataset_name + '_train*' ) else : pattern = os . path . join ( '../data/tfrecord' , dataset_name + '_test*' ) print ( 'tfrecord path is -->' , os . path . abspath ( pattern ) ) filename_tensorlist = tf . train . match_filenames_once ( pattern ) filename_queue = tf . train . string_input_producer ( filename_tensorlist ) img_name , img , gtboxes_and_label , num_obs , img_h , img_w = read_and_prepocess_single_img ( filename_queue , shortside_len , is_training = is_training ) img_name_batch , img_batch , gtboxes_and_label_batch , num_obs_batch , img_h_batch , img_w_batch = tf . train . batch ( [ img_name , img , gtboxes_and_label , num_obs , img_h , img_w ] , batch_size = batch_size , capacity = 16 , num_threads = 16 , dynamic_pad = True ) return img_name_batch , img_batch , gtboxes_and_label_batch , num_obs_batch , img_h_batch , img_w_batch