-
Notifications
You must be signed in to change notification settings - Fork 3
/
train_hourglass_mpii.py
39 lines (32 loc) · 998 Bytes
/
train_hourglass_mpii.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 luozw, Inc. All Rights Reserved
Authors: luozhiwang(luozw1994@outlook.com)
Date: 2019-09-26
"""
from core.train.trainer import Trainer
from core.network.keypoints import Keypoints
from core.dataset.data_generator import Dataset
import config.config_hourglass_mpii as cfg
import sys
sys.path.append('.')
class TrainHourglass(Trainer):
def __init__(self, model, dataset, cfg):
super(TrainHourglass, self).__init__(model, dataset, cfg)
def train_launch(self):
self.is_debug = False
# must in order
self.init_dataset()
self.init_inputs()
self.init_model()
# optional override
self.init_loss()
self.init_learning_rate()
self.init_train_op()
self.init_loader_saver_summary()
self.init_session()
self.train()
if __name__ == '__main__':
trainer = TrainHourglass(Keypoints, Dataset, cfg)
trainer.train_launch()