forked from penny4860/tf2-eager-yolo3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval.py
37 lines (28 loc) · 829 Bytes
/
eval.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
import tensorflow as tf
import argparse
argparser = argparse.ArgumentParser(
description='evaluate yolo-v3 network')
argparser.add_argument(
'-c',
'--config',
default="configs/svhn.json",
help='config file')
argparser.add_argument(
'-s',
'--save_dname',
default=None)
argparser.add_argument(
'-t',
'--threshold',
type=float,
default=0.5)
if __name__ == '__main__':
from yolo.config import ConfigParser
args = argparser.parse_args()
config_parser = ConfigParser(args.config)
model = config_parser.create_model()
evaluator, _ = config_parser.create_evaluator(model)
score = evaluator.run(threshold=args.threshold,
save_dname=args.save_dname)
print(score)