Skip to content

Commit

Permalink
Merge pull request #152 from mlexchange/revert-151-segmentation-resul…
Browse files Browse the repository at this point in the history
…ts-improvements

Revert "Segmentation result improvements"
  • Loading branch information
danton267 authored Oct 25, 2023
2 parents 27a3d08 + 1fc979e commit a09ed26
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions callbacks/image_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,7 @@ def render_image(
tf = np.zeros((500, 500))
fig = px.imshow(tf, binary_string=True)
if toggle_seg_result:
unique_segmentation_values = np.unique(result)
normalized_range = np.linspace(
0, 1, len(unique_segmentation_values)
) # heatmap requires a normalized range
color_list = (
px.colors.qualitative.Plotly
) # TODO placeholder - replace with user defined classess
colorscale = [
[normalized_range[i], color_list[i % len(color_list)]]
for i in range(len(unique_segmentation_values))
]
fig.add_trace(
go.Heatmap(
z=result,
colorscale=colorscale,
showscale=False,
)
)
fig.add_trace(go.Heatmap(z=result, showscale=False, colorscale=None))
fig["data"][1]["opacity"] = opacity / 100

fig.update_layout(
Expand Down

0 comments on commit a09ed26

Please sign in to comment.