Files
@ dd45e200a0dc
Branch filter:
Location: OneEye/exp/kerokero/test.py - annotation
dd45e200a0dc
713 B
text/x-python
convolution neural network model
655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 655956f6ba89 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_dir")
args=parser.parse_args()
model=load_model(args.model)
print("loading data...")
((trainImages,trainLabels),(testImages,testLabels))=loadDataset(args.data_dir)
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()
|