mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 20:19:51 +01:00
adapt to cpu environment
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9754314
This commit is contained in:
@@ -44,8 +44,10 @@ class SkinRetouchingPipeline(Pipeline):
|
||||
"""
|
||||
super().__init__(model=model)
|
||||
|
||||
if device == 'gpu':
|
||||
if torch.cuda.is_available() and device == 'gpu':
|
||||
device = 'cuda'
|
||||
else:
|
||||
device = 'cpu'
|
||||
model_path = os.path.join(self.model, ModelFile.TORCH_MODEL_FILE)
|
||||
detector_model_path = os.path.join(
|
||||
self.model, 'retinaface_resnet50_2020-07-20_old_torch.pth')
|
||||
|
||||
Reference in New Issue
Block a user