import tensorflow as tf


                                    # Unnecessary, if you have already sorted when making tfrecord and no data augmentation.
                                    gtboxes_and_label_q = tf.py_func(func=re_order,
                                                                     inp=[tf.reshape(gtboxes_and_label_q, [-1, 9]), True],
                                                                     Tout=[tf.float32])
                                    gtboxes_and_label_q = tf.reshape(gtboxes_and_label_q, [cfgs.BATCH_SIZE, -1, 9])

                                    img = inputs_list[i][0]
                                    img_shape = inputs_list[i][-2:]
                                    h_crop = tf.reduce_max(img_shape[0])
                                    w_crop = tf.reduce_max(img_shape[1])
                                    img = tf.image.crop_to_bounding_box(image=img,
                                                                        offset_height=0,
                                                                        offset_width=0,
                                                                        target_height=tf.cast(h_crop, tf.int32),
                                                                        target_width=tf.cast(w_crop, tf.int32))

                                    outputs = fcos.build_whole_detection_network(input_img_batch=img,
