def __init__(self, gt, predict, threshold = 0.5): self.gt = gt self.adjusted_predict = adjust_predict(predict) self.relevant_data = exclude_ignore_label(gt, self.adjusted_predict) self.nlables = get_number_of_labels(gt) self.apr = apr(self.relevant_data[0], self.relevant_data[1]) self.auc_score = roc_auc(self.relevant_data[0], self.relevant_data[1]) self.quality = np.array((self.apr[0], self.apr[1], self.apr[2], self.auc_score)) self.roc_curve = draw_roc_curve(self.relevant_data[0], self.relevant_data[1])
# # # #c = config(p[0], p[1]) #c.show_quality() # #d = config(q[0], q[1]) #d.show_quality() I = read_h5("/home/stamylew/volumes/trimaps/50cube2_tri.h5", "50cube2_tri") II = read_h5("/home/stamylew/src/autocontext/prediction/cache/smallcubes_probs.h5", "exported_data") II = adjust_predict(II) q = exclude_ignore_label(I,II) c = predict_class(q[0], q[1]) c.show_quality() print c.return_quality() #III = read_h5("/home/stamylew/volumes/training_data/50cube3_bp.h5", "all_labels/n3/w_3_2_1") #III = adjust_predict_file(III) #plt.figure() #plt.imshow(I[11]) # #plt.figure() #plt.imshow(II[11]) # #plt.show()