chenglongma / skintoneclassifier Goto Github PK
View Code? Open in Web Editor NEWAn easy-to-use library for skin tone classification
Home Page: https://chenglongma.com/SkinToneClassifier/
License: GNU General Public License v3.0
An easy-to-use library for skin tone classification
Home Page: https://chenglongma.com/SkinToneClassifier/
License: GNU General Public License v3.0
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
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
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.
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).
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?
any idea how to use stone in my code so I can create an API from it .
For example, I swap a black girl face to a white girl, but there is a big difference in color between the face color and skin color. I would like to ask you if this project will help solve this problem, thanks!
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
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!
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.