import cv2
import time
import numpy as np
import matplotlib.pyplot as plt
import os
# Load a Caffe Model
if not os.path.isdir('model'):
os.mkdir("model")
protoFile = "datas/models/caffe/openpose/pose_deploy_linevec_faster_4_stages.prototxt"
weightsFile = "datas/models/caffe/openpose/pose_iter_160000.caffemodel"
# Specify number of points in the model
nPoints = 15
POSE_PAIRS = [[0,1], [1,2], [2,3], [3,4], [1,5], [5,6], [6,7], [1,14], [14,8], [8,9], [9,10], [14,11], [11,12], [12,13] ]
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
# Read Image
im = cv2.imread("datas/images/man.jpg")
im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
inWidth = im.shape[1]
inHeight = im.shape[0]
# Convert image to blob
net