Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglongMa committed Feb 3, 2024
1 parent eb5acc1 commit 333ac4d
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 33 deletions.
21 changes: 15 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
# Changelogs

## v1.2.0
## v1.2.3

<details markdown="1" open>
<summary><i>Click here to show more.</i></summary>

In this version, we have made the following changes:

1.**NEW!**: We add a GUI version of `stone` for users who are not familiar with the command line interface.
* You can use the config GUI of `stone` to process the images.
* See more information at [here](#use-stone-in-a-gui).
1. 🧬 **CHANGE!**: We change the GUI mode to **optional**.
* Now, you can install the GUI mode by running:
* ```bash
pip install skin-tone-classifier[all] --upgrade
```
* It will support both the **CLI** mode and the **GUI** mode.
* If you don't specify the `[all]` option, the app will install the CLI mode only.
2. 🧬 **CHANGE!**: [For developer]. We base the project to `project.toml` instead of `setup.py`.
</details>
## v1.1.3
## v1.2.0
<details markdown="1" open>
<summary><i>Click here to show more.</i></summary>
In this version, we have made the following changes:
1.**NEW!**: We add new **patterns** in the `-l` (or `--labels`) option to set the skin tone labels.
1. ✨ **NEW!**: We add a GUI version of `stone` for users who are not familiar with the command line interface.
* You can use the config GUI of `stone` to process the images.
* See more information at [here](#use-stone-in-a-gui).
2. ✨ **NEW!**: We add new **patterns** in the `-l` (or `--labels`) option to set the skin tone labels.
* Now, you can use the following patterns to set the skin tone labels:
* **Default value**: the uppercase alphabet list leading by the image type (`C` for `color`; `B`
for `Black&White`).
Expand Down
122 changes: 98 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
[![PyPI - Downloads](https://img.shields.io/pypi/dm/skin-tone-classifier)](https://pypi.org/project/skin-tone-classifier/)
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/ChenglongMa/SkinToneClassifier?include_prereleases)](https://github.com/ChenglongMa/SkinToneClassifier/releases/latest)
[![GitHub License](https://img.shields.io/github/license/ChenglongMa/SkinToneClassifier)](https://github.com/ChenglongMa/SkinToneClassifier/blob/main/LICENSE)
[![youtube](https://img.shields.io/badge/YouTube-Skin_Tone_Classifier-FF0000?logo=youtube)](https://youtube.com/playlist?list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&si=ezxUR7McUbZa4clT)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing)
[![GitHub Repo stars](https://img.shields.io/github/stars/ChenglongMa/SkinToneClassifier)](https://github.com/ChenglongMa/SkinToneClassifier)

An easy-to-use library for skin tone classification.
Expand All @@ -29,8 +31,16 @@ for me!*
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Video tutorials](#video-tutorials)
- [Playlist](#playlist)
- [1. How to install Python and `stone`](#1-how-to-install-python-and-stone)
- [2. Use `stone` in GUI mode](#2-use-stone-in-gui-mode)
- [3. Use `stone` in CLI mode](#3-use-stone-in-cli-mode)
- [4. Use `stone` in Python scripts](#4-use-stone-in-python-scripts)
- [Installation](#installation)
- [Install from pip](#install-from-pip)
- [Install the CLI mode only](#install-the-cli-mode-only)
- [Install the CLI mode and the GUI mode](#install-the-cli-mode-and-the-gui-mode)
- [Install from source](#install-from-source)
- [HOW TO USE](#how-to-use)
- [Quick Start](#quick-start)
Expand All @@ -49,29 +59,77 @@ for me!*
- [8. Tune parameters of face detection](#8-tune-parameters-of-face-detection)
- [9. Multiprocessing settings](#9-multiprocessing-settings)
- [10. Used as a library by importing into other projects](#10-used-as-a-library-by-importing-into-other-projects)
- [Changelogs](#changelogs)
- [v1.2.0](#v120)
- [v1.1.3](#v113)
- [v1.1.2](#v112)
- [v1.1.1](#v111)
- [v1.1.0](#v110)
- [v1.0.1](#v101)
- [v1.0.0](#v100)
- [v0.2.0](#v020)
- [Citation](#citation)
- [Contributing](#contributing)
- [Disclaimer](#disclaimer)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Video tutorials

[![youtube](https://img.shields.io/badge/YouTube-Skin_Tone_Classifier-FF0000?logo=youtube)](https://youtube.com/playlist?list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&si=ezxUR7McUbZa4clT)

Please visit the following video tutorials if you have no programming background or are unfamiliar with how to use Python and this library 💖

## Playlist

[![playlist](https://img.youtube.com/vi/vu6whI0qcmU/0.jpg)](https://youtube.com/playlist?list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&si=ezxUR7McUbZa4clT)

<details markdown="1">
<summary><i>Click here to show more.</i></summary>

## 1. How to install Python and `stone`

[![YouTube Video Views](https://img.shields.io/youtube/views/vu6whI0qcmU)](https://www.youtube.com/watch?v=vu6whI0qcmU&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=1)

[![installation](https://img.youtube.com/vi/vu6whI0qcmU/0.jpg)](https://www.youtube.com/watch?v=vu6whI0qcmU&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=1)

## 2. Use `stone` in GUI mode

[![YouTube Video Views](https://img.shields.io/youtube/views/08apMEogZgs)](https://www.youtube.com/watch?v=08apMEogZgs&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=2)

[![use gui mode](https://img.youtube.com/vi/08apMEogZgs/0.jpg)](https://www.youtube.com/watch?v=08apMEogZgs&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=2)

## 3. Use `stone` in CLI mode

[![YouTube Video Views](https://img.shields.io/youtube/views/rqJ62DijQaw)](https://www.youtube.com/watch?v=rqJ62DijQaw&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=3)

[![use cli mode](https://img.youtube.com/vi/rqJ62DijQaw/0.jpg)](https://www.youtube.com/watch?v=rqJ62DijQaw&list=PLYRpHlp-9V_E5ZLhW1hbNaVjS5Zg6b6kQ&index=3)

## 4. Use `stone` in Python scripts

Please refer to this notebook [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing) for more information.

_More videos are coming soon..._

</details>

# Installation

> [!TIP]
>
> Since v1.2.3, we have made the GUI mode **optional**.
>

## Install from pip

### Install the CLI mode only

```shell
pip install skin-tone-classifier --upgrade
```

It is useful for users who want to use this library in non-GUI environments, e.g., servers or [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing).

### Install the CLI mode and the GUI mode

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

It is useful for users who are not familiar with the command line interface and want to use the GUI mode.

## Install from source

```shell
Expand All @@ -80,17 +138,24 @@ cd SkinToneClassifier
pip install -e . --verbose
```

> [!TIP]
>
> If you encounter the following problem:
>
> [`ImportError: DLL load failed while importing _core: The specified module could not be found`](https://stackoverflow.com/q/52306805/8860079)
>
> Please download and install **Visual C++ Redistributable** at [here](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022).
>
> Then this error will be gone.
# HOW TO USE

> [!TIP]
>
> You can combine the following documents
> and [running examples](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing) in
> Google
> Colab to understand the usage of this library more intuitively.
>
> See the running
> examples [here](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing).
> You can combine the following documents, [the video tutorials above](#video-tutorials)
> and the running examples [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1k-cryEZ9PInJRXWIi17ib66ufYV2Ikwe?usp=sharing)
> to understand the usage of this library more intuitively.
>
## Quick Start

Expand All @@ -114,12 +179,21 @@ Hopefully, this can make it easier for you to use `stone` 🍻!

> [!TIP]
>
> It is recommended to install v1.2.1, which supports Python 3.9+.
> 1. It is recommended to install v1.2.3+, which supports Python 3.9+.
>
> If you have installed v1.2.0, please upgrade to v1.2.1 by running
> If you have installed v1.2.0, please upgrade to v1.2.3+ by running
>
> `pip install skin-tone-classifier --upgrade`
> `pip install skin-tone-classifier[all] --upgrade`
>
> 2. If you encounter the following problem:
> > This program needs access to the screen. Please run with a Framework
> > build of python, and only when you are logged in on the main display
> > of your Mac.
>
> Please launch the GUI by running `pythonw -m stone` in the terminal.
> References:
> * [stackoverflow](https://stackoverflow.com/a/52732858/8860079)
> * [python-using-mac](https://docs.python.org/3/using/mac.html)
### Use `stone` in command line interface (CLI)

Expand Down Expand Up @@ -517,6 +591,7 @@ The `result_json` will be like:
}
```


# Citation

If you are interested in our work, please cite:
Expand Down Expand Up @@ -563,9 +638,8 @@ If you are interested in our work, please cite:

# Disclaimer

The images used in this project are from [Flickr-Faces-HQ Dataset (FFHQ)](https://github.com/NVlabs/ffhq-dataset), which
is licensed under
the [Creative Commons BY-NC-SA 4.0 license](https://github.com/NVlabs/ffhq-dataset/blob/master/LICENSE.txt)
The images used in this project are from [Flickr-Faces-HQ Dataset (FFHQ)](https://github.com/NVlabs/ffhq-dataset),
which is licensed under the [Creative Commons BY-NC-SA 4.0 license](https://github.com/NVlabs/ffhq-dataset/blob/master/LICENSE.txt).

Thank you for considering contributing to **SkinToneClassifier**. We value your input and look forward to collaborating
with you!
Thank you for considering contributing to **SkinToneClassifier**.
We value your input and look forward to collaborating with you!
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requires-python = ">=3.9"
# that contains the license
# https://packaging.python.org/en/latest/specifications/core-metadata/#license
#license = { file = "LICENSE" }
license = "GNU General Public License v3 (GPLv3)"
license = "GPL-3.0-or-later"

# This field adds keywords for your project which will appear on the
# project page. What does your project relate to?
Expand Down Expand Up @@ -130,7 +130,7 @@ dependencies = [# Optional
# Similar to `dependencies` above, these must be valid existing
# projects.
[project.optional-dependencies] # Optional
gui = [
all = [
"gooey>=1.0.8.1",
"re-wx==0.0.10",
"colored==1.3.93",
Expand Down
2 changes: 1 addition & 1 deletion src/stone/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def check_version():
print(
Fore.YELLOW + f"You are using an outdated version of {__package_name__} ({installed_version}).\n"
f"Please upgrade to the latest version ({latest_version}) with the following command:\n",
Fore.GREEN + f"pip install {__package_name__} --upgrade\n" + Fore.RESET,
Fore.GREEN + f"pip install {__package_name__}[all] --upgrade\n" + Fore.RESET,
)
os.environ["STONE_UPGRADE_FLAG"] = "1"
except Exception:
Expand Down

0 comments on commit 333ac4d

Please sign in to comment.