Introduction
The best practice for FunctionGraph guides you through pornographic image identification based on functions.
Objective
In this example, FunctionGraph interconnects with the Artificial Intelligence (AI) Service to identify pornographic images. You can create an APIG trigger to provide external API services for pornographic image identification.
To visually demonstrate how to identify pornographic images, this example provides a frontend page for you to upload images and view the identification results.
Using FunctionGraph to build AI applications has the following advantages:
- Simplifies the development process and focuses on service implementation.
- Flexibly interconnects with cloud services to improve development efficiency.
- Scales automatically and bills per use to prevent waste of resources.
- Requires no maintenance and provides high availability at low costs.
Scenarios
This example uses the following cloud services:
- Content Moderation: provides an API for image identification. For details, see Content Moderation.
- FunctionGraph: builds a pornographic image identification function. For details, see the official website of FunctionGraph.
- API Gateway: provides an API for pornographic image identification. For details, see API Gateway.
- OBS: hosts frontend code to provide a static website. For details, see Object Storage Service.
Figure 1 shows the simulated image identification page.
Figure 2 illustrates the principle of image identification.
- OBS hosts frontend code to provide a static website. A frontend page is provided for uploading images.
- After an image is uploaded, the frontend code calls the API provided by API Gateway to trigger the backend function.
- During execution, the function calls the image moderation API.
- The Content Moderation service determines whether the uploaded image is acceptable and returns the identification result.
Resource Preparation
- Apply for the Content Moderation service.
- Apply for the API Gateway service.
- Apply for the FunctionGraph service.
- Apply for the OBS service.
Procedure
- Create the following resources:
- One agency: enables FunctionGraph to access API Gateway, Image Moderation, and OBS resources.
- One API group: a collection of APIs. API providers classify APIs into different API groups and manage APIs by API group.
- One OBS bucket: hosts the frontend program to provide a static website.
- Build a backend function.
- Create a backend function to implement image identification.
- Create an APIG trigger for the backend function and provide an API to invoke the backend function.
- Build a frontend function.
- Create a frontend function to provide a frontend page.
- Create an APIG trigger for the frontend function and provide an API to invoke the frontend function.
- Upload an image and check whether the image is acceptable.
Price Description
- The Image Moderation, API Gateway, and FunctionGraph services used in this example are under an OBT, and can be used for free during this period. You will be charged only after the OBT is ended. For details, see the Product Introduction of each service.
- For OBS, you will be charged based on the following rules. For details, see OBS Pricing Details.
Last Article: Building an AI Application for Identifying Pornographic Images
Next Article: Preparation


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.