Esempio n. 1
0
def test_to_categorical_label():
    label = 'y'
    categorical_label = utils.to_categorical_label(label, 'Y vs D + N')
    assert categorical_label == 1
    label = 'd'
    categorical_label = utils.to_categorical_label(label, 'Y vs D + N')
    assert categorical_label == 0
    label = 'n'
    categorical_label = utils.to_categorical_label(label, 'Y + D vs N')
    assert categorical_label == 0
    label = 'y'
    categorical_label = utils.to_categorical_label(label, 'Y + D vs N')
    assert categorical_label == 1
Esempio n. 2
0
def couples_generator(images):
    for i in images:
        yield load_pair(i), utils.to_categorical_label(
            labels[i], args.classification_type)
Esempio n. 3
0
def couples_generator(images):
    for i in images:
        yield load_pair(i), utils.to_categorical_label(labels[i], 'Y vs D + N')