-
Notifications
You must be signed in to change notification settings - Fork 0
/
testmain.lua
39 lines (35 loc) · 1.01 KB
/
testmain.lua
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
print '==> executing all'
require 'init'
require 'data'
require 'model'
require 'loss'
-- require 'train'
require 'test'
----------------------------------------------------------------------
print("==> testing")
if not opt.scpfile then
error("Please specify a file containing the data with -scpfile")
return
elseif io.open(opt.scpfile,"rb") == nil then
error(string.format("Given scp file %s cannot be found!",opt.scpfile))
return
end
readLabel(opt.labelfile)
local testfbankfilelist = opt.scpfile
local listfile = io.open(testfbankfilelist, 'r')
while (true) do
testData = readDataScp2(listfile,1)
if (testData~=nil) then
test()
else
break
end
collectgarbage()
end
listfile:close()
if (opt.crossvalid==1) then
confusion:updateValids()
print('average row correct: ' .. (confusion.averageValid*100) .. '%')
print('average rowUcol correct (VOC measure): ' .. (confusion.averageUnionValid*100) .. '%')
print('global correct: ' .. (confusion.totalValid*100) .. '%')
end