def db_insert_method(conn,  arch, weights, thresh, nms, commitid):
    """ Insert the method

    Args:
    conn(psycopg2.connection): open connection to the PG database
    framework(str): name of the framework (yolo, caffe, rcnn, ...)
    arch(str): architecture of the network (vgg16, alexnet, ...)
    weights(str): name of the weights file
    commitid(str): commit id of the method
    thresh(float): threshold of detections
    nms(float): non-maximal suppression parameter

    Returns:
    int: Method id
    """
    cur = conn.cursor()

    query = ''' INSERT INTO Method (framework, architecture, model, ''' \
            ''' thresh, nms, commitid) VALUES ('{}', '{}', '{}', ''' \
            ''' '{}','{}','{}'); SELECT currval('method_id_seq1') ''' \
            ''';'''.format('yolo', arch, weights, thresh, nms, commitid)
    cur.execute(query)
    return (cur.fetchone()[0])