Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Update csv_eval.py #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions retinanet/csv_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def evaluate(
all_annotations = _get_annotations(generator)

average_precisions = {}
recalls = {}
precisions = {}

for label in range(generator.num_classes()):
false_positives = np.zeros((0,))
Expand Down Expand Up @@ -231,17 +233,19 @@ def evaluate(
# compute average precision
average_precision = _compute_ap(recall, precision)
average_precisions[label] = average_precision, num_annotations
recalls[label] = recall
precisions[label] = precision


print('\nmAP:')
for label in range(generator.num_classes()):
label_name = generator.label_to_name(label)
print('{}: {}'.format(label_name, average_precisions[label][0]))
print("Precision: ",precision[-1])
print("Recall: ",recall[-1])
print("Precision: ",precisions[label][-1])
print("Recall: ",recalls[label][-1])

if save_path!=None:
plt.plot(recall,precision)
plt.plot(recalls[label],precisions[label])
# naming the x axis
plt.xlabel('Recall')
# naming the y axis
Expand Down