mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-24 07:36:24 +01:00
Update main.c
This commit is contained in:
parent
95222fdf81
commit
fd7fe39e14
@ -211,6 +211,8 @@ void test(char* modele, char* fichier_images, char* fichier_labels, bool preview
|
|||||||
|
|
||||||
int* parameters = read_mnist_images_parameters(fichier_images);
|
int* parameters = read_mnist_images_parameters(fichier_images);
|
||||||
int nb_images = parameters[0];
|
int nb_images = parameters[0];
|
||||||
|
int width = parameters[1];
|
||||||
|
int height = parameters[2];
|
||||||
int*** images = read_mnist_images(fichier_images);
|
int*** images = read_mnist_images(fichier_images);
|
||||||
|
|
||||||
float** resultats = recognize(modele, fichier_images);
|
float** resultats = recognize(modele, fichier_images);
|
||||||
@ -222,7 +224,7 @@ void test(char* modele, char* fichier_images, char* fichier_labels, bool preview
|
|||||||
accuracy += 1. / (float)nb_images;
|
accuracy += 1. / (float)nb_images;
|
||||||
} else {
|
} else {
|
||||||
printf("--- Image %d, %d --- Prévision: %d ---\n", i, labels[i], indice_max(resultats[i], nb_der_layer));
|
printf("--- Image %d, %d --- Prévision: %d ---\n", i, labels[i], indice_max(resultats[i], nb_der_layer));
|
||||||
print_image(28, 28, images[i], resultats[i]);
|
print_image(width, height, images[i], resultats[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("%d Images\tAccuracy: %0.1f%%\n", nb_images, accuracy*100);
|
printf("%d Images\tAccuracy: %0.1f%%\n", nb_images, accuracy*100);
|
||||||
|
Loading…
Reference in New Issue
Block a user