Skip to content

Commit

Permalink
Update floorplan.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zzilch authored Sep 28, 2021
1 parent def9083 commit 8a6fee8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Network/model/floorplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ def get_boxes(self,relative=True,tensor=True):
X,Y = np.linspace(0,1,w),np.linspace(0,1,h)
boxes = boxes-np.array([y0,x0,y0,x0])

norm = lambda box:np.array([X[box[1]],Y[box[0]],X[box[3]-1],Y[box[2]-1]])
norm = lambda box:np.array([
X[max(box[1],0)],
Y[max(box[0],0)],
X[min(box[3]-1,w-1)],
Y[min(box[2]-1,h-1)]
])

boxes = np.apply_along_axis(norm,1,boxes)
boxes[:,2:]-=boxes[:,:2]
boxes[:,:2]+=boxes[:,2:]/2
Expand Down Expand Up @@ -347,4 +353,4 @@ def vis_fp(fp,size=(256,256)):
return img

if __name__ == "__main__":
pass
pass

0 comments on commit 8a6fee8

Please sign in to comment.