From 5f78673b7d25b961ba444b596ce62985af57f154 Mon Sep 17 00:00:00 2001 From: Brandon Amos Date: Mon, 11 Jan 2016 16:38:24 -0500 Subject: [PATCH] Move imgDim to models. --- models/openface/nn2.def.lua | 2 ++ models/openface/nn4.def.lua | 2 ++ training/donkey.lua | 4 ++-- training/opts.lua | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/models/openface/nn2.def.lua b/models/openface/nn2.def.lua index 2000246..11d64fc 100644 --- a/models/openface/nn2.def.lua +++ b/models/openface/nn2.def.lua @@ -22,6 +22,8 @@ -- See the License for the specific language governing permissions and -- limitations under the License. +imgDim = 224 + function createModel() local net = nn.Sequential() diff --git a/models/openface/nn4.def.lua b/models/openface/nn4.def.lua index 35d4a7f..66a790a 100644 --- a/models/openface/nn4.def.lua +++ b/models/openface/nn4.def.lua @@ -22,6 +22,8 @@ -- See the License for the specific language governing permissions and -- limitations under the License. +imgDim = 96 + function createModel() local net = nn.Sequential() diff --git a/training/donkey.lua b/training/donkey.lua index 05a1e8c..e9bace3 100644 --- a/training/donkey.lua +++ b/training/donkey.lua @@ -25,8 +25,8 @@ if not os.execute('cd ' .. opt.data) then error(("could not chdir to '%s'"):format(opt.data)) end -local loadSize = {3, opt.imgDim, opt.imgDim} -local sampleSize = {3, opt.imgDim, opt.imgDim} +local loadSize = {3, imgDim, imgDim} +local sampleSize = {3, imgDim, imgDim} -- function to load the image, jitter it appropriately (random crops etc.) local trainHook = function(self, path) diff --git a/training/opts.lua b/training/opts.lua index 109e2de..d0b7888 100644 --- a/training/opts.lua +++ b/training/opts.lua @@ -45,7 +45,7 @@ function M.parse(arg) ---------- Model options ---------------------------------- cmd:option('-retrain', 'none', 'provide path to model to retrain with') cmd:option('-modelDef', '../models/openface/nn4.def.lua', 'path to model definiton') - cmd:option('-imgDim', 96, 'Image dimension. nn2=224, nn4=96') + -- cmd:option('-imgDim', 96, 'Image dimension. nn2=224, nn4=96') Provided by model def. cmd:option('-embSize', 128, 'size of embedding from model') cmd:option('-alpha', 0.2, 'margin in TripletLoss') cmd:text()