Files
@ 9483b964f560
Branch filter:
Location: OneEye/exp/kerokero/test.py - annotation
9483b964f560
791 B
text/x-python
saving and loading prepared data
655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 9483b964f560 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 9483b964f560 9483b964f560 9483b964f560 9483b964f560 9483b964f560 655956f6ba89 655956f6ba89 655956f6ba89 dd45e200a0dc 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 | import argparse
import numpy as np
from keras.models import load_model
from prepare_data import loadDataset,Sample
from analyzer.epoint import EPoint
from analyzer.corners import Corners
parser=argparse.ArgumentParser()
parser.add_argument("model")
parser.add_argument("data")
args=parser.parse_args()
model=load_model(args.model)
print("loading data...")
with np.load(args.data) as data:
trainImages=data["trainImages"]
trainLabels=data["trainLabels"]
testImages=data["testImages"]
testLabels=data["testLabels"]
print("done")
for img in testImages:
label=model.predict(np.reshape(img,(1,224,224,1)))
print(label)
points=[]
for i in range(4):
points.append(EPoint(label[0][i*2],label[0][i*2+1]))
corners=Corners(points)
sample=Sample(np.uint8(img),corners)
sample.show()
|