|
31 | 31 | # valid_path = '../large_files/blood_cell_images/TEST'
|
32 | 32 |
|
33 | 33 | # https://www.kaggle.com/moltean/fruits
|
34 |
| -# train_path = '../large_files/fruits-360/Training' |
35 |
| -# valid_path = '../large_files/fruits-360/Validation' |
36 |
| -train_path = '../large_files/fruits-360-small/Training' |
37 |
| -valid_path = '../large_files/fruits-360-small/Validation' |
| 34 | +train_path = '../large_files/fruits-360/Training' |
| 35 | +valid_path = '../large_files/fruits-360/Validation' |
| 36 | +# train_path = '../large_files/fruits-360-small/Training' |
| 37 | +# valid_path = '../large_files/fruits-360-small/Validation' |
38 | 38 |
|
39 | 39 | # useful for getting number of files
|
40 | 40 | image_files = glob(train_path + '/*/*.jp*g')
|
|
45 | 45 |
|
46 | 46 |
|
47 | 47 | # look at an image for fun
|
48 |
| -plt.imshow(image.load_img(np.random.choice(image_files))) |
| 48 | +plt.imshow(image.img_to_array(image.load_img(np.random.choice(image_files))).astype('uint8')) |
49 | 49 | plt.show()
|
50 | 50 |
|
51 | 51 |
|
|
76 | 76 | )
|
77 | 77 |
|
78 | 78 |
|
79 |
| - |
80 | 79 | # create an instance of ImageDataGenerator
|
81 | 80 | gen = ImageDataGenerator(
|
82 | 81 | rotation_range=20,
|
@@ -172,8 +171,8 @@ def get_confusion_matrix(data_path, N):
|
172 | 171 | plt.show()
|
173 | 172 |
|
174 | 173 | # accuracies
|
175 |
| -plt.plot(r.history['acc'], label='train acc') |
176 |
| -plt.plot(r.history['val_acc'], label='val acc') |
| 174 | +plt.plot(r.history['accuracy'], label='train acc') |
| 175 | +plt.plot(r.history['val_accuracy'], label='val acc') |
177 | 176 | plt.legend()
|
178 | 177 | plt.show()
|
179 | 178 |
|
|
0 commit comments