Capability Introduction

Image recognition, automatic classification

Based on deep learning methods, image elements such as objects, scenes, and actions are identified, with corresponding tags applied, for flowers, birds, fish, insects, vehicles, and buildings, to cite a few examples. This API can be utilized for various intelligent services, making use of high-level image content comprehension, such as automatic classification and arrangement of images in the gallery, as well as the identification and sharing of social images. It identifies 100 different categories of objects, scenes, and actions, and tags information, applying cutting-edge intelligent image recognition algorithms for a high degree of accuracy.
Scenarios

Gallery management, intelligent recommendations

This API provides for accurate identification of 100 categories of objects, scenes, and actions, and can be applied in album categorization, smart image enhancement, voice and text image searches, and user preference tagging.

Customized push notifications

Detects labels for frequently browsed images based on user browsing habits, to predict user preferences and push relative contents or advertisements.

Automatic photo classification in gallery

Allows for users to search for, browse, and manage photos in Gallery with ease, through automatic photo classification.

Description

Request
Copy

Bitmap bitmap = BitmapFactory.decodeFile(filePath);
Frame frame = new Frame();// Construct FrameObject
frame.setBitmap(bitmap);
LabelDetector labelDetector = new LabelDetector (context);
JSONObject json = labelDetector.detect(frame, null);

Response
Copy

{"resultCode":0,"label":"{\"category\":
 
6,\"categoryProbability\":
 
0.19995117,\"labelContent\":[{\"labelId\":14,
 
\"probability\":0.19995117}]}"}

Start development here with Huawei

Service introduction

Service overview, application scenarios, and functions
Learn more

Access preparation

Preparation for access, such as registration, authentication, and agreement signing
Learn more

Sample code

Demonstration of sample code
Learn more

API description

Interface parameter definition, description, restrictions, and constraints
Learn more
FAQ
1Can I call the faceCompare() method without calling the prepare() method of the API?

Yes, you can. The engine is started by default in the faceCompare() method. If the engine has already been started, it will not restart.

2When should I call the release() method?

The release() method will uninstall a model that has been loaded to the NPU chip. If the app is no longer using face detection, uninstall the model in a timely manner to free up resources.