INNER CODE UNIT · Python
Precision
andrewssobral/bgslibrary · tools/fet/fet.py:33
Precision = .0 # TP / (TP + FP)
Fscore = .0 # 2*(Precision*Recall)/(Precision+Recall)
# TP - # of foreground pixels classified as foreground pixels.
# FP - # of background pixels classified as foreground pixels.
# TN - # of background pixels classified as background pixels.
# FN - # of foreground pixels classified as background pixels.
green = [0,255,0] # for FN
blue = [255,0,0]
red = [0,0,255] # for FP
white = [255,255,255] # for TP
black = [0,0,0] # for TN
print('Processing')
k = 1
for file_gt, file_fg in zip(files_gt, files_fg):
print(k, file_gt, file_fg)