Radamés Ajna commited on
Commit
0a67d21
1 Parent(s): e87cc2e

Update remove_bg.py

Browse files
Files changed (1) hide show
  1. remove_bg.py +3 -3
remove_bg.py CHANGED
@@ -36,9 +36,9 @@ class RemoveBackground(object):
36
  input_batch = input_tensor.unsqueeze(0) # create a mini-batch as expected by the model
37
 
38
  # move the input and model to GPU for speed if available
39
- #if torch.cuda.is_available():
40
- # input_batch = input_batch.to('cuda')
41
- # self.model.to('cuda')
42
 
43
  with torch.no_grad():
44
  output = self.model(input_batch)['out'][0]
 
36
  input_batch = input_tensor.unsqueeze(0) # create a mini-batch as expected by the model
37
 
38
  # move the input and model to GPU for speed if available
39
+ if torch.cuda.is_available():
40
+ input_batch = input_batch.to('cuda')
41
+ self.model.to('cuda')
42
 
43
  with torch.no_grad():
44
  output = self.model(input_batch)['out'][0]