(base_anchor_size, anchor_scales, anchor_ratios, anchor_angles,
                 featuremap_height, featuremap_width, stride, name='make_ratate_anchors')
:param base_anchor_size:
    :param anchor_scales:
    :param anchor_ratios:
    :param anchor_thetas:
    :param featuremap_height:
    :param featuremap_width:
    :param stride:
    :return:
:param base_anchor_size:
    :param anchor_scales:
    :param anchor_ratios:
    :param anchor_thetas:
    :param featuremap_height:
    :param featuremap_width:
    :param stride:
    :return:
: param base_anchor_size : : param anchor_scales : : param anchor_ratios : : param anchor_thetas : : param featuremap_height : : param featuremap_width : : param stride : : return :
def make_anchors(base_anchor_size, anchor_scales, anchor_ratios, anchor_angles,
                 featuremap_height, featuremap_width, stride, name='make_ratate_anchors'):


    '''
    :param base_anchor_size:
    :param anchor_scales:
    :param anchor_ratios:
    :param anchor_thetas:
    :param featuremap_height:
    :param featuremap_width:
    :param stride:
    :return:
    '''
    with tf.variable_scope(name):
        base_anchor = tf.constant([0, 0, base_anchor_size, base_anchor_size], tf.float32)  # [y_center, x_center, h, w]
        ws, hs, angles = enum_ratios_and_thetas(enum_scales(base_anchor, anchor_scales),
                                                anchor_ratios, anchor_angles)  # per locations ws and hs and thetas

        x_centers = tf.range(featuremap_width, dtype=tf.float32) * stride + stride // 2
        y_centers = tf.range(featuremap_height, dtype=tf.float32) * stride + stride // 2

        x_centers, y_centers = tf.meshgrid(x_centers, y_centers)

        angles, _ = tf.meshgrid(angles, x_centers)
        ws, x_centers = tf.meshgrid(ws, x_centers)
        hs, y_centers = tf.meshgrid(hs, y_centers)

        anchor_centers = tf.stack([x_centers, y_centers], 2)
        anchor_centers = tf.reshape(anchor_centers, [-1, 2])

        box_parameters = tf.stack([ws, hs, angles], axis=2)
        box_parameters = tf.reshape(box_parameters, [-1, 3])
        anchors = tf.concat([anchor_centers, box_parameters], axis=1)

        return anchors
def make_anchors ( base_anchor_size , anchor_scales , anchor_ratios , anchor_angles , featuremap_height , featuremap_width , stride , name = 'make_ratate_anchors' ) : with tf . variable_scope ( name ) : base_anchor = tf . constant ( [ 0 , 0 , base_anchor_size , base_anchor_size ] , tf . float32 ) # [y_center, x_center, h, w] ws , hs , angles = enum_ratios_and_thetas ( enum_scales ( base_anchor , anchor_scales ) , anchor_ratios , anchor_angles ) # per locations ws and hs and thetas x_centers = tf . range ( featuremap_width , dtype = tf . float32 ) * stride + stride // 2 y_centers = tf . range ( featuremap_height , dtype = tf . float32 ) * stride + stride // 2 x_centers , y_centers = tf . meshgrid ( x_centers , y_centers ) angles , _ = tf . meshgrid ( angles , x_centers ) ws , x_centers = tf . meshgrid ( ws , x_centers ) hs , y_centers = tf . meshgrid ( hs , y_centers ) anchor_centers = tf . stack ( [ x_centers , y_centers ] , 2 ) anchor_centers = tf . reshape ( anchor_centers , [ - 1 , 2 ] ) box_parameters = tf . stack ( [ ws , hs , angles ] , axis = 2 ) box_parameters = tf . reshape ( box_parameters , [ - 1 , 3 ] ) anchors = tf . concat ( [ anchor_centers , box_parameters ] , axis = 1 ) return anchors