Skip to content

Commit

Permalink
Change 3D demo to use pre-trained detector
Browse files Browse the repository at this point in the history
  • Loading branch information
oarriaga committed Sep 6, 2022
1 parent 702f741 commit 11317fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/minimal_hand/demo3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from matplotlib.animation import FuncAnimation
from paz.backend.camera import Camera, VideoPlayer
from paz.applications import MinimalHandPoseEstimation
from paz.applications import SSD512MinimalHandPose
from paz.backend.image import resize_image, show_image
from paz.datasets import MINIMAL_HAND_CONFIG

Expand All @@ -13,7 +14,8 @@
help='Camera device ID')
args = parser.parse_args()

pipeline = MinimalHandPoseEstimation(right_hand=False)
# pipeline = MinimalHandPoseEstimation(right_hand=False)
pipeline = SSD512MinimalHandPose()
camera = Camera(args.camera_id)
player = VideoPlayer((640, 480), pipeline, camera)

Expand Down Expand Up @@ -62,6 +64,9 @@ def wrapped_animate(i):
show_image(image, 'inference', wait=False)

keypoints3D = output['keypoints3D']
if len(keypoints3D) == 0:
return
keypoints3D = keypoints3D[0] # TAKE ONLY THE FIRST PREDICTION
xs, ys, zs = np.split(keypoints3D, 3, axis=1)

plt.cla()
Expand Down

0 comments on commit 11317fc

Please sign in to comment.