From f2273c1cbe28b6d70fc7fad21604517506be0bea Mon Sep 17 00:00:00 2001 From: pichai Date: Mon, 19 Jun 2017 10:58:56 +0900 Subject: [PATCH] fix the mask position calculation in the mask matrix --- InferDeepMask.lua | 4 ++-- InferSharpMask.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/InferDeepMask.lua b/InferDeepMask.lua index facbd08..0bac2b3 100644 --- a/InferDeepMask.lua +++ b/InferDeepMask.lua @@ -165,8 +165,8 @@ function Infer:getTopScores() end end local temp=sortedIds[pos[scale]][scale] - local x=math.floor(temp/self.score[scale]:size(2)) - local y=temp%self.score[scale]:size(2)+1 + local x=math.floor((temp-1)/self.score[scale]:size(2))+1 -- row + local y=(temp-1)%self.score[scale]:size(2)+1 -- column x,y=math.max(1,x),math.max(1,y) pos[scale]=pos[scale]+1 diff --git a/InferSharpMask.lua b/InferSharpMask.lua index a889eab..4e80f09 100644 --- a/InferSharpMask.lua +++ b/InferSharpMask.lua @@ -261,8 +261,8 @@ function Infer:getTopScores(outPyramidScore) end end local temp=sortedIds[pos[scale]][scale] - local x=math.floor(temp/self.score[scale]:size(2)) - local y=temp%self.score[scale]:size(2)+1 + local x=math.floor((temp-1)/self.score[scale]:size(2))+1 -- row + local y=(temp-1)%self.score[scale]:size(2)+1 -- column x,y=math.max(1,x),math.max(1,y) pos[scale]=pos[scale]+1