plotly / dash-canvas

An interactive image editing component for Dash
https://dash.plot.ly/canvas
Other
84 stars 26 forks source link

Zoomed image moves away upon Save #6

Open mkcor opened 5 years ago

mkcor commented 5 years ago

Dear @emmanuelle,

Thanks for the great prototype!

I'm trying out https://dash-canvas-separate.herokuapp.com/ and I want to separate the two elements near the bottom right corner. I'm actually not sure whether they're already separated or not.

I'm taking the following sequence of actions:

It would be more natural for me to keep the same view, where the red line I drew disappears and the new estimated border appears.

Best, Marianne

emmanuelle commented 5 years ago

Thank you @mkcor ! I need to find a way to expose / persist the zoom and position of the image. Will look into this!

emmanuelle commented 5 years ago

Hi @mkcor I eventually solved the issue (see https://github.com/tbolis/react-sketch/issues/53 for the record). Please check on http://dash-canvas.herokuapp.com/ that it now behaves as expected.

mkcor commented 5 years ago

Oh, at the moment http://dash-canvas.herokuapp.com/ is erroring 404. And I obviously made a mistake when reporting the issue, since my screenshot shows http://dash-canvas.herokuapp.com/, not https://dash-canvas-separate.herokuapp.com/!

emmanuelle commented 5 years ago

Oh yes, I moved the app to a multipage app, now it's http://dash-canvas.herokuapp.com/app2 Sorry about that! (the README has been updated on the github repo)

mkcor commented 5 years ago

I'm now running the app locally (http://localhost:8050/app2) and experiencing the same behaviour...

mkcor commented 5 years ago

Maybe because I just did pip install dash-canvas instead of pip install -e .?

emmanuelle commented 5 years ago

@mkcor so sorry I missed your comment! Yes, you have to run the app using master, I haven't made a release yet with the changes...

emmanuelle commented 5 years ago

I have made several releases since then, so it should be OK now if you pip install -U :-)

mkcor commented 5 years ago

Sorry I haven't been responsive on this lately. I'm now running dash-canvas==0.0.6 but I still seem to run into the issue... :( Here's my before/after (segmentation update): before_seg_update Drew red line with pencil there. after_seg_update

And here's my stream when running python index.py

Possible precision loss when converting from float64 to uint8

and visiting http://localhost:8050/app2 (before doing any of the actual segmentation updating):

  ...
  File "/home/.../dash-canvas/app2_correct_segmentation.py", line 126, in update_figure
    overlay = segmentation.mark_boundaries(img, new_labels)
  File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/skimage/segmentation/boundaries.py", line 226, in mark_boundaries
    background=background_label)
  File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/skimage/segmentation/boundaries.py", line 169, in find_boundaries
    max_label = np.iinfo(label_img.dtype).max
  File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/numpy/core/getlimits.py", line 516, in __init__
    raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.