Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: add_labels() got an unexpected keyword argument 'color' #29

Open
paapu88 opened this issue Nov 25, 2024 · 2 comments
Open

TypeError: add_labels() got an unexpected keyword argument 'color' #29

paapu88 opened this issue Nov 25, 2024 · 2 comments

Comments

@paapu88
Copy link

paapu88 commented Nov 25, 2024

Dear Developers,
I have ubuntu linux 24.04 and did run the following:

 python -m venv ~/venvs/napari
source ~/venvs/napari/bin/activate
pip install pyqt5
pip install pyside2
pip install git+https://github.com/jookuma/napari-segment-anything.git

Now running in segment-anything directory with their dog
(from https://github.com/facebookresearch/segment-anything.git)
napari images/dog.jpg -w napari-segment-anything 'Segment Anything'

Shows quickly the image and then dies with the following:

Traceback (most recent call last):
File "/home/markus/venvs/napari/bin/napari", line 8, in
sys.exit(main())
^^^^^^
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari/main.py", line 584, in main
_run()
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari/main.py", line 383, in _run
first_dock_widget = viewer.window.add_plugin_dock_widget(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari/_qt/qt_main_window.py", line 1081, in add_plugin_dock_widget
wdg = _instantiate_dock_widget(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari/_qt/qt_main_window.py", line 1894, in _instantiate_dock_widget
return wdg_cls(**kwargs)
^^^^^^^^^^^^^^^^^
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari_segment_anything/_widget.py", line 71, in init
self._mask_layer = self._viewer.add_labels(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/markus/venvs/napari/lib/python3.12/site-packages/napari/utils/_proxies.py", line 194, in call
return self.create(self.wrapped(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: add_labels() got an unexpected keyword argument 'color'
WARNING: QThread: Destroyed while thread is still running
13:20:16 : WARNING : MainThread : QThread: Destroyed while thread is still running
Aborted (core dumped)

Terveisin, Markus

@JoOkuma
Copy link
Member

JoOkuma commented Dec 2, 2024

Hi, @paapu88, thanks for pointing this out.

napari deprecated the color keyword argument from add_labels

I currently don't have time to fix this, but I'm happy to review a PR if you have the bandwidth to fix this and update the napari version.

@paapu88
Copy link
Author

paapu88 commented Dec 2, 2024

Ok, did pull request with a fix.
Thanks for this repo, it combines great things!
Terveisin, Markus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants