Skip to content

Commit 5962731

Browse files
minor changes
1 parent 7c32820 commit 5962731

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

code/evaluate.lua

+5-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ for _, mode in pairs({'Wall Junction', 'Door', 'Object', 'Room'}) do
3535
end
3636

3737

38-
local filenames = {}
38+
local resultFilenames = {}
3939

4040
--local finalExamples = {1, 2, 4, 5, 6}
4141
--for _, i in pairs(finalExamples) do
@@ -63,22 +63,15 @@ for index, filenames in pairs(imageInfo) do
6363
end
6464

6565
local representationImage = fp_ut.drawRepresentationImage(floorplan, representationPrediction)
66-
--image.save(resultPath .. predictionFilename, representationImage)
6766
local img = torch.cat(floorplan, representationImage, 3)
6867
local floorplanPredictionFilename = 'representation_prediction_' .. index .. '.png'
69-
local predictionFilename = resultPath .. floorplanPredictionFilename
70-
image.save(predictionFilename, img)
71-
table.insert(filenames, predictionFilename)
72-
73-
if index == 10 then
74-
break
75-
end
68+
image.save(resultPath .. '/' .. floorplanPredictionFilename, img)
69+
table.insert(resultFilenames, floorplanPredictionFilename)
7670
end
7771

7872
print(results)
7973

80-
81-
local resultFile = io.open(resultPath .. 'index.html', 'w')
74+
local resultFile = io.open(resultPath .. '/index.html', 'w')
8275
resultFile:write("<!DOCTYPE html><html><head></head><body>")
8376
resultFile:write("<h3>Statistics:</h3>")
8477
resultFile:write('<table border="1">')
@@ -89,7 +82,7 @@ end
8982
resultFile:write("</table>")
9083

9184
resultFile:write("<h3>Results:</h3>")
92-
for i, filename in pairs(filenames) do
85+
for i, filename in pairs(resultFilenames) do
9386
resultFile:write("<p>Index " .. i .. "</p>")
9487
resultFile:write('<img src="' .. filename .. '" alt="' .. filename .. '" width="100%">')
9588
end

code/opts.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ function M.parse(arg)
102102
cmd:option('-numFolds', 5, 'the number of folds')
103103

104104
------------- testing options ---------------
105-
cmd:option('-resultPath', 'results', 'path to save evaluation results')
105+
cmd:option('-resultPath', 'results/', 'path to save evaluation results')
106106
cmd:option('-floorplanFilename', '', 'filename for the floorplan to test')
107-
cmd:option('-outputFilename', '', 'filename for saving the prediction')
107+
cmd:option('-outputFilename', 'test/result', 'filename for saving the prediction')
108108

109109
cmd:text()
110110

0 commit comments

Comments
 (0)