(anchors, anchor_ratios, anchor_angles)
return ws, hs, anchor_angles
ratio = h /w
    :param anchors:
    :param anchor_ratios:
    :return:
ratio = h /w
    :param anchors:
    :param anchor_ratios:
    :return:
ratio = h / w : param anchors : : param anchor_ratios : : return :
def enum_ratios_and_thetas(anchors, anchor_ratios, anchor_angles):
    '''
    ratio = h /w
    :param anchors:
    :param anchor_ratios:
    :return:
    '''
    ws = anchors[:, 2]  # for base anchor: w == h
    hs = anchors[:, 3]
    anchor_angles = tf.constant(anchor_angles, tf.float32)
    sqrt_ratios = tf.sqrt(tf.constant(anchor_ratios))

    ws = tf.reshape(ws / sqrt_ratios[:, tf.newaxis], [-1])
    hs = tf.reshape(hs * sqrt_ratios[:, tf.newaxis], [-1])

    ws, _ = tf.meshgrid(ws, anchor_angles)
    hs, anchor_angles = tf.meshgrid(hs, anchor_angles)

    anchor_angles = tf.reshape(anchor_angles, [-1, 1])
    ws = tf.reshape(ws, [-1, 1])
    hs = tf.reshape(hs, [-1, 1])

    return ws, hs, anchor_angles
def enum_ratios_and_thetas ( anchors , anchor_ratios , anchor_angles ) : ws = anchors [ : , 2 ] # for base anchor: w == h hs = anchors [ : , 3 ] anchor_angles = tf . constant ( anchor_angles , tf . float32 ) sqrt_ratios = tf . sqrt ( tf . constant ( anchor_ratios ) ) ws = tf . reshape ( ws / sqrt_ratios [ : , tf . newaxis ] , [ - 1 ] ) hs = tf . reshape ( hs * sqrt_ratios [ : , tf . newaxis ] , [ - 1 ] ) ws , _ = tf . meshgrid ( ws , anchor_angles ) hs , anchor_angles = tf . meshgrid ( hs , anchor_angles ) anchor_angles = tf . reshape ( anchor_angles , [ - 1 , 1 ] ) ws = tf . reshape ( ws , [ - 1 , 1 ] ) hs = tf . reshape ( hs , [ - 1 , 1 ] ) return ws , hs , anchor_angles