Spaces:
Running
on
Zero
Running
on
Zero
Update preprocess/openpose/run_openpose.py
Browse files
preprocess/openpose/run_openpose.py
CHANGED
|
@@ -28,12 +28,12 @@ import pdb
|
|
| 28 |
|
| 29 |
class OpenPose:
|
| 30 |
def __init__(self, gpu_id: int):
|
| 31 |
-
self.gpu_id = gpu_id
|
| 32 |
-
torch.cuda.set_device(gpu_id)
|
| 33 |
self.preprocessor = OpenposeDetector()
|
| 34 |
|
| 35 |
def __call__(self, input_image, resolution=384):
|
| 36 |
-
torch.cuda.set_device(self.gpu_id)
|
| 37 |
if isinstance(input_image, Image.Image):
|
| 38 |
input_image = np.asarray(input_image)
|
| 39 |
elif type(input_image) == str:
|
|
@@ -81,4 +81,4 @@ class OpenPose:
|
|
| 81 |
if __name__ == '__main__':
|
| 82 |
|
| 83 |
model = OpenPose()
|
| 84 |
-
model('./images/
|
|
|
|
| 28 |
|
| 29 |
class OpenPose:
|
| 30 |
def __init__(self, gpu_id: int):
|
| 31 |
+
# self.gpu_id = gpu_id
|
| 32 |
+
# torch.cuda.set_device(gpu_id)
|
| 33 |
self.preprocessor = OpenposeDetector()
|
| 34 |
|
| 35 |
def __call__(self, input_image, resolution=384):
|
| 36 |
+
# torch.cuda.set_device(self.gpu_id)
|
| 37 |
if isinstance(input_image, Image.Image):
|
| 38 |
input_image = np.asarray(input_image)
|
| 39 |
elif type(input_image) == str:
|
|
|
|
| 81 |
if __name__ == '__main__':
|
| 82 |
|
| 83 |
model = OpenPose()
|
| 84 |
+
model('./images/model.jpg')
|