debug build
This commit is contained in:
parent
f98bb5cbaa
commit
52d97f3c54
3 changed files with 5 additions and 6 deletions
8
image.c
8
image.c
|
|
@ -1,5 +1,3 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
@ -16,7 +14,7 @@ Image** import_images(char* image_file_string, char* label_file_string, int numb
|
||||||
if(image_file == NULL || label_file == NULL) {
|
if(image_file == NULL || label_file == NULL) {
|
||||||
printf("ERROR: File could not be opened! (import_images)");
|
printf("ERROR: File could not be opened! (import_images)");
|
||||||
}
|
}
|
||||||
|
char ch;
|
||||||
do {
|
do {
|
||||||
ch = fgetc(label_file);
|
ch = fgetc(label_file);
|
||||||
printf("%c", ch);
|
printf("%c", ch);
|
||||||
|
|
@ -33,7 +31,7 @@ Image** import_images(char* image_file_string, char* label_file_string, int numb
|
||||||
fclose(label_file);
|
fclose(label_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void img_print (Img* img) {
|
void img_print (Image* img) {
|
||||||
|
|
||||||
//print the image
|
//print the image
|
||||||
matrix_print(img->pixel_values);
|
matrix_print(img->pixel_values);
|
||||||
|
|
@ -42,6 +40,6 @@ void img_print (Img* img) {
|
||||||
printf("%d", img->image_label);
|
printf("%d", img->image_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void img_free (Img* img) {
|
void img_free (Image* img) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
image.h
1
image.h
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "matrix.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Matrix* pixel_values;
|
Matrix* pixel_values;
|
||||||
|
|
|
||||||
2
matrix.c
2
matrix.c
|
|
@ -265,5 +265,5 @@ Matrix* matrix_flatten(Matrix* matrix, int axis) {
|
||||||
else if (axis == 1) result_matrix->numbers[0][i * matrix->columns + j] = matrix->numbers[i][j];
|
else if (axis == 1) result_matrix->numbers[0][i * matrix->columns + j] = matrix->numbers[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mat;
|
return result_matrix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue