Exemple #1
0
def main():
    import argparse

    qid = os.environ.get('QUEUEID', None)
    parser = argparse.ArgumentParser(
        description='Fit cell from batch to model')
    parser.add_argument('cell', type=str, help='Batch ID containing data')
    parser.add_argument('batch', type=str, help='Cell ID to fit')
    parser.add_argument('--wcg_n', type=int, help='wcg rank', default=2)
    parser.add_argument('--fir_n', type=int, help='FIR ntaps', default=15)
    parser.add_argument('--shuffle-phase',
                        action='store_true',
                        help='Shuffle phase')
    parser.add_argument('--shuffle-stream',
                        action='store_true',
                        help='Shuffle stream')
    parser.add_argument('model',
                        type=str,
                        help='Model name (ignored)',
                        nargs='?')

    args = parser.parse_args()
    if qid is not None:
        db.update_job_start(qid)
        nems.utils.progress_fun = db.update_job_tick

    do_fit(args.batch, args.cell, args.wcg_n, args.fir_n, args.shuffle_phase,
           args.shuffle_stream)

    if qid is not None:
        db.update_job_complete(qid)
Exemple #2
0
            'eyelid_left_x': lx,
            'eyelid_left_y': ly,
            'eyelid_top_x': tx,
            'eyelid_top_y': ty,
            'eyelid_right_x': rx,
            'eyelid_right_y': ry,
            'eyelid_bottom_x': bx,
            'eyelid_bottom_y': by
        },
        'cnn_modelpath': modelpath
    }

    if os.path.isdir(save_path) != True:
        os.system("mkdir {}".format(save_path))
        os.system("chmod a+w {}".format(save_path))
        print("created new directory {0}".format(save_path))

    # make sure the directory is writeable
    os.system("chmod a+w {}".format(save_path))

    save_file = os.path.join(save_path, results_name)

    # write the results
    with open(save_file, 'wb') as fp:
                pickle.dump(results, fp, protocol=pickle.HIGHEST_PROTOCOL)

    log.info("finished fit")

    if queueid:
            nd.update_job_complete(queueid)