Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da33b15

Browse files
committed
Use square bounding box
1 parent f84dd0b commit da33b15

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎scripts/JustHandNet.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
OPENPOSE_ROOT = os.environ["OPENPOSE_ROOT"]
1616

1717

18-
def ComputeBB(hand, padding=0.4):
18+
def ComputeBB(hand, padding=1.5):
1919
minX = np.min(hand[:, 0])
2020
minY = np.min(hand[:, 1])
2121

@@ -25,14 +25,15 @@ def ComputeBB(hand, padding=0.4):
2525
width = maxX - minX
2626
height = maxY - minY
2727

28-
padX = width*padding/2
29-
padY = height*padding/2
28+
cx = minX+width/2
29+
cy = minY+height/2
3030

31-
minX -= padX
32-
minY -= padY
31+
width = height = max(width, height)
32+
width = height = width * padding
33+
34+
minX = cx - width/2
35+
minY = cy - height/2
3336

34-
width += 2 * padX
35-
height += 2 * padY
3637

3738
score = np.mean(hand[:, 2])
3839
return score, [int(minX), int(minY), int(width), int(height)]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /