質問編集履歴
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -65,7 +65,7 @@
|
|
65
65
|
try:
|
66
66
|
img_array = cv2.imread(os.path.join(path, image_name),) # 画像読み込み
|
67
67
|
img_resize_array = cv2.resize(img_array, (583, 438)) # 画像のリサイズ
|
68
|
-
|
68
|
+
train_data.append([img_resize_array, class_num]) # 画像データ、ラベル情報を追加
|
69
69
|
except Exception as e:
|
70
70
|
print(e)
|
71
71
|
|
2
コードの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -132,7 +132,7 @@
|
|
132
132
|
x_test = x_test.astype('float32') / 255
|
133
133
|
|
134
134
|
#学習データ
|
135
|
-
x_train_sum,
|
135
|
+
x_train_sum, x_train_c, x_train_b, x_test_c, x_test_b, = [], [], [], [], []
|
136
136
|
y_train_sum = []
|
137
137
|
|
138
138
|
for i in range(len(x_train)):
|
1
コードの変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -67,7 +67,7 @@
|
|
67
67
|
img_resize_array = cv2.resize(img_array, (583, 438)) # 画像のリサイズ
|
68
68
|
training_data.append([img_resize_array, class_num]) # 画像データ、ラベル情報を追加
|
69
69
|
except Exception as e:
|
70
|
-
|
70
|
+
print(e)
|
71
71
|
|
72
72
|
for class_num, category in enumerate(CATEGORIES):
|
73
73
|
path = os.path.join(DATADIR_test, category)
|
@@ -77,7 +77,7 @@
|
|
77
77
|
img_resize_array = cv2.resize(img_array, (583, 438)) # 画像のリサイズ
|
78
78
|
test_data.append([img_resize_array, class_num]) # 画像データ、ラベル情報を追加
|
79
79
|
except Exception as e:
|
80
|
-
|
80
|
+
print(e)
|
81
81
|
|
82
82
|
random.shuffle(test_data) # データをシャッフル
|
83
83
|
x_test = [] # 画像データ
|