sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Labeling: crashing on frame switch while all labels are hidden

Open UbaZumbar opened this issue 3 years ago • 1 comments

Bug description

While labeling I encountered some frames where none of the desired body parts are visible so I hid all the nodes. When switching to another frame I re-enabled visibility of nodes and the whole program crashed.

Expected behaviour

I was expecting all hidden nodes to be visible again so I can continue labeling.

Actual behaviour

SLEAP crashed.

Your personal set up

  • OS: Windows 10 Education 64-bit operating system, x64-based processor AMD Ryzen 5 5500U with Radeon Graphics 2.10 GHz RAM: 16.0 GB NVIDIA GeForce GTX 1650
  • Version(s): SLEAP: 1.2.8 TensorFlow: 2.6.3 Numpy: 1.19.5 Python: 3.7.12
Environment packages
# paste output of `pip freeze` or `conda list` here
Logs

Log of two consecutive crashes

(base) C:\Users\Ive>conda activate sleap

(sleap) C:\Users\Ive>sleap-label Saving config: C:\Users\Ive/.sleap/1.2.8/preferences.yaml Restoring GUI state...

Software versions: SLEAP: 1.2.8 TensorFlow: 2.6.3 Numpy: 1.19.5 Python: 3.7.12 OS: Windows-10-10.0.19041-SP0

Happy SLEAPing! :) Traceback (most recent call last): File "C:\Users\Ive\anaconda3\envs\sleap\lib\site-packages\sleap\gui\dataviews.py", line 240, in flags item, key = self.get_from_idx(index) File "C:\Users\Ive\anaconda3\envs\sleap\lib\site-packages\sleap\gui\dataviews.py", line 224, in get_from_idx item = self.original_items[index.row()] IndexError: list index out of range

(sleap) C:\Users\Ive>sleap-label Saving config: C:\Users\Ive/.sleap/1.2.8/preferences.yaml Restoring GUI state...

Software versions: SLEAP: 1.2.8 TensorFlow: 2.6.3 Numpy: 1.19.5 Python: 3.7.12 OS: Windows-10-10.0.19041-SP0

Happy SLEAPing! :)

(sleap) C:\Users\Ive>

# paste relevant logs here, if any

Screenshots

How to reproduce

  1. Go to Instances
  2. Click new instance
  3. Right click on all the nodes to hide them
  4. Go to Labeling Suggestions
  5. Click next for the next frame
  6. Go to Instances
  7. Click new instance
  8. Press H to toggle visibility
  9. SLEAP crashes

UbaZumbar avatar Sep 28 '22 13:09 UbaZumbar

This seems like it is related to #969 - when I change the conditional in https://github.com/talmolab/sleap/blob/develop/sleap/gui/widgets/video.py#L449-L466 such that user-labeled instances are always added to the scene:

if instance.instance.n_visible_points > 0 or not isinstance(instance.instance, PredictedInstance):
            self.view.scene.addItem(instance)

            # connect signal so we can adjust QtNodeLabel positions after zoom
            self.view.updatedViewer.connect(instance.updatePoints)

then the program no longer crashes.

roomrys avatar Sep 28 '22 17:09 roomrys