From 1bced43e96de94077ac51017f8628c6af1a0ce72 Mon Sep 17 00:00:00 2001 From: berak Date: Wed, 5 May 2021 10:34:42 +0200 Subject: [PATCH] samples/dnn: better errormsg in openpose.py --- samples/dnn/openpose.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/dnn/openpose.py b/samples/dnn/openpose.py index b79ccd54b8..191d23edd4 100644 --- a/samples/dnn/openpose.py +++ b/samples/dnn/openpose.py @@ -41,8 +41,7 @@ elif args.dataset == 'MPI': ["RElbow", "RWrist"], ["Neck", "LShoulder"], ["LShoulder", "LElbow"], ["LElbow", "LWrist"], ["Neck", "Chest"], ["Chest", "RHip"], ["RHip", "RKnee"], ["RKnee", "RAnkle"], ["Chest", "LHip"], ["LHip", "LKnee"], ["LKnee", "LAnkle"] ] -else: - assert(args.dataset == 'HAND') +elif args.dataset == 'HAND': BODY_PARTS = { "Wrist": 0, "ThumbMetacarpal": 1, "ThumbProximal": 2, "ThumbMiddle": 3, "ThumbDistal": 4, "IndexFingerMetacarpal": 5, "IndexFingerProximal": 6, "IndexFingerMiddle": 7, "IndexFingerDistal": 8, @@ -61,7 +60,8 @@ else: ["RingFingerProximal", "RingFingerMiddle"], ["RingFingerMiddle", "RingFingerDistal"], ["Wrist", "LittleFingerMetacarpal"], ["LittleFingerMetacarpal", "LittleFingerProximal"], ["LittleFingerProximal", "LittleFingerMiddle"], ["LittleFingerMiddle", "LittleFingerDistal"] ] - +else: + raise(Exception("you need to specify either 'COCO', 'MPI', or 'Hand' in args.dataset")) inWidth = args.width inHeight = args.height