segment_xai_area_coordinates = why_explain.annotate(
img_batch,
imgorig.size,
threshold=0.85,
explain_class=None,
method="GradCam",
)
im = plt.imread(filename)
implot = plt.imshow(im)
for p,q in [(x["x"],x["y"]) for x in segment_xai_area_coordinates]:
x_cord = p # try this change (p and q are already the coordinates)
y_cord = q
plt.scatter([x_cord], [y_cord])
plt.savefig("my_segment_area.png)
plt.clf()