-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_yTrue_yPred.py
32 lines (25 loc) · 925 Bytes
/
get_yTrue_yPred.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import glob
from single_prediction import single_prediction_from_folder
from math import floor
from dataframe import get_data_of_bearings
def get_yTrue_yPred():
y_True = []
y_Pred = []
for i in range(1, 208):
images = glob.glob('E:/project/validation_data/'+str(i)+'/*.png')
print(get_data_of_bearings(class_number=str(i)))
if get_data_of_bearings(class_number=str(i)) == 100:
if len(images) > 0:
for image in images:
image_conc = image[27:]
image_True = image_conc.split("-", 1)[0]
true = image_True[0:floor(len(image_True)/2)]
y_Pred.append(single_prediction_from_folder(image))
y_True.append(true)
print(y_Pred, y_True)
else:
pass
print(y_Pred)
print(y_True)
return y_Pred, y_True
get_yTrue_yPred()