def generate_height_map_plot(gt_height, height, dif_init, dif_final, dif_increment): bvxm_batch.init_process("volmGenerateHeightMapPlotProcess"); bvxm_batch.set_input_from_db(0, gt_height); bvxm_batch.set_input_from_db(1, height); bvxm_batch.set_input_float(2, dif_init); bvxm_batch.set_input_float(3, dif_final); bvxm_batch.set_input_float(4, dif_increment); bvxm_batch.run_process(); (id, type) = bvxm_batch.commit_output(0); correct_rate_array = bvxm_batch.get_bbas_1d_array_float(id); (id, type) = bvxm_batch.commit_output(1); height_dif_array = bvxm_batch.get_bbas_1d_array_float(id); (id, type) = bvxm_batch.commit_output(2); out_map = dbvalue(id, type); (id, type) = bvxm_batch.commit_output(3); out_map_dif = dbvalue(id, type); return correct_rate_array, height_dif_array, out_map, out_map_dif
def region_wise_roc_analysis(in_img, in_cam, positive_kml, negative_kml): bvxm_batch.init_process("volmDetectionRateROCProcess") bvxm_batch.set_input_from_db(0, in_img) bvxm_batch.set_input_from_db(1, in_cam) bvxm_batch.set_input_string(2, positive_kml) bvxm_batch.set_input_string(3, negative_kml) status = bvxm_batch.run_process() if status: (id, type) = bvxm_batch.commit_output(0) thres_out = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(1) tp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(2) tn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(3) fp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(4) fn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(5) tpr = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(6) fpr = bvxm_batch.get_bbas_1d_array_float(id) return thres_out, tp, tn, fp, fn, tpr, fpr else: return None, None, None, None, None, None, None
def generate_roc3(tclsf, in_prob_img, prefix_for_bin_files, positive_category_name): bvxm_batch.init_process("sdetTextureClassifierROCProcess3") bvxm_batch.set_input_from_db(0, tclsf) bvxm_batch.set_input_from_db(1, in_prob_img) bvxm_batch.set_input_string(2, prefix_for_bin_files) bvxm_batch.set_input_string(3, positive_category_name) status = bvxm_batch.run_process() if status: (id, type) = bvxm_batch.commit_output(0) thres = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(1) tp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(2) tn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(3) fp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(4) fn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(5) tpr = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(6) fpr = bvxm_batch.get_bbas_1d_array_float(id) return thres, tp, tn, fp, fn, tpr, fpr else: return None, None, None, None, None, None, None
def generate_roc(tclsf, class_out_prob_img, class_out_color_img, orig_img, prefix_for_bin_files, positive_category_name, category_id_file): bvxm_batch.init_process("sdetTextureClassifierROCProcess") bvxm_batch.set_input_from_db(0, tclsf) bvxm_batch.set_input_from_db(1, class_out_prob_img) bvxm_batch.set_input_from_db(2, class_out_color_img) bvxm_batch.set_input_from_db(3, orig_img) bvxm_batch.set_input_string(4, prefix_for_bin_files) bvxm_batch.set_input_string(5, positive_category_name) bvxm_batch.set_input_string(6, category_id_file) bvxm_batch.run_process() (id, type) = bvxm_batch.commit_output(0) thres = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(1) tp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(2) tn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(3) fp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(4) fn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(5) tpr = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(6) fpr = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(7) outimg = dbvalue(id, type) return thres, tp, tn, fp, fn, tpr, fpr, outimg
def generate_height_map_plot(gt_height, height, dif_init, dif_final, dif_increment, gt_fix): bvxm_batch.init_process("volmGenerateHeightMapPlotProcess") bvxm_batch.set_input_from_db(0, gt_height) bvxm_batch.set_input_from_db(1, height) bvxm_batch.set_input_float(2, dif_init) bvxm_batch.set_input_float(3, dif_final) bvxm_batch.set_input_float(4, dif_increment) bvxm_batch.set_input_float(5, gt_fix) bvxm_batch.run_process() (id, type) = bvxm_batch.commit_output(0) correct_rate_array = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(1) height_dif_array = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(2) out_map = dbvalue(id, type) (id, type) = bvxm_batch.commit_output(3) out_map_dif = dbvalue(id, type) return correct_rate_array, height_dif_array, out_map, out_map_dif
def generate_roc2(image, gt_pos_file, pos_sign="low"): bvxm_batch.init_process("sdetTextureClassifierROCProcess2") bvxm_batch.set_input_from_db(0, image) bvxm_batch.set_input_string(1, gt_pos_file) bvxm_batch.set_input_string(2, pos_sign) status = bvxm_batch.run_process() if status: (id, type) = bvxm_batch.commit_output(0) threshold = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(1) tp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(2) tn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(3) fp = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(4) fn = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(5) tpr = bvxm_batch.get_bbas_1d_array_float(id) (id, type) = bvxm_batch.commit_output(6) fpr = bvxm_batch.get_bbas_1d_array_float(id) return threshold, tp, tn, fp, fn, tpr, fpr else: return 0, 0, 0, 0, 0, 0, 0
def generate_roc(tclsf, class_out_prob_img, class_out_color_img, orig_img, prefix_for_bin_files, positive_category_name): bvxm_batch.init_process("sdetTextureClassifierROCProcess"); bvxm_batch.set_input_from_db(0, tclsf); bvxm_batch.set_input_from_db(1, class_out_prob_img); bvxm_batch.set_input_from_db(2, class_out_color_img); bvxm_batch.set_input_from_db(3, orig_img); bvxm_batch.set_input_string(4, prefix_for_bin_files); bvxm_batch.set_input_string(5, positive_category_name); bvxm_batch.run_process(); (id,type) = bvxm_batch.commit_output(0); tp = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(1); tn = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(2); fp = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(3); fn = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(4); tpr = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(5); fpr = bvxm_batch.get_bbas_1d_array_float(id); (id,type) = bvxm_batch.commit_output(6); outimg = dbvalue(id,type); return tp, tn, fp, fn, tpr, fpr, outimg;