# image visualization
    b_visualize = True

    # graph visualization
    b_plot = True
    save = True

    # weights
    pesi = '../weights_13_cpm_no_vgg_out_8BIT/weights.041-0.00920.hdf5'

    # model
    model = net(input_shape=(1, rows, cols), weights_path=pesi)

    # loading test names
    test_data_names = load_names(val_seq=2, augm=0, dataset=2)
    show = True
    thresold = 0.3
    TP = TN = FP = FN = FP_DIST = 0
    FPS = []
    TOTiou = []
    for image in range(len(test_data_names)):

        sys.stdout.write("\r%.2f%%" %
                         (((image + 1) / float(len(test_data_names))) * 100))
        sys.stdout.flush()
        seq = test_data_names[image]['image'].split('\\')[-3]
        frame = 0
        if checkBadFrame(seq, frame):
            print 'skipped', seq, frame
            continue
Example #2
0
    #limit_test = 10
    limit_test = -1
    b_debug = False
    fulldepth = False
    removeBackground = False
    equalize = False

    WEIGHT = 'weights'

    model = EyesStatusNet(input_shape=(1, rows, cols))

    model.summary()

    # loading training name

    train_data_names = load_names()
    random.shuffle(train_data_names)

    val_data_names = load_names_val()
    # Data augmentation
    if data_augmentation:
        for i in range(1, 9):
            tmp = load_names(augm=i)
            train_data_names = train_data_names + tmp

    # cut train
    random.shuffle(train_data_names)
    if limit_train == -1:
        limit_train = len(train_data_names)
    train_data_names = train_data_names[:limit_train]
    random.shuffle(val_data_names)
Example #3
0
    # image visualization
    b_visualize = True

    # graph visualization
    b_plot = True
    save = True

    # weights
    pesi = '..\weights\weights.018-0.13829.hdf5'

    # model
    model = EyesStatusNet(input_shape=(1, rows, cols), weights_path=pesi)

    # loading test sequence
    test_data_names = load_names(val_seq=-1)
    show = True
    contAccuracy = 0
    for image in range(len(test_data_names)):
        seq = test_data_names[image]['image'].split('\\')[-3]
        t = time.time()

        test_data_X, _ = load_images(test_data_names[image:image + 1],
                                     crop=b_crop,
                                     rescale=b_rescale,
                                     scale=b_scale,
                                     b_debug=False,
                                     normcv2=b_normcv2,
                                     rows=rows,
                                     fulldepth=False,
                                     cols=cols,
Example #4
0
    limit_test = 10

    #limit_test = -1
    b_debug = False
    fulldepth = False
    removeBackground = False
    equalize = False

    WEIGHT = 'weights'

    model = net(input_shape=(1, rows, cols))

    model.summary()

    # load train name
    train_data_names = load_names(dataset=0)
    train_data_names = train_data_names + load_names(dataset=1)
    # train_data_names = load_names(dataset=2)
    random.shuffle(train_data_names)
    # load validation name
    val_data_names = load_names_val()
    # data augmentation
    if data_augmentation:
        for i in range(1, 9):
            tmp = load_names(augm=i)
            train_data_names = train_data_names + tmp

    # train data cut
    random.shuffle(train_data_names)
    if limit_train == -1:
        limit_train = len(train_data_names)