Spaces:
Sleeping
Sleeping
resolved device access
Browse files
yolov5.py
CHANGED
@@ -177,8 +177,7 @@ class DeepFeatureFactorization:
|
|
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
|
181 |
-
img = cv2.resize(img, (640, 640))
|
182 |
rgb_img_float = np.float32(img) / 255.0
|
183 |
input_tensor = torch.from_numpy(rgb_img_float).permute(2, 0, 1).unsqueeze(0).to(device)
|
184 |
|
|
|
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))
|
|
|
181 |
rgb_img_float = np.float32(img) / 255.0
|
182 |
input_tensor = torch.from_numpy(rgb_img_float).permute(2, 0, 1).unsqueeze(0).to(device)
|
183 |
|