-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.lua
37 lines (28 loc) · 849 Bytes
/
test.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
--[[
Test script. Computes the mAP of all proposals.
Acts as a wrapper to the fastrcnn.Tester class.
--]]
local function test(dataLoadTable, rois, model, modelParameters, opt, annotation_file)
assert(dataLoadTable)
assert(rois)
assert(model)
assert(modelParameters)
assert(opt)
local evaluation_mode = opt.frcnn_test_mode or 'voc'
-- load roi boxes from file into memory
local roi_boxes
if rois.test then
roi_boxes = rois.test
else
roi_boxes = rois
end
-- add model params to opt
if not opt.model_param then
opt.model_param = modelParameters
end
-- test class
local Tester = fastrcnn.Tester(dataLoadTable(), roi_boxes, model, modelParameters, opt, evaluation_mode, annotation_file)
-- compute the mAP score
Tester:test()
end
return test