Spaces:
Runtime error
Runtime error
Update preprocess/openpose/run_openpose.py
Browse files27 unmodified lines28293031323132333435363637383941 unmodified lines818283848427 unmodified lines
class OpenPose: def __init__(self, gpu_id: int): self.gpu_id = gpu_id torch.cuda.set_device(gpu_id) # self.gpu_id = gpu_id # torch.cuda.set_device(gpu_id) self.preprocessor = OpenposeDetector()
def __call__(self, input_image, resolution=384): torch.cuda.set_device(self.gpu_id) # torch.cuda.set_device(self.gpu_id) if isinstance(input_image, Image.Image): input_image = np.asarray(input_image) elif type(input_image) == str:41 unmodified linesif __name__ == '__main__':
model = OpenPose() model('./images/bad_model.jpg') model('./images/model.jpg')preprocess/openpose/run_openpose.py+4-4