Spaces:
Sleeping
Sleeping
stack components
Browse files
yolov5.py
CHANGED
@@ -77,13 +77,13 @@ def xai_yolov5(image):
|
|
77 |
cam_image, renormalized_cam_image = generate_cam_image(model, target_layers, tensor, image, boxes)
|
78 |
|
79 |
rgb_img_float, batch_explanations, result = dff_nmf(image, target_lyr = -5, n_components = 8)
|
80 |
-
|
81 |
im = visualize_batch_explanations(rgb_img_float, batch_explanations)
|
82 |
|
83 |
# Combine results
|
84 |
final_image = np.hstack((image, detections_img, renormalized_cam_image, im))
|
85 |
caption = "Results using YOLOv5"
|
86 |
-
return Image.fromarray(final_image), caption, result
|
87 |
|
88 |
|
89 |
|
|
|
77 |
cam_image, renormalized_cam_image = generate_cam_image(model, target_layers, tensor, image, boxes)
|
78 |
|
79 |
rgb_img_float, batch_explanations, result = dff_nmf(image, target_lyr = -5, n_components = 8)
|
80 |
+
result = np.hstack(result)
|
81 |
im = visualize_batch_explanations(rgb_img_float, batch_explanations)
|
82 |
|
83 |
# Combine results
|
84 |
final_image = np.hstack((image, detections_img, renormalized_cam_image, im))
|
85 |
caption = "Results using YOLOv5"
|
86 |
+
return Image.fromarray(final_image), caption, result
|
87 |
|
88 |
|
89 |
|