pifpafpose_detector

Pose Detector class based on Open PifPaf and some pose modification tools

source

Detector

 Detector ()

Given a still image (or video frame), finds poses.

Attributes:
device: PyTorch computing resource (GPU or CPU)
net: Pose detection neural network model
processor: Pose detection image processor

teddy = Detector()
#detections = teddy.detect_image('sample_data/sample1.png', viz=True)
#pose_output = teddy.detect_video("/srv/choreo/Einstein.mp4", start_seconds=6310, end_seconds=7288, write_images=True, images_too=False)
teddy.init_model()
FPS = 25
!ffmpeg -y -framerate $FPS -pattern_type glob -i 'video_folder/*.png' -strict '-2' -c:v libx264 -vf "fps=$FPS" -pix_fmt yuv420p Einstein_ballet_pf.mp4
try:
    teddy = Detector()
    detections = teddy.detect_image('sample_data/sample1.png')
    print(detections[0])
except:
    print("Unable to instantiate a detector on your system. Do you have PyTorch with CUDA enabled?")