Spaces:
Sleeping
Sleeping
debug: float range
Browse files
yolov5.py
CHANGED
@@ -236,7 +236,7 @@ def dff_nmf(image, target_lyr, n_components):
|
|
236 |
print("____________image_arrya", image_array.shape)
|
237 |
image_resized = cv2.resize(image_array, (640, 640))
|
238 |
rgba_channels = cv2.split(image_resized)
|
239 |
-
alpha_channel = rgba_channels[3]
|
240 |
rgb_channels = np.stack(rgba_channels[:3], axis=-1)
|
241 |
overlay_img = (alpha_channel[..., None] * image) + ((1 - alpha_channel[..., None]) * rgb_channels)
|
242 |
|
@@ -253,6 +253,7 @@ def dff_nmf(image, target_lyr, n_components):
|
|
253 |
def visualize_batch_explanations(rgb_img_float, batch_explanations, image_weight=0.7):
|
254 |
for i, explanation in enumerate(batch_explanations):
|
255 |
# Create visualization for each explanation
|
|
|
256 |
visualization = show_factorization_on_image(rgb_img_float, explanation, image_weight=image_weight)
|
257 |
plt.figure()
|
258 |
plt.imshow(visualization) # Correctly pass the visualization data
|
|
|
236 |
print("____________image_arrya", image_array.shape)
|
237 |
image_resized = cv2.resize(image_array, (640, 640))
|
238 |
rgba_channels = cv2.split(image_resized)
|
239 |
+
alpha_channel = rgba_channels[3]
|
240 |
rgb_channels = np.stack(rgba_channels[:3], axis=-1)
|
241 |
overlay_img = (alpha_channel[..., None] * image) + ((1 - alpha_channel[..., None]) * rgb_channels)
|
242 |
|
|
|
253 |
def visualize_batch_explanations(rgb_img_float, batch_explanations, image_weight=0.7):
|
254 |
for i, explanation in enumerate(batch_explanations):
|
255 |
# Create visualization for each explanation
|
256 |
+
print("visualization concepts",rgb_img_float.shape,explanation.shape )
|
257 |
visualization = show_factorization_on_image(rgb_img_float, explanation, image_weight=image_weight)
|
258 |
plt.figure()
|
259 |
plt.imshow(visualization) # Correctly pass the visualization data
|