BhumikaMak commited on
Commit
5a7279e
·
verified ·
1 Parent(s): 524e144

resolved device reference

Browse files
Files changed (1) hide show
  1. yolov5.py +1 -1
yolov5.py CHANGED
@@ -101,7 +101,6 @@ import requests
101
  import yaml
102
  import matplotlib.patches as patches
103
 
104
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
105
  def dff_l(activations, model, n_components):
106
  batch_size, channels, h, w = activations.shape
107
  print('activation', activations.shape)
@@ -175,6 +174,7 @@ class DeepFeatureFactorization:
175
 
176
 
177
  def dff_nmf(image, target_lyr, n_components):
 
178
  mean = [0.485, 0.456, 0.406] # Mean for RGB channels
179
  std = [0.229, 0.224, 0.225] # Standard deviation for RGB channels
180
  img = cv2.resize(image, (640, 640))
 
101
  import yaml
102
  import matplotlib.patches as patches
103
 
 
104
  def dff_l(activations, model, n_components):
105
  batch_size, channels, h, w = activations.shape
106
  print('activation', activations.shape)
 
174
 
175
 
176
  def dff_nmf(image, target_lyr, n_components):
177
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
178
  mean = [0.485, 0.456, 0.406] # Mean for RGB channels
179
  std = [0.229, 0.224, 0.225] # Standard deviation for RGB channels
180
  img = cv2.resize(image, (640, 640))