Skip to content

Commit

Permalink
Merge pull request fizyr#791 from lvaleriu/patch-2
Browse files Browse the repository at this point in the history
Small questioning ...
  • Loading branch information
de-vri-es authored Nov 12, 2018
2 parents a0d99cb + ab3383b commit 615688a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions keras_retinanet/bin/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def parse_args(args):
parser.add_argument('--image-min-side', help='Rescale the image so the smallest side is min_side.', type=int, default=800)
parser.add_argument('--image-max-side', help='Rescale the image if the largest side is larger than max_side.', type=int, default=1333)
parser.add_argument('--config', help='Path to a configuration parameters .ini file (only used with --convert-model).')
parser.add_argument('--weighted-average', help='Compute the mAP using the weighted average of precisions among classes.', action='store_true')

return parser.parse_args(args)

Expand Down Expand Up @@ -181,10 +180,8 @@ def main(args=None):
print('No test instances found.')
return

if args.weighted_average:
print('mAP: {:.4f}'.format(sum([a * b for a, b in zip(total_instances, precisions)]) / sum(total_instances)))
else:
print('mAP: {:.4f}'.format(sum(precisions) / sum(x > 0 for x in total_instances)))
print('mAP using the weighted average of precisions among classes: {:.4f}'.format(sum([a * b for a, b in zip(total_instances, precisions)]) / sum(total_instances)))
print('mAP: {:.4f}'.format(sum(precisions) / sum(x > 0 for x in total_instances)))


if __name__ == '__main__':
Expand Down

0 comments on commit 615688a

Please sign in to comment.