示例#1
0
def pixel_wise_roc2(class_img, gt_img, negative_gt_img = None, positive_sign = "high", mask_img=None):
  bvxm_batch.init_process("vilPixelwiseRocProcess2")
  bvxm_batch.set_input_from_db(0, class_img)
  bvxm_batch.set_input_from_db(1, gt_img)
  if negative_gt_img:
    bvxm_batch.set_input_from_db(2, negative_gt_img)
  if mask_img:
    bvxm_batch.set_input_from_db(3, mask_img)
  bvxm_batch.set_input_string(4, positive_sign)
  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
示例#2
0
def pixel_wise_roc2(class_img,
                    gt_img,
                    negative_gt_img=None,
                    positive_sign="high",
                    mask_img=None):
    bvxm_batch.init_process("vilPixelwiseRocProcess2")
    bvxm_batch.set_input_from_db(0, class_img)
    bvxm_batch.set_input_from_db(1, gt_img)
    if negative_gt_img:
        bvxm_batch.set_input_from_db(2, negative_gt_img)
    if mask_img:
        bvxm_batch.set_input_from_db(3, mask_img)
    bvxm_batch.set_input_string(4, positive_sign)
    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
示例#3
0
def pixel_wise_roc(cd_img, gt_img, mask_img=None):
    bvxm_batch.init_process("vilPixelwiseRocProcess")
    bvxm_batch.set_input_from_db(0, cd_img)
    bvxm_batch.set_input_from_db(1, gt_img)
    if mask_img:
        bvxm_batch.set_input_from_db(2, mask_img)
    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(6)
    outimg = dbvalue(id, type)
    #return tuple of true positives, true negatives, false positives, etc..
    return (tp, tn, fp, fn, outimg)
示例#4
0
def pixel_wise_roc(cd_img, gt_img, mask_img=None) :
  bvxm_batch.init_process("vilPixelwiseRocProcess");
  bvxm_batch.set_input_from_db(0,cd_img);
  bvxm_batch.set_input_from_db(1,gt_img);
  if mask_img:
    bvxm_batch.set_input_from_db(2,mask_img);
  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(6);
  outimg = dbvalue(id,type);
  #return tuple of true positives, true negatives, false positives, etc..
  return (tp, tn, fp, fn,outimg);