Here's the translated document in English:
To use the Face++ Face Detection API, you first need to register an account on the Face++ official website. After registration, you will be able to access the API console and related services.
- Visit the Face++ Official Website.
- Click the "Register" button and fill in the relevant information to create your account.
After registering and logging in, you need to obtain the API Key and API Secret for authentication. This information is necessary for calling the API.
- Log in to your Face++ account.
- Go to Console -> Application Management -> API Key.
- In the console, you will see your API Key and API Secret.
To securely use the API Key and API Secret in your code, it is recommended to set them as environment variables. This avoids hardcoding sensitive information in your code.
-
Windows:
- Open the Command Prompt.
- Enter the following commands and press Enter:
set FACE_PLUS_API_KEY="Your_API_KEY" set FACE_PLUS_API_SECRET="Your_API_SECRET"
-
Linux / macOS:
- Open the terminal.
- Enter the following commands and press Enter:
export FACE_PLUS_API_KEY="Your_API_KEY" export FACE_PLUS_API_SECRET="Your_API_SECRET"
Note: You may need to run the above commands before starting your application, or add these commands to your shell configuration file (e.g.,
.bashrc
or.bash_profile
) so that they are automatically loaded each time you start the terminal.
Run the Gradio service, and select "face++" in the "Face Detection Model".
python app.py