-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDANtraining.py
More file actions
22 lines (15 loc) · 784 Bytes
/
DANtraining.py
File metadata and controls
22 lines (15 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from ImageServer import ImageServer
from FaceAlignmentTraining import FaceAlignmentTraining
datasetDir = "data/"
trainSet = ImageServer.Load(datasetDir + "dataset_nimgs=60960_perturbations=[0.2, 0.2, 20, 0.25]_size=[112, 112].npz")
validationSet = ImageServer.Load(datasetDir + "dataset_nimgs=100_perturbations=[]_size=[112, 112].npz")
#The parameters to the FaceAlignmentTraining constructor are: number of stages and indices of stages that will be trained
#first stage training only
training = FaceAlignmentTraining(1, [0])
#second stage training only
#training = FaceAlignmentTraining(2, [1])
training.loadData(trainSet, validationSet)
training.initializeNetwork()
#load previously saved moved
#training.loadNetwork("../DAN-Menpo.npz")
training.train(0.001, num_epochs=1000)