diff --git a/examples/minimal_hand/demo3D.py b/examples/minimal_hand/demo3D.py index 94243b238..8060d96ca 100644 --- a/examples/minimal_hand/demo3D.py +++ b/examples/minimal_hand/demo3D.py @@ -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 @@ -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) @@ -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()