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
def couples_generator(images): for i in images: yield load_pair(i), utils.to_categorical_label( labels[i], args.classification_type)
def couples_generator(images): for i in images: yield load_pair(i), utils.to_categorical_label(labels[i], 'Y vs D + N')