Spaces:
Sleeping
Sleeping
resolved: looped returns
Browse files
yolov5.py
CHANGED
@@ -133,7 +133,7 @@ class DeepFeatureFactorization:
|
|
133 |
model: torch.nn.Module,
|
134 |
n_components: int = 16):
|
135 |
if isinstance(input_tensor, np.ndarray):
|
136 |
-
input_tensor = torch.from_numpy(input_tensor)
|
137 |
|
138 |
batch_size, channels, h, w = input_tensor.size()
|
139 |
_ = self.activations_and_grads(input_tensor)
|
@@ -234,8 +234,7 @@ def dff_nmf(image, target_lyr, n_components):
|
|
234 |
image_array = np.array(fig.canvas.renderer.buffer_rgba()) # Convert to numpy array
|
235 |
results.append(image_array)
|
236 |
plt.clf()
|
237 |
-
|
238 |
-
return image_array
|
239 |
|
240 |
|
241 |
return rgb_img_float, batch_explanations, results
|
|
|
133 |
model: torch.nn.Module,
|
134 |
n_components: int = 16):
|
135 |
if isinstance(input_tensor, np.ndarray):
|
136 |
+
input_tensor = torch.from_numpy(input_tensor)
|
137 |
|
138 |
batch_size, channels, h, w = input_tensor.size()
|
139 |
_ = self.activations_and_grads(input_tensor)
|
|
|
234 |
image_array = np.array(fig.canvas.renderer.buffer_rgba()) # Convert to numpy array
|
235 |
results.append(image_array)
|
236 |
plt.clf()
|
237 |
+
#return image_array
|
|
|
238 |
|
239 |
|
240 |
return rgb_img_float, batch_explanations, results
|