pyファイルをインポートして、実行したい。
openpose
上記URLのpose_detector.pyを以下のプログラムでインポートしました。
python
1import sys 2# モジュール検索パスの設定 3REPO_ROOT = '/Users/Chainer_Realtime_Multi-Person_Pose_Estimation' 4sys.path.append(REPO_ROOT) 5 6# PoseDetectorクラスのインポート 7from pose_detector import PoseDetector 8 9# モデルのロード 10arch_name = 'posenet' 11image_path = os.path.join(REPO_ROOT, 'data', 'person.png') 12weight_path = os.path.join(REPO_ROOT, 'models', 'coco_posenet.npz') 13 14model = PoseDetector(arch_name, weight_path) 15 16--------------------------------------------------------------------------- 17 18Loading the model...
と表示された後に以下を実行すると
python
1poses, _ = pose_detector(img) 2img = draw_person_pose(img, pose_arr) 3 4--------------------------------------------------------------------------- 5NameError Traceback (most recent call last) 6<ipython-input-53-d818c191d81a> in <module>() 7----> 1 poses, _ = pose_detector(img) 8 2 img = draw_person_pose(img, pose_arr) 9 10NameError: name 'pose_detector' is not defined
となって、うまく呼び出せません。
ご回答よろしくおねがいします・
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/22 08:22