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

labelling GUI won't open frames after manual extraction (avi video) #120

Closed geffenlab closed 2 months ago

geffenlab commented 6 months ago

I am trying to use the labelling GUI to refine the labels on some manually extracted frames. I extracted the frames manually and then when I go to use the labellingGUI to refine the labels on these frames it won't open them. In the GUI I get the following error: "Tried opening with napari-deeplabcut but failed". It then prompts me to use the napai-builtin and to override the existing preference, nothing happens if I do that though.

In the anaconda prompt window, I get the following: Traceback (most recent call last): File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1202, in _open_or_raise_error added = self._add_layers_with_plugins( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1292, in _add_layers_with_plugins layer_data, hookimpl = read_data_with_plugins( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\plugins\io.py", line 77, in read_data_with_plugins res = _npe2.read(paths, plugin, stack=stack) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\plugins_npe2.py", line 63, in read layer_data, reader = io_utils.read_get_reader( File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\io_utils.py", line 66, in read_get_reader return _read( File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\io_utils.py", line 160, in _read readfunc = rdr.exec(kwargs={"path": paths, "stack": stack}) File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\manifest\contributions_readers.py", line 52, in exec callable = super().exec(kwargs=kwargs) File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\manifest\utils.py", line 65, in exec return self.get_callable(_registry)(*args, **kwargs) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_deeplabcut_reader.py", line 81, in get_folder_parser layers.extend(read_hdf(datafile)) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_deeplabcut_reader.py", line 180, in read_hdf temp = pd.read_hdf(filename) File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\pandas\io\pytables.py", line 437, in read_hdf raise ValueError( ValueError: key must be provided when HDF5 file contains multiple datasets.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_qt\qt_viewer.py", line 953, in _qt_open self.viewer.open( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1102, in open layers = self._open_or_raise_error( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1211, in _open_or_raise_error raise ReaderPluginError( napari.errors.reader_errors.ReaderPluginError: Tried opening with napari-deeplabcut, but failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_qt\qt_viewer.py", line 1318, in dropEvent self._qt_open( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_qt\qt_viewer.py", line 961, in _qt_open handle_gui_reading( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_qt\dialogs\qt_reader_dialog.py", line 201, in handle_gui_reading open_with_dialog_choices( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_qt\dialogs\qt_reader_dialog.py", line 294, in open_with_dialog_choices qt_viewer.viewer.open(paths, stack=stack, plugin=plugin_name, kwargs) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1092, in open self._add_layers_with_plugins( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\components\viewer_model.py", line 1292, in _add_layers_with_plugins layer_data, hookimpl = read_data_with_plugins( File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\plugins\io.py", line 77, in read_data_with_plugins res = _npe2.read(paths, plugin, stack=stack) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\plugins_npe2.py", line 63, in read layer_data, reader = io_utils.read_get_reader( File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\io_utils.py", line 66, in read_get_reader return _read( File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\io_utils.py", line 163, in _read if layer_data := read_func(paths, stack=stack): File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\npe2\manifest\contributions_readers.py", line 60, in npe1compat return callable(path) # type: ignore File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_builtins\io_read.py", line 491, in _magic_imreader return [(magic_imread(path),)] File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_builtins\io_read.py", line 227, in magic_imread image = imread(filename) File "C:\Users\SeaMonkey\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_builtins\io_read.py", line 94, in imread return imageio.imread(filename) File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\imageio\v2.py", line 226, in imread with imopen(uri, "ri", imopen_args) as file: File "C:\Users\SeaMonkey\AppData\Roaming\Python\Python38\site-packages\imageio\core\imopen.py", line 303, in imopen raise err_type(err_msg) ValueError: Could not find a backend to open C:\Users\SeaMonkey\Documents\deeplabcut\Kath\2P_across_mice-Kath-2024-02-26\labeled-data\20191121K156_2P_FRA_539_ds\CollectedData_Kath.csv`` with iomoderi`.

Is there a way I can fix this easily? I'm not sure what happened... Thanks!

geffenlab commented 6 months ago

Now the labelling GUI is not working at all. When I open it, I get the tutorial box but a completely white window and an error about fonts in the command window: WARNING: DirectWrite: CreateFontFaceFromHDC() failed (Indicates an error in an input file such as a font file.) for QFontDef(Family="MS Sans Serif", pointsize=12, pixelsize=16, styleHint=5, weight=400, stretch=100, hintingPreference=0) LOGFONT("MS Sans Serif", lfWidth=0, lfHeight=-16) dpi=106

image

Kirito2933 commented 6 months ago

Hello, I also have this problem, has it been solved?

jeylau commented 5 months ago

@geffenlab, it looks like there is something wrong with how the h5 data file was saved. Would you be willing to share your image folder so I can take a look?