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

Setting color palette throws TypeError: unhashable type: 'list' #25

Closed
ergo70 opened this issue Mar 4, 2024 · 4 comments
Closed

Setting color palette throws TypeError: unhashable type: 'list' #25

ergo70 opened this issue Mar 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ergo70
Copy link

ergo70 commented Mar 4, 2024

When trying to set a custom palette, e.g. in code:

stone.process(
        tmp_path, image_type='color', n_dominant_colors=5, tone_palette=["#6f503c", "#81654f", "#9d7a54", "#bea07e", "#e5c8a62"], tone_labels=[1, 2, 3, 4, 5])

I get TypeError: unhashable type: 'list' in File "/Python/Python310/lib/site-packages/stone/api.py", line 73, in process skin_tone_palette = normalize_palette(tone_palette)

I think this is the correct way, but I might be wrong, otherwise this is a bug.

best regards

Ernst-Georg

@ergo70 ergo70 added the bug Something isn't working label Mar 4, 2024
@ChenglongMa
Copy link
Owner

Thanks for your feedback. I will check and fix it soon :)

@ergo70
Copy link
Author

ergo70 commented Mar 4, 2024

The same happens on the CLI:

stone -p "#6f503c #81654f #9d7a54 #bea07e #e5c8a6"

File "/Python/Python310/lib/site-packages/stone/main.py", line 123, in main
specified_palette = normalize_palette(specified_palette)
TypeError: unhashable type: 'list'

@ChenglongMa
Copy link
Owner

Hi @ergo70,

Thank you so much for your valuable feedback.

I've fixed it and released a new version.

Please upgrade the library by running one of the following commands:

pip install skin-tone-classifier[all] --upgrade

or

pip install skin-tone-classifier --upgrade

Thanks!

@ergo70
Copy link
Author

ergo70 commented Mar 4, 2024

Yes, it works now as described.

Thank, you for fixing this.

@ergo70 ergo70 closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants