holoviz-topics / holodoodler

7 stars 4 forks source link

Assertion error when computing segmentation #25

Open csherwood-usgs opened 2 years ago

csherwood-usgs commented 2 years ago

I get the following when trying to compute segmentation on the third example (orthomosaic.jpg), which has no data in lower left quadrant. I did not have any doodles there. I also had done some zooming and panning while doodling.

  File "C:\Users\csherwood\Anaconda3\envs\doodler-dev\lib\site-packages\param\parameterized.py", line 400, in _depends
    return func(*args, **kw)
  File "C:\crs\src\holodoodler\doodler\components.py", line 562, in _compute_segmentation
    y_target_range=(0, img_height),
  File "C:\crs\src\holodoodler\doodler\components.py", line 273, in project_doodles
    df_proj['x_proj'] = _project_line_dimension(df_proj['x'], x_cur_range, x_target_range)
  File "C:\crs\src\holodoodler\doodler\components.py", line 254, in _project_line_dimension
    assert ((cur_range[0] <= s) & (s <= cur_range[1])).all()
AssertionError
csherwood-usgs commented 2 years ago

After some experimentation, I am pretty sure the assertion error during segmentation occurs if the image has not been "reset" to the original zoom level (and maybe bounds). If you can trigger the "reset" action before starting the segmentation, that might prevent the error. For now, the workaround is to remember to reset if you have been zooming.

maximlt commented 2 years ago

Thanks for reporting this error, that indeed looks like a bug.

maximlt commented 2 years ago

@csherwood-usgs I haven't been able to reproduce this bug. Do you have more info about as to I could reproduce it? I've tried doodling lines after zooming in and panning out, then triggering the segmentation but I got no error.

I made a few changes today to simplify the app and validate the doodles, maybe they'll help with this issue https://github.com/pyviz-topics/holodoodler/pull/29

csherwood-usgs commented 2 years ago

@maximlt Hmm. I can't reproduce it now either. If I encounter it again, I will make a video of it.