def multi_labels(label_values,ilp, files, gt, dense_gt, loops=3, weights="", repeats=1, outpath= "", t_cache = "", p_cache = ""): hostname = socket.gethostname() test_folder_path = assign_path(hostname)[5] if t_cache == "": t_cache = test_folder_path + "/t_cache" if p_cache == "": filesplit = files.split(".")[-2] filename = filesplit.split("/")[-1] p_cache = test_folder_path + "/p_cache/" + filename if not os.path.exists(p_cache): os.mkdir(p_cache) if outpath == "": outpath = test_folder_path + "/q_data" for n in label_values: ilp = reduce_labels_in_ilp(ilp, n) test(ilp, files, gt, dense_gt, n, loops, weights, repeats, outpath, t_cache, p_cache)
def multi_loops(nol, ilp, files, gt, dense_gt, labels="", weights="", repeats=1, outpath= "", t_cache = "", p_cache = ""): hostname = socket.gethostname() if labels != "": print print "reducing labels to " + str(labels) ilp = reduce_labels_in_ilp(ilp, labels) test_folder_path = assign_path(hostname)[5] if t_cache == "": t_cache = test_folder_path + "/t_cache" if p_cache == "": filesplit = files.split(".")[-2] filename = filesplit.split("/")[-1] p_cache = test_folder_path + "/p_cache/" + filename if not os.path.exists(p_cache): os.mkdir(p_cache) if outpath == "": outpath = test_folder_path + "/q_data" for n in range(1,nol+1): test(ilp, files, gt, dense_gt, labels, n, weights, repeats, outpath, t_cache, p_cache)
save_h5([labels],q_data_outpath, "autocontext_parameters/#labels") save_h5([loops], q_data_outpath, "autocontext_parameters/#loops") save_h5([str(weight_tag)], q_data_outpath, "autocontext_parameters/weights") print print "quality data saved" #save configuration data # call(["cp", predict_path, q_outpath]) save_h5(["pmin", "minMemb", "minSeg", "sigMin", "sigWeights", "sigSmooth", "cleanCloseSeeds", "returnSeedsOnly"], q_data_outpath, "segmentation/wsDt parameters", None) save_h5(["edge_weights", "edgeLengths", "nodeFeatures", "nodeSizes", "nodeLabels", "nodeNumStop", "beta", "metric", "wardness", "out"], q_data_outpath, "segmentation/agglCl parameters", None) print print "quality data saved" if __name__ == '__main__': hostname = socket.gethostname() ilp_folder = assign_path(hostname)[1] volumes_folder = assign_path(hostname)[2] ilp_file = ilp_folder + "100p_cube2_t_05.ilp" files = volumes_folder + "test_data/100p_cube1.h5/data" gt_path = volumes_folder + "groundtruth/trimaps/100p_cube1_trimap_t_05.h5" dense_gt_path = volumes_folder + "groundtruth/dense_groundtruth/100p_cube1_dense_gt.h5" ilp = reduce_labels_in_ilp(ilp_file, 10000) test(ilp, files, gt_path, dense_gt_path, 10000, 3, "", 10) print print "done"