AsmaAILab commited on
Commit
1a7479b
·
verified ·
1 Parent(s): 32b1fe7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -61,12 +61,12 @@ from transformers import Mask2FormerImageProcessor, Mask2FormerForUniversalSegme
61
  # Load Mask2Former
62
  processor = Mask2FormerImageProcessor.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
63
  model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
64
- model = model.cuda()
65
 
66
  # Load Depth model
67
  depth_image_processor = AutoImageProcessor.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
68
  depth_model = AutoModelForDepthEstimation.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
69
- depth_model = depth_model.cuda()
70
 
71
  def to_rgb(color: str) -> tuple:
72
  return tuple(int(color[i:i+2], 16) for i in (1, 3, 5))
 
61
  # Load Mask2Former
62
  processor = Mask2FormerImageProcessor.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
63
  model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
64
+ model = model.to(DEVICE)
65
 
66
  # Load Depth model
67
  depth_image_processor = AutoImageProcessor.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
68
  depth_model = AutoModelForDepthEstimation.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
69
+ depth_model = depth_model.to(DEVICE)
70
 
71
  def to_rgb(color: str) -> tuple:
72
  return tuple(int(color[i:i+2], 16) for i in (1, 3, 5))