Skip to content

Commit

Permalink
bug fix in handPose code
Browse files Browse the repository at this point in the history
  • Loading branch information
vikasgupta-github committed Oct 26, 2018
1 parent b30c390 commit 6561b60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions HandPose/handPoseImage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import cv2
import time
import numpy as np
Expand All @@ -8,19 +9,19 @@
POSE_PAIRS = [ [0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[0,9],[9,10],[10,11],[11,12],[0,13],[13,14],[14,15],[15,16],[0,17],[17,18],[18,19],[19,20] ]
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)

frame = cv2.imread("right-frontal.jpg")
frame = cv2.imread("g3.jpg")
frameCopy = np.copy(frame)
frameWidth = frame.shape[1]
frameHeight = frame.shape[0]
aspect_ratio = float(frameWidth)/frameHeight
aspect_ratio = frameWidth/frameHeight

threshold = 0.1

t = time.time()
# input image dimensions for the network
inHeight = 368
inWidth = int(((aspect_ratio*inHeight)*8)//8)
inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inHeight, inWidth), (0, 0, 0), swapRB=False, crop=False)
inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inWidth, inHeight), (0, 0, 0), swapRB=False, crop=False)

net.setInput(inpBlob)

Expand Down

0 comments on commit 6561b60

Please sign in to comment.