Spaces:
Sleeping
Sleeping
updated overlay visualisation
Browse files
yolov5.py
CHANGED
@@ -238,11 +238,12 @@ def dff_nmf(image, target_lyr, n_components):
|
|
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 |
|
243 |
#temp = image_array.reshape((rgb_img_float.shape[0],rgb_img_float.shape[1]) )
|
244 |
#visualization = show_factorization_on_image(rgb_img_float, image_array.resize((rgb_img_float.shape)) , image_weight=0.3)
|
245 |
-
|
|
|
246 |
plt.clf()
|
247 |
#return image_array
|
248 |
|
|
|
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 |
|
243 |
#temp = image_array.reshape((rgb_img_float.shape[0],rgb_img_float.shape[1]) )
|
244 |
#visualization = show_factorization_on_image(rgb_img_float, image_array.resize((rgb_img_float.shape)) , image_weight=0.3)
|
245 |
+
visualization = show_factorization_on_image(rgb_img_float, np.transpose(rgb_channels, (2, 0, 1)), image_weight=0.3)
|
246 |
+
results.append(visualization)
|
247 |
plt.clf()
|
248 |
#return image_array
|
249 |
|