Coder Social home page Coder Social logo

chenglongma / skintoneclassifier Goto Github PK

View Code? Open in Web Editor NEW
69.0 3.0 10.0 3.94 MB

An easy-to-use library for skin tone classification

Home Page: https://chenglongma.com/SkinToneClassifier/

License: GNU General Public License v3.0

Python 100.00%
face-detection image-processing image-recognition image-segmentation skin-detection

skintoneclassifier's Issues

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

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

Issue with processing .jpg images in folder using GUI

Using GUI Mode and having a lot of trouble with the processing of images. All images are .jpg and getting the following error when selecting an entire folder with 22 images:

The program is processing your images...
Please wait for the program to finish.

Processing images: 0%| | 0/1 [00:00<?, ?images/s]Kenneth is not found or is not a valid image.

Processing images: 100%|██████████| 1/1 [00:00<00:00, 1.77images/s]
Processing images: 100%|██████████| 1/1 [00:00<00:00, 1.77images/s]

Any ideas or troubleshooting?

Not able to use stone command

I'm trying to test the library, but following the read.me steps I was unable to use the command stone. Am I missing something?
When I run the installation again, that cmd returns:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: skin-tone-classifier in c:\users\appdata\roaming\python\python39\site-packages (0.2.1)
Requirement already satisfied: opencv-python>=4.6.0.66 in c:\users\appdata\roaming\python\python39\site-packages (from skin-tone-classifier) (4.8.0.74)
Requirement already satisfied: numpy>=1.21.5 in c:\users\appdata\roaming\python\python39\site-packages (from skin-tone-classifier) (1.24.3)
Requirement already satisfied: colormath>=3.0.0 in c:\users\appdata\roaming\python\python39\site-packages (from skin-tone-classifier) (3.0.0)
Requirement already satisfied: tqdm>=4.64.0 in c:\users\appdata\roaming\python\python39\site-packages (from skin-tone-classifier) (4.65.0)
Requirement already satisfied: networkx>=2.0 in c:\users\appdata\roaming\python\python39\site-packages (from colormath>=3.0.0->skin-tone-classifier) (3.1)
Requirement already satisfied: colorama in c:\users\\appdata\roaming\python\python39\site-packages (from tqdm>=4.64.0->skin-tone-classifier) (0.4.6)

I'm using python 3.9.13 and pip 23.1.2.
Windows 11.
Also, when I try to use the stone command, and this not exist.

Skin Tone Classifier Execution in Google Colab"

Issue Description:

I encountered an issue when using the Skin Tone Classifier library in a Google Colab environment. The problem appears to be related to Qt platform plugins, and I received the following error messages:
qt.qpa.plugin: Could not find the Qt platform plugin "offscreen" in "/usr/local/lib/python3.10/dist-packages/cv2/qt/plugins"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.

Steps to Reproduce:
Install the Skin Tone Classifier library using pip install skin-tone-classifier --upgrade.
Run the following command in a Jupyter Notebook or Google Colab environment:
stone -i /path/to/image.jpg --debug

Expected Behavior:
I expected the Skin Tone Classifier to process the image and provide results as described in the library's documentation.

Actual Behavior:
Instead, I encountered the error messages mentioned above, which prevented the library from functioning correctly.

System Information:
Operating System: Google Colab (Colab's default environment)
Python Version: 3.10
Skin Tone Classifier Version: 1.0.0

My attempts
I attempted to resolve this issue by following the suggestions in the error message, but it did not resolve the problem. The issue seems to be related to the Qt platform plugins, specifically "offscreen."

Please let me know if there are any specific logs or additional information needed to diagnose and address this problem.
Thank you for your assistance.

Images using the black and white flag without specifying bw

If I run the command, stone -i ~/<path to image> --debug or explicitly give it the color option, stone -i ~/<path to image> color --debug, my image always appears in the bw folder and has the black and white color palette show up in debug mode. The only colored image I was able to get to work was the lena image from here http://www.lenna.org/. Any thoughts on what I'm doing wrong? Aside from that, great project!

AttributeError: module 'stone' has no attribute 'process'

The command line Version works, but:

I followed the instructions for using the library.

pip install skin-tone-classifier --upgrade

import stone

result = stone.process('xxx.jpg', image_type='color')

But then:

AttributeError: module 'stone' has no attribute 'process'

Python 3.10.11

Argument to disable face detection

I had to clone the repository and manually edit the code to disable face dection. I want to run the SkinToneClassifier over images for which the face is already cropped. Running the present code (version 0.1.11) results in either 'NA' (which is what I want) or some small subregions of the face (which I want to avoid right now).

Some examples:
2_2_0_1_1_10_2-1
2_2_0_1_1_12_2-1

Error processing image

If I don't use "--debug" comand, I get result.csv file with:
file,image type,face id,dominant 1,props 1,dominant 2,props 2,skin tone,PERLA,accuracy(0-100)
1,Error processing image 1: not enough values to unpack (expected 2, got 1)

With "--debug" I get for same image:
file,image type,face id,dominant 1,props 1,dominant 2,props 2,skin tone,PERLA,accuracy(0-100)
1-1,bw,1,#BD9F99,0.64,#696156,0.36,#909090,BH,84.18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.