Skip to content

Instantly share code, notes, and snippets.

View samc24's full-sized avatar

Sameer Chaturvedi samc24

  • Boston University
  • Boston, MA
View GitHub Profile
@smeschke
smeschke / smooth_pose_data.py
Last active March 3, 2024 17:57
Smooth Pose Estimation Data
import pandas as pd
import numpy as np
import cv2, os
import scipy
from scipy import signal
import csv
circle_color, line_color = (255,255,0), (0,0,255)
window_length, polyorder = 13, 2
sd = "workout"
@smeschke
smeschke / swap_body_parts.py
Created September 21, 2018 19:49
Ensure that body parts are always in the right places
import pandas as pd
import numpy as np
import cv2, os
import csv
input_source = "/home/stephen/Desktop/me.MP4"
cap = cv2.VideoCapture(input_source)
frame_number = 0
font, scale, colorText, thick = cv2.FONT_HERSHEY_SIMPLEX, .5, (234,234,234), 1
size, color, thickness = 5, (255,255,255), 5
@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