acmyu commited on
Commit
7e28b1a
·
1 Parent(s): 194a721

get pose coords

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -48,7 +48,7 @@ from src.pipelines.PCDMs_pipeline import PCDMsPipeline
48
 
49
 
50
  import spaces
51
- from .libs.easy_dwpose import DWposeDetector
52
  from PIL import Image
53
  import cv2
54
  import os
@@ -140,7 +140,7 @@ def getThumbnails(imgs):
140
  # Pose detection ==============================================================================================
141
 
142
  def load_models():
143
- dwpose = DWposeDetector(device="cpu")
144
  rembg_session = rembg.new_session("u2netp")
145
 
146
  pcdms_model = hf_hub_download(repo_id="acmyu/PCDMs", filename="pcdms_ckpt.pt")
@@ -212,7 +212,7 @@ def get_pose(img, dwpose, outfile, crop=False):
212
  #skeleton = dwpose(pil_image, output_type="np", include_hands=True, include_face=False)
213
 
214
  #img.thumbnail((512,512))
215
- out_img, _ = dwpose(img, include_hands=True, include_face=False)
216
 
217
  #print(pose['bodies'])
218
 
 
48
 
49
 
50
  import spaces
51
+ from libs.easy_dwpose import DWposeDetector
52
  from PIL import Image
53
  import cv2
54
  import os
 
140
  # Pose detection ==============================================================================================
141
 
142
  def load_models():
143
+ dwpose = DWposeDetector(device="cuda")
144
  rembg_session = rembg.new_session("u2netp")
145
 
146
  pcdms_model = hf_hub_download(repo_id="acmyu/PCDMs", filename="pcdms_ckpt.pt")
 
212
  #skeleton = dwpose(pil_image, output_type="np", include_hands=True, include_face=False)
213
 
214
  #img.thumbnail((512,512))
215
+ out_img, pose = dwpose(img, include_hands=True, include_face=False)
216
 
217
  #print(pose['bodies'])
218