Skip to content

Instantly share code, notes, and snippets.

View ashishsinghucd's full-sized avatar

Ashish Singh ashishsinghucd

  • University College Dublin
  • dublin
View GitHub Profile
@smeschke
smeschke / save_pose_data.py
Last active April 7, 2023 07:08
Saving pose data from video using OpenPose
import cv2, numpy as np, csv
#https://github.com/opencv/opencv/blob/master/samples/dnn/openpose.py
outfile_path = '/home/stephen/Desktop/workout.csv'
protoFile = "/home/stephen/pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt"
weightsFile = "/home/stephen/pose/mpi/pose_iter_160000.caffemodel"
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
data, input_width, input_height, threshold, frame_number = [], 368, 386, 0.1, 0