match_rcnn/mmdetection/tools/prepare_img_meta.py
def pos_pair_statistic(pos_pair_dict_path):
    '''
    display the frequency of positive-paired images of each image
    '''
    with open(pos_pair_dict_path, 'r') as f:
        pos_pair_dict = json.load(f)

    freq_pos_dict = {}
    for k in list(pos_pair_dict.keys()):
        if len(pos_pair_dict[k]) not in list(freq_pos_dict.keys()):
            freq_pos_dict[len(pos_pair_dict[k])] = 1
        else:
            freq_pos_dict[len(pos_pair_dict[k])] += 1
            # if len(pos_pair_dict[k]) == 21:
            #     print(k,':', pos_pair_dict[k])

    fig = plt.figure(figsize=(12,12))
    x = list(freq_pos_dict.keys())
    y = list(freq_pos_dict.values())
    plt.bar(x, y)
    for a, b in zip(x,y):
        plt.text(a, b + 0.05, '%.0f' % b, ha='center', va='bottom', fontsize=10)

    plt.xticks(x)
    plt.xlabel("The number of positive-paired images")
    plt.ylabel("Frequency of images")
    plt.show()

    display the frequency of positive-paired images of each image
    
display the frequency of positive-paired images of each image
display the frequency of positive - paired images of each image
def pos_pair_statistic(pos_pair_dict_path):
    with open(pos_pair_dict_path, 'r') as f:
        pos_pair_dict = json.load(f)
    freq_pos_dict = {}
    for k in list(pos_pair_dict.keys()):
        if len(pos_pair_dict[k]) not in list(freq_pos_dict.keys()):
            freq_pos_dict[len(pos_pair_dict[k])] = 1
        else:
            freq_pos_dict[len(pos_pair_dict[k])] += 1
    fig = plt.figure(figsize=(12,12))
    x = list(freq_pos_dict.keys())
    y = list(freq_pos_dict.values())
    plt.bar(x, y)
    for a, b in zip(x,y):
        plt.text(a, b + 0.05, '%.0f' % b, ha='center', va='bottom', fontsize=10)
    plt.xticks(x)
    plt.xlabel("The number of positive-paired images")
    plt.ylabel("Frequency of images")
    plt.show()
def pos_pair_statistic ( pos_pair_dict_path ) : with open ( pos_pair_dict_path , 'r' ) as f : pos_pair_dict = json . load ( f ) freq_pos_dict = { } for k in list ( pos_pair_dict . keys ( ) ) : if len ( pos_pair_dict [ k ] ) not in list ( freq_pos_dict . keys ( ) ) : freq_pos_dict [ len ( pos_pair_dict [ k ] ) ] = 1 else : freq_pos_dict [ len ( pos_pair_dict [ k ] ) ] += 1 fig = plt . figure ( figsize = ( 12 , 12 ) ) x = list ( freq_pos_dict . keys ( ) ) y = list ( freq_pos_dict . values ( ) ) plt . bar ( x , y ) for a , b in zip ( x , y ) : plt . text ( a , b + 0.05 , '%.0f' % b , ha = 'center' , va = 'bottom' , fontsize = 10 ) plt . xticks ( x ) plt . xlabel ( "The number of positive-paired images" ) plt . ylabel ( "Frequency of images" ) plt . show ( )
display the frequency of positive-paired images of each image
display the frequency of positive - paired images of each image
'''
    display the frequency of positive-paired images of each image
    ''' # if len(pos_pair_dict[k]) == 21: #     print(k,':', pos_pair_dict[k])
pos_pair_dict_path