Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

fix the mask position calculation in the mask matrix #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions InferDeepMask.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions InferSharpMask.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down