DeepLabCut / napari-deeplabcut

a napari plugin for labeling and refining keypoint data within DeepLabCut projects
GNU Lesser General Public License v3.0
51 stars 22 forks source link

Missing Keypoint Selection Window #99

Closed enates499 closed 11 months ago

enates499 commented 11 months ago

When labeling frames via the DLC GUI on napari I can only label the first keypoint. I am missing the Keypoint Selection Window with the dropdown to select other keypoints as seen in the demo video. Attached is the terminal output when I run napari --info as well as a screenshot of the napari window.

I had issues downloading the DLC GUI on my MacBook w M2 Chip, this is the method that ended up working.

Screenshot 2023-09-18 at 11 47 15 AM Screenshot 2023-09-18 at 11 49 05 AM

jeylau commented 11 months ago

Hello @enates499, did you see an error in the terminal when this happened? I am on exactly the same machine and system (though with python 3.10) and cannot replicate this behavior, so I'm unclear about its cause.

MMathisLab commented 11 months ago

@enates499 we dropped it in the last release as it wasn't actually that useful as it could confuse people. So, now if you are on sequential, in your screenshot you would need to click on the Collected_Data layer, and you should be able to then add keypoints!

jeylau commented 11 months ago

@MMathisLab, it looks like it is the very dropdown selection widget that is missing.

MMathisLab commented 11 months ago

ah! sorry, missed that -- that I have:

Screen Shot 2023-09-18 at 6 55 15 PM

MMathisLab commented 11 months ago

@jeylau I can reproduce it --- If I create a NEW project. IF I load an older one it works as expected:

here is terminal traceback:

Traceback (most recent call last):
  File "/Users/mwmathis/Documents/DeepLabCut/deeplabcut/gui/tabs/label_frames.py", line 59, in label_frames
    _ = launch_napari(folder)
  File "/Users/mwmathis/Documents/DeepLabCut/deeplabcut/gui/widgets.py", line 45, in launch_napari
    viewer.open(files, plugin="napari-deeplabcut")
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/components/viewer_model.py", line 1092, in open
    self._add_layers_with_plugins(
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/components/viewer_model.py", line 1318, in _add_layers_with_plugins
    added.extend(self._add_layer_from_data(*_data))
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/components/viewer_model.py", line 1392, in _add_layer_from_data
    layer = add_method(data, **(meta or {}))
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/components/viewer_model.py", line 5, in add_points
    import os
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/_collections_abc.py", line 1073, in append
    self.insert(len(self), value)
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/components/layerlist.py", line 167, in insert
    super().insert(index, new_layer)
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/utils/events/containers/_selectable_list.py", line 66, in insert
    super().insert(index, value)
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/utils/events/containers/_evented_list.py", line 195, in insert
    self.events.inserted(index=index, value=value)
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/utils/events/event.py", line 768, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/utils/events/event.py", line 806, in _invoke_callback
    _handle_exception(
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari/utils/events/event.py", line 795, in _invoke_callback
    cb()
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari_deeplabcut/_widgets.py", line 470, in _load_dataframe
    self.df = _form_df(
  File "/Users/mwmathis/miniconda/envs/DEEPLABCUT_M1/lib/python3.9/site-packages/napari_deeplabcut/_writer.py", line 34, in _form_df
    if not properties["id"][0]:
IndexError: index 0 is out of bounds for axis 0 with size 0
jeylau commented 11 months ago

@enates499, we've just updated the labeling plugin, you can get it with pip install -U napari-deeplabcut 😊

enates499 commented 11 months ago

Thank you so much! The widget is now there and I can label any of the keypoints.

enates499 commented 10 months ago

Hello, thank you for your help earlier @jeylau @MMathisLab. Now I am trying to add new keypoints to my model. I added the new points to config.yaml, but they do not show up on the drop down widget, so I cannot label them - it seems I should be able to add new labels to an existing set rather than creating a whole new project. Thanks!

Screenshot 2023-10-28 at 11 46 24 AM

Screenshot 2023-10-28 at 11 46 54 AM

MMathisLab commented 10 months ago

Indeed that should work! We will check it out Monday- thanks for raising the issue!

Cc @jeylau 🤗

jeylau commented 10 months ago

@enates499, could you confirm that the keypoints you added through the ConfigEditor are also present in the config.yaml file?

enates499 commented 10 months ago

@jeylau @MMathisLab thank you! yes they are in the config.yaml file that I uploaded when I selected load project (I shut everything down and reloaded the file etc). monday is great - enjoy the weekend!

Screenshot 2023-10-28 at 5 03 05 PM

enates499 commented 10 months ago

hi @MMathisLab @jeylau curious if anyone was able to take a look at this today - thanks!

jeylau commented 10 months ago

@enates499, I can't reproduce the issue. After you update your config.yaml file, and your data are visible in the GUI, make sure you load the new config either by dropping it onto the canvas or with File > Open File(s) (as explained in (2) of https://github.com/DeepLabCut/napari-deeplabcut#workflow). This will update the underlying data, color scheme and all widgets.

enates499 commented 10 months ago

@jeylau thank you, didn't realize I needed to open napari and then reupload the new config file