I'm trying to overlay an mask on an image in plotly. I'm trying to do this as you would with two scatter plots for instance, but the error says that the data property is wrong when adding the figure to the trace.
rgb_pad_removed, thermal_img = get_thermal_and_rgb(img_path)
img, mask = get_masked_image(rgb_pad_removed)
thermal_img_resized = cv2.resize(thermal_img, dsize=(mask.shape[1], mask.shape[0]), interpolation=cv2.INTER_CUBIC)
from plotly.subplots import make_subplots
f1 = px.imshow(rgb_pad_removed)
f2 = px.imshow(mask)
fig = make_subplots()
fig.add_trace(f1)
fig.add_trace(f2)
fig.show()
With the following error:
ValueError:
Invalid element(s) received for the 'data' property of
Invalid elements include: [Figure({
ect...
Am I using the correct method or is there a better one?