-
Notifications
You must be signed in to change notification settings - Fork 2
/
evaluate.py
43 lines (32 loc) · 1.52 KB
/
evaluate.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
38
39
40
41
42
43
"""
Example usage: CUDA_VISIBLE_DEVICES=1, python train.py --settings_file "config/settings.yaml"
"""
import argparse
from myconfig.settings import Settings
from myevaluation.model_evaluation_mAP import SparseObjectDetModel
from myevaluation.model_evaluation_mAP import DenseObjectDetModel
from myevaluation.model_evaluation_mAP import FBSparseVGGModel
from myevaluation.model_evaluation_mAP import SparseRecurrentObjectDetModel
def main():
parser = argparse.ArgumentParser(description='Evaluate network.')
parser.add_argument('--settings_file', help='Path to settings yaml', required=True)
args = parser.parse_args()
settings_filepath = args.settings_file
settings = Settings(settings_filepath, generate_log=True)
if settings.model_name == 'fb_sparse_vgg':
evaluator = FBSparseVGGModel(settings)
elif settings.model_name == 'dense_vgg':
evaluator = DenseVGGModel(settings)
elif (settings.model_name == 'sparse_REDnet' or
settings.model_name == 'custom_sparse_REDnetv1' or
settings.model_name == 'sparse_firenet'):
evaluator = SparseRecurrentObjectDetModel(settings)
elif settings.model_name == 'fb_sparse_object_det':
evaluator = SparseObjectDetModel(settings)
elif settings.model_name == 'dense_object_det':
evaluator = DenseObjectDetModel(settings)
else:
raise ValueError('Model name %s specified in the settings file is not implemented' % settings.model_name)
evaluator.evaluate()
if __name__ == "__main__":
main()