acmyu/KeyframesAI
0
1#from annotator.dwpose import DWposeDetector
2from easy_dwpose import DWposeDetector
3from PIL import Image
4
5
6device = "cpu"
7dwpose = DWposeDetector(device=device)
8
9for n in range(1, 46):
10 pil_image = Image.open("videos/dance2/frame ("+str(n)+").png").convert("RGB")
11 #skeleton = dwpose(pil_image, output_type="np", include_hands=True, include_face=False)
12
13 out_img, pose = dwpose(pil_image, include_hands=True, include_face=True)
14
15 print(pose['bodies'])
16 out_img.save('videos/dance'+str(n)+'.png')
17 