from ruamel import yaml
from scipy import spatial
import ruamel.yaml
with open('trainer.txt') as fin:
    fin.readline()
    rfr =ruamel.yaml.round_trip_load(fin)
    x= rfr['opencv_lbphfaces']['histograms']
#print(rfr['opencv_lbphfaces']['histograms'])
with open('trainer1.txt') as fin:
    fin.readline()
    rfr1 = ruamel.yaml.round_trip_load(fin)
    y= rfr1['opencv_lbphfaces']['histograms']
#print(rfr1['opencv_lbphfaces']['histograms'])
vector1 = [x]
vector2 = [y]
#print(vector1,vector2)
cosine_similarity = spatial.distance.cosine(vector1, vector2)
print(cosine_similarity)