You are on page 1of 350

Huawei HiLens

User Guide

Issue 01
Date 2021-07-14

HUAWEI TECHNOLOGIES CO., LTD.


Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of Huawei Technologies Co., Ltd.

Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.

Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.


Address: Huawei Industrial Base
Bantian, Longgang
Shenzhen 518129
People's Republic of China

Website: https://www.huawei.com
Email: support@huawei.com

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. i


Huawei HiLens
User Guide Contents

Contents

1 Who Uses Huawei HiLens......................................................................................................1


2 Procedures for Using Huawei HiLens..................................................................................3
3 Permissions Management................................................................................................... 14
3.1 Creating a User and Granting Permissions.................................................................................................................. 14
3.2 Creating a Huawei HiLens Custom Policy.................................................................................................................... 15
3.3 Permissions Policies and Supported Actions............................................................................................................... 16
3.3.1 Introduction......................................................................................................................................................................... 16
3.3.2 Device Management Permissions................................................................................................................................ 17
3.3.3 Skill Development Permissions..................................................................................................................................... 19
3.3.4 Skill Market Permissions................................................................................................................................................. 21
3.3.5 Product Management Permissions.............................................................................................................................. 22

4 Creating a Workspace.......................................................................................................... 23
5 Subscribing to Huawei HiLens Products.......................................................................... 26
5.1 Subscribing to HiLens Studio............................................................................................................................................ 26
5.2 Subscribing to HiLens Device-Edge-Cloud Synergy Platform Service................................................................. 30
5.3 Purchasing HiLens Kit Devices.......................................................................................................................................... 32
5.4 Purchasing Skills.................................................................................................................................................................... 33
5.5 Subscribing to Huawei RPA WeAutomate....................................................................................................................34
5.5.1 Purchasing and Using Huawei RPA WeAutomate..................................................................................................34
5.5.2 Trying the Standalone Edition of Huawei RPA WeAutomate............................................................................ 36
5.6 Managing Orders.................................................................................................................................................................. 38

6 Registering HiLens Kit Devices...........................................................................................42


6.1 Registering a HiLens Kit Device....................................................................................................................................... 42
6.2 Registering a Device Using the Intelligent Edge System........................................................................................ 47
6.2.1 Connecting a HiLens Kit Device to a PC.................................................................................................................... 47
6.2.2 Upgrading the HiLens Kit System Firmware Version............................................................................................ 50
6.2.3 Synchronizing the Time Zone and Time.................................................................................................................... 53
6.2.4 Configuring the Wireless Network.............................................................................................................................. 54
6.2.5 Configuring the Wired Network................................................................................................................................... 57
6.2.6 Registering a HiLens Kit Device.................................................................................................................................... 60
6.3 Registering a Device Using SSH....................................................................................................................................... 62

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. ii


Huawei HiLens
User Guide Contents

6.3.1 Connecting a HiLens Kit Device to a PC.................................................................................................................... 62


6.3.2 Logging In to a HiLens Kit Device Using SSH..........................................................................................................65
6.3.3 Wireless Network Configuration (SSH)..................................................................................................................... 67
6.3.4 Wired Network Configuration (SSH).......................................................................................................................... 70
6.3.5 Registering a HiLens Kit Device.................................................................................................................................... 73
6.4 Configure Networking......................................................................................................................................................... 75
6.4.1 Networking Configuration Modes............................................................................................................................... 75
6.4.2 Wireless Network (External Network) and Wired Network (Internal Network)........................................ 76
6.5 Configuring a Firewall......................................................................................................................................................... 82
6.6 Using an SD Card.................................................................................................................................................................. 83

7 Managing Devices................................................................................................................. 84
7.1 Device Management Overview........................................................................................................................................ 84
7.2 Activating Devices (Purchasing HiLens Device-Edge-Cloud Synergy Platform Service).............................. 85
7.3 Managing Skills on Devices............................................................................................................................................... 88
7.3.1 Skill Management Overview......................................................................................................................................... 88
7.3.2 Installing a Skill.................................................................................................................................................................. 90
7.3.3 Adding Runtime Configurations................................................................................................................................... 91
7.3.4 Subscribing to Skill Messages....................................................................................................................................... 92
7.3.5 Configuring Hard Example Settings............................................................................................................................ 95
7.3.6 Starting or Stopping Skills.............................................................................................................................................. 97
7.3.7 Uninstalling Skills.............................................................................................................................................................. 97
7.4 Viewing Device Information.............................................................................................................................................. 98
7.5 Viewing Device Logs............................................................................................................................................................ 98
7.6 Upgrading HiLens_Device_Agent Firmware.............................................................................................................. 100
7.7 Configuring Cameras......................................................................................................................................................... 101
7.8 Deregistering Devices........................................................................................................................................................ 103
7.9 Viewing Device Alarms..................................................................................................................................................... 104
7.10 Performing One-Click Health Check......................................................................................................................... 106

8 Developing Skills on the Console.................................................................................... 108


8.1 Skill Overview...................................................................................................................................................................... 108
8.2 Creating Skills...................................................................................................................................................................... 110
8.2.1 Creating a Skill Using a Skill Template....................................................................................................................110
8.2.2 Creating a Skill Using an Empty Template.............................................................................................................114
8.3 Obtaining Skill Templates................................................................................................................................................124
8.4 Managing Algorithm Models......................................................................................................................................... 125
8.4.1 Developing Models......................................................................................................................................................... 125
8.4.2 Importing (Converting) Models................................................................................................................................. 126
8.4.3 Model Input Directory Specifications....................................................................................................................... 131
8.4.4 Model Output Directory Specifications................................................................................................................... 132
8.5 Writing the Code................................................................................................................................................................ 132
8.6 Editing Skills......................................................................................................................................................................... 133
8.7 Installing and Debugging Skills..................................................................................................................................... 134

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. iii


Huawei HiLens
User Guide Contents

8.8 Releasing Skills.................................................................................................................................................................... 135


8.9 Deleting Skills...................................................................................................................................................................... 136

9 Development Environment HiLens Studio.................................................................... 137


9.1 Procedure for Using HiLens Studio...............................................................................................................................137
9.2 Applying for HiLens Studio OBT.................................................................................................................................... 140
9.3 Subscribing to or Unsubscribing from a Version..................................................................................................... 142
9.4 Creating a Skill Project..................................................................................................................................................... 144
9.5 Managing Models.............................................................................................................................................................. 149
9.5.1 Developing Models......................................................................................................................................................... 149
9.5.2 Importing/Converting a Locally Developed Model............................................................................................. 150
9.5.3 Importing/Converting Models Developed on ModelArts.................................................................................. 155
9.6 Compiling/Debugging Code Using Real-Time Video Streams on a Mobile Phone......................................158
9.7 Adapting to HiLens Studio of the Latest Version.................................................................................................... 166
9.7.1 Adapting Models to HiLens Studio........................................................................................................................... 166
9.7.2 Model Configuration Files............................................................................................................................................ 170
9.8 Remotely Connecting to HiLens Kit Devices............................................................................................................. 171
9.9 Installing Third-Party Libraries....................................................................................................................................... 172
9.10 Installing a Skill................................................................................................................................................................ 173
9.11 Starting or Stopping a Skill.......................................................................................................................................... 174
9.12 Releasing a Skill................................................................................................................................................................ 176
9.13 Uninstalling a Skill........................................................................................................................................................... 177
9.14 Stopping a Skill Instance............................................................................................................................................... 178
9.15 Managing Skill Projects..................................................................................................................................................178

10 Developing Skills Using Trainable Skill Templates................................................... 180


10.1 Skill Overview.................................................................................................................................................................... 180
10.2 Creating a Skill Using a Trainable Skill Template................................................................................................. 182
10.3 Safety Helmet Detection Skill...................................................................................................................................... 183
10.3.1 Skill Development Process......................................................................................................................................... 184
10.3.2 Preparing Data.............................................................................................................................................................. 185
10.3.3 Selecting Data................................................................................................................................................................189
10.3.4 Training a Model........................................................................................................................................................... 191
10.3.5 Evaluating a Model...................................................................................................................................................... 192
10.3.6 Deploying an Application.......................................................................................................................................... 193
10.4 Viewing Skill Details........................................................................................................................................................ 194
10.5 Deleting a Skill.................................................................................................................................................................. 195

11 Using the Skill Market..................................................................................................... 196


11.1 Skill Market Overview.................................................................................................................................................... 196
11.2 Searching for Skills in the Skill Market.....................................................................................................................198
11.3 Preset Commercial Skills................................................................................................................................................199
11.3.1 The List of Preset Commercial Skills...................................................................................................................... 199
11.3.2 Face Detection Skill......................................................................................................................................................199

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. iv


Huawei HiLens
User Guide Contents

11.3.3 Multi-Region Customer Foot Traffic Analysis Skill........................................................................................... 208


11.3.4 License Plate Recognition Skill.................................................................................................................................216
11.3.5 Safety Helmet Detection Skill.................................................................................................................................. 219
11.3.6 Face Capturing and Customer Foot Traffic Detection Skill............................................................................227
11.3.7 Vehicle Type and Logo Recognition Skill.............................................................................................................. 236
11.4 Customizing Skills............................................................................................................................................................ 242
11.5 Purchasing Skills............................................................................................................................................................... 245

12 Managing Data..................................................................................................................248
13 Managing Products...........................................................................................................251
13.1 Overview............................................................................................................................................................................. 251
13.2 Managing Products......................................................................................................................................................... 251
13.3 Purchasing Skills (for Devices Running Hi35xx Series Chips)........................................................................... 253
13.4 Distributing Skills............................................................................................................................................................. 253
13.5 Adding or Deleting Skills............................................................................................................................................... 254

A Caffe Operator Boundaries...............................................................................................256


B TensorFlow Operator Boundaries................................................................................... 289
C Change History.................................................................................................................... 343

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. v


Huawei HiLens
User Guide 1 Who Uses Huawei HiLens

1 Who Uses Huawei HiLens

Huawei HiLens is a multimodal AI application development platform featuring a


device-cloud synergy. It is intended for use by common users, AI application
developers, and software and hardware vendors. It consists of AI inference
cameras and a cloud development platform, placing skill development, device
deployment and management, and skill market all on one portal, so that users
can easily develop AI skills and install them on devices.
Different users may use Huawei HiLens for different purposes. Table 1-1 describes
the different types of Huawei HiLens users and the use scenarios. For more
information, see Procedures for Using Huawei HiLens.

Table 1-1 Introduction to Huawei HiLens users


Role Typical User Scenario Procedure for
Using Huawei
HiLens

Common ● Family ● Home: Improve home For details, see


users members security. Common Users
● Shopping mall ● Shopping malls and Use Skills.
and supermarkets: Collect
supermarket statistics on customer
owners foot traffic.
● Parking lot ● Campus: Recognize
attendants vehicle attributes and
● People in license plates.
charge of ● Construction site: Check
construction whether workers are
sites wearing safety helmets
on construction sites.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 1


Huawei HiLens
User Guide 1 Who Uses Huawei HiLens

Role Typical User Scenario Procedure for


Using Huawei
HiLens

Developer ● Technical Develop skills with AI Useful links:


s personnel capabilities and release Developers
engaged in AI them to the skill market to Develop Skills on
development build a robust AI developer the Management
● University ecosystem. Console
students ● Developing new skills Development
on the Console Environment
● Developing skills using HiLens Studio
HiLens Studio Developing Skills
● Developing skills using Using Trainable
trainable skill templates Skill Templates
with ModelArts Pro

Manufact Manufacturers of ● Camera manufacturers: For details, see


urers cameras running Power AI capabilities for Manufacturers
HiSilicon Hi35xx entry-level and mid- Manage
series chips range cameras. Products.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 2


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

2 Procedures for Using Huawei HiLens

Huawei HiLens provides device management, skill development, data


management, skill market, and product management functions for three types of
users, helping them develop AI skills for computing devices.

NOTE

For details about how to use HiLens Kit devices, see the HiLens Kit User Guide.

The functions users need vary depending on application scenarios. This section
describes the procedures for using Huawei HiLens based on the three types of
users and their application scenarios. You can quickly understand functions
provided by Huawei HiLens by reading Huawei HiLens Function Overview and
click the links in this table to go to the corresponding sections to learn details.
The procedures for using Huawei HiLens are as follows. Only the main procedures
are listed here. For details about other management operations, see Huawei
HiLens Function Overview.
● Common Users Use Skills
● Developers Develop Skills on the Management Console
● Process for Creating Skills Using Trainable Skill Templates
● Using HiLens Studio to Develop Skills
● Manufacturers Manage Products

Prerequisites
● Before using Huawei HiLens, you need to apply for a HUAWEI CLOUD account
and complete real-name authentication. Through this account, you can use all
HUAWEI CLOUD services and pay only for the services you use. For details,
see Account Registration Process and Real-Name Authentication.
● Huawei HiLens depends on other services. Therefore, you need to obtain the
permissions of related services before using Huawei HiLens, including
ModelArts, Object Storage Service (OBS), and Software Repository for
Container (SWR). For details about the relationships between Huawei HiLens
and other services, see Related Services.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 3


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Common Users Use Skills


Common users refer to users who purchase HiLens Kit devices for intelligent
surveillance in scenarios such as smart home, shopping malls, campuses, and
construction sites.

Figure 2-1 Procedure for common users

Table 2-1 Procedures for common users


Procedure Description Detailed Instructions

Purchasing Purchase HiLens Kit devices that Purchasing HiLens Kit


HiLens Kit will run Huawei HiLens skills. Devices
Devices

Registering Connect to the HiLens Kit Registering a HiLens Kit


HiLens Kit devices you purchase and Device
Devices register them with the Huawei Registering a Device Using
HiLens platform to interconnect the Intelligent Edge System
the devices with the cloud.
Registering a Device Using
SSH

Purchasing (Optional) Customizing Skills: Customizing Skills


Skills If the existing skills in the skill
market cannot meet your
requirements, you can submit
skill customization
requirements. For HiLens Kit
devices, you need to customize
skills oriented to Ascend chips.

Purchasing Skills: Purchase Purchasing Skills


existing skills or custom skills
you need from the skill market
and install them onto your
devices to deploy AI capabilities.
In the skill market, select the
skills designed to run on Ascend
chips.

Installing Install the purchased skills on Installing a Skill


Skills your devices.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 4


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Procedure Description Detailed Instructions

Viewing Skill View the device data and see if Managing Data
Performance the skills have achieved the
expected results.

Developers Develop Skills on the Management Console


Huawei HiLens provides a skill development platform, on which you can develop
skills intended to run on Ascend 310 or HiSilicon Hi35xx series chips based on site
requirements. Skills tailored-made for Ascend 310 chips can be directly installed
on HiLens Kit devices.
Devices running HiSilicon Hi35xx series chips typically have a small on-chip
memory and small capacities in other dimensions as well. It is challenging to
develop skills that run well on such devices. You need to optimize the skill models.
If you encounter any difficulty, contact Huawei HiLens platform personnel for
support.
● In the process of developing a skill, you need to deploy the skill onto a test
device to see how the skill performs. Therefore, developers are advised to
purchase at least one HiLens Kit device.
● Developers need to train AI models locally or in ModelArts to develop skills.
For details about how to train models in ModelArts, see Model Training
Overview.
Figure 2-2 shows the skill development procedure, and Table 2-2 describes the
procedure in detail.

Figure 2-2 Procedure for skill development by developers

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 5


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Table 2-2 Procedure for skill development by developers


Procedure Description Detailed
Instructions

Preparations The Huawei HiLens console supports Purchasing HiLens


device management and skill Kit Devices
management. Before using Huawei Subscribing to
HiLens, you need to select appropriate HiLens Device-Edge-
devices according to your own Cloud Synergy
requirements. If you choose HiLens Kit Platform Service
devices, make the following
preparations: Activating Devices
(Purchasing HiLens
● Purchase HiLens Kit devices. Device-Edge-Cloud
You must purchase the needed Synergy Platform
HiLens Kit devices to run the skills Service)
you develop.
● Purchase the HiLens Device-Edge-
Cloud Synergy Platform Service and
activate your devices.
If you register more than one device,
you need to purchase the HiLens
Device-Edge-Cloud Synergy Platform
Service. After you activate the
devices on the Device Management
page, you can install skills you
developed onto these devices.

Registering Register the devices to the Huawei Registering HiLens


Devices HiLens platform and connect the Kit Devices
devices to the cloud. Huawei HiLens
supports HiLens Kit devices, AI edge
stations, Atlas 800, and IVS 1800. More
devices are being tested for
compatibility.

Developing Creating a Skill Using a Skill Obtaining Skill


Skills Template: Obtain a skill template Templates
(containing the algorithm model and Creating a Skill
logic code) provided by Huawei HiLens Using a Skill
to quickly create a skill. Template

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 6


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Procedure Description Detailed


Instructions

Creating a Skill Using an Empty Developing Models


Template: To meet more service Importing
requirements, you can develop an (Converting)
algorithm model, import the developed Models
model to Huawei HiLens, compile the
logic code, and create a skill based on Writing the Code
the customized algorithm model and Creating a Skill
logic code. Using an Empty
If your algorithm model does not meet Template
the format requirements of Huawei
HiLens, you can use the model
conversion function.

Deploying Deploy skills on devices to facilitate Installing and


Skills debugging. Debugging Skills

Viewing Skill View the device data and how the skill Managing Data
Performance has been performing.

Releasing Release the skills to the skill market for Releasing Skills
Skills to the other users to purchase and use.
Skill Market

Process for Creating Skills Using Trainable Skill Templates


The ModelArts Pro console provides a trainable skill workflow. You can upload
data to the workflow on the ModelArts Pro console for model training. In this way,
you can quickly improve the model precision, create skills, and deploy the skills to
devices with one click without coding.

NOTE

● Using trainable skill templates to create skills means to improve the model precision
through training. The logic code of the skills cannot be modified. If you want to modify
the logic code of a skill, you can develop the skill on the Huawei HiLens console. For
details, see Developing Skills on the Console.
● Developing trainable skills occupies OBS resources and incurs charges. For details about
the OBS pricing, see Product Pricing Details.
● Developing skills using trainable skill templates occupies ModelArts training resources
and incurs charges. For details about the ModelArts pricing, see Product Pricing
Details.

Figure 2-3 shows the process of creating skills based on trainable skill templates.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 7


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Figure 2-3 Creating skills based on trainable skill templates

Table 2-3 Procedure for creating skills using trainable skill templates
Step Description Quick Link

Connect the device to the Connect to the Registering a HiLens Kit


cloud. HiLens Kit devices Device
you purchase and Registering a Device
register them with Using the Intelligent
the Huawei HiLens Edge System
platform to
interconnect the Registering a Device
devices with the Using SSH
cloud.

Create a skill using a Create a skill based Creating a Skill Using a


trainable skill template. on a preset trainable Trainable Skill Template
skill template.

Develop a safety helmet Develop the safety Safety Helmet Detection


detection skill. helmet detection skill Skill
based on the
workflow, generate
the safety helmet
detection model
through training
based on the
uploaded training
data, update and
adjust the model
precision to
implement the high-
precision safety
helmet detection
function, and install
the skill to the HiLens
Kit device with just
one click.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 8


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Step Description Quick Link

Start a skill. After a skill is Starting or Stopping


installed on a device, Skills
you can directly start
the skill in HiLens
Studio and view the
skill running effect.

Using HiLens Studio to Develop Skills


This section describes how to develop skills in HiLens Studio.
Figure 2-4 shows the procedure for using HiLens Studio to develop skills and
Table 2-4 details the procedure.

NOTE

This section describes only the operations involved in developing skills in HiLens Studio. For
details about how to create a skill on the console, see Developing Skills on the Console.

Figure 2-4 Procedure for using HiLens Studio to develop skills

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 9


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Table 2-4 Procedure description


Procedure Description Detailed Instructions

Make ● Purchase HiLens Kit devices. Purchasing HiLens Kit


preparations. You must purchase the needed Devices
HiLens Kit devices to run the Subscribing to HiLens
skills you develop. Device-Edge-Cloud
● Purchase the HiLens Device- Synergy Platform
Edge-Cloud Synergy Platform Service
Service and activate your Activating Devices
devices. (Purchasing HiLens
If you register more than one Device-Edge-Cloud
device, you need to purchase Synergy Platform
the HiLens Device-Edge-Cloud Service)
Synergy Platform Service. After
you activate the devices on the
Device Management page,
you can install skills you
developed onto these devices.

Connect devices Connect to the HiLens Kit devices Registering a HiLens Kit
to the cloud. you purchase and register them Device
with the Huawei HiLens platform Registering a Device
to interconnect the devices with Using the Intelligent
the cloud. Edge System
Registering a Device
Using SSH

Develop skills. In HiLens Studio, you can create a Creating a Skill Project
skill project, compile and debug Managing Models
the skill code, and run the skill
(only for HDMI output) and view Compiling/Debugging
the output data. Code Using Real-Time
Video Streams on a
Mobile Phone

Install skills. After editing the skill code in Installing a Skill


HiLens Studio, you can directly
install the skill on your device.

Start skills. After a skill is installed on a Starting or Stopping a


device, you can directly start the Skill
skill in HiLens Studio and view the
skill running effect.

Release skills. You can release a debugged skill Releasing a Skill


from HiLens Studio to the Huawei
HiLens skill market for other users
to use.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 10


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Manufacturers Manage Products


Huawei HiLens provides a product management process for manufacturers who
produce cameras that run HiSilicon Hi35xx series chips. With Huawei HiLens, the
manufacturers can manage devices, purchase skills, and distribute licenses to
devices so that all of the devices can obtain AI capabilities.

Figure 2-5 shows the product management procedure, and Table 2-5 describes
the procedure in detail.

Figure 2-5 Procedure for product management by manufacturers

Table 2-5 Procedure for product management by manufacturers

Procedure Description Detailed Instructions

Creating Create a product and associates the Managing Products


Products devices with the product.

Purchasing Customizing Skills: If the existing Customizing Skills


Skills skills in the skill market cannot meet
your requirements, you can submit
skill customization requirements,
during which you need to specify that
the custom skills are used for
HiSilicon Hi35xx series chips.

Purchasing Skills: Purchase existing Purchasing Skills


skills or custom skills (used for
HiSilicon Hi35xx series chips) you
require from the skill market and
distribute them to user devices.

Distributing Distribute the purchased skills to Distributing Skills


Skills devices, download corresponding
SDKs, and integrate the SDKs to the
devices for users to use.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 11


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Huawei HiLens Function Overview

Table 2-6 Function overview


Chapter User Role Description

Registering an All No matter what type of user you are, you


Account and need to register a HUAWEI CLOUD account
Getting and complete real-name authentication.
Authenticated Through this account, you gain access to all
HUAWEI CLOUD services but pay only for
the services you use. Before using Huawei
HiLens, you also need to obtain the
authorization of related services.

Registering ● Common Before using or developing skills, you need


HiLens Kit users to purchase HiLens Kit devices and connect
Devices ● Developer them to the Huawei HiLens console on the
s cloud by referring to the operation
procedure.

Managing ● Common You can manage registered HiLens Kit


Devices users devices on the Huawei HiLens console,
● Developer including skill management, firmware
s upgrade, and camera configuration.

Developing Skills Developers You can create skills on the Huawei HiLens
platform by developing and combining
algorithms, models, and logic code, or by
using preset skill templates. In addition, you
can debug a newly developed skill on a test
device.
Then, you can release the skills that have
been debugged to the skill market for more
users to use. In return, you will get the
appropriate amount of reward.

Skill Market All The skill market is an open platform that


provides skills tailor-made for different chips
and application scenarios. You can purchase
and customize skills in the skill market. If
you are a developer, you can release your
skills to the skill market and get paid.

Managing Data ● Common You can view the video data of devices
users registered with Huawei HiLens to see how
● Developer skills perform.
s

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 12


Huawei HiLens
User Guide 2 Procedures for Using Huawei HiLens

Chapter User Role Description

Managing Manufacture Manufacturers of devices that run HiSilicon


Products rs Hi35xx series chips can use the Huawei
HiLens platform to manage products,
purchase the needed skills, distribute the
skills to devices, download corresponding
SDKs, and integrate the SDKs to the devices
to enable them with AI capabilities.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 13


Huawei HiLens
User Guide 3 Permissions Management

3 Permissions Management

3.1 Creating a User and Granting Permissions


This chapter describes how to use Identity and Access Management (IAM) to
implement fine-grained permissions management for your Huawei HiLens. With
IAM, you can:
● Create IAM users for employees based on the organizational structure of your
enterprise. Each IAM user has their own security credentials, providing access
to Huawei HiLens resources.
● Grant only the permissions required for users to perform a specific task.
● Entrust a HUAWEI CLOUD account or cloud service to perform professional
and efficient O&M on your Huawei HiLens resources.
If your HUAWEI CLOUD account does not need individual IAM users, you may skip
this chapter.
This section describes the procedure for granting permissions. See Figure 3-1.

Prerequisites
Before granting permissions to a user group, you need to learn about the Huawei
HiLens permissions that can be added to the user group and select the
permissions based on site requirements. For details, see Permissions
Management. For the system policies of other services, see System Permissions.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 14


Huawei HiLens
User Guide 3 Permissions Management

Procedure

Figure 3-1 Procedure for granting Huawei HiLens permissions

1. Create a user group and grant permissions to it.


Create a user group on the IAM console, and assign the HiLens
CommonOperations policy to the group. To apply for the OBT, and set alarm
receiving and skill messages, you must be granted the SMN Administrator
role.
2. Create a user and add it to the user group.
Create a user on the IAM console and add the user to the group created in 1.
3. Log in and verify permissions.
Log in to the Huawei HiLens console as the created user, switch to the
authorized region, and verify the permissions.
Choose Service List > Huawei HiLens to enter the Huawei HiLens home
page. Then, choose Device Management > Devices, locate the target device
card, and choose Operation > Deregister (if the device needs to be activated
after being registered, refund its management fee before deregistering it). If
you cannot deregister the device (assume that the current permission
contains only HiLens CommonOperations), HiLens CommonOperations has
already taken effect.

3.2 Creating a Huawei HiLens Custom Policy


Custom policies can be created as a supplement to the system policies of Huawei
HiLens. For the actions supported for custom policies, see Introduction.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 15


Huawei HiLens
User Guide 3 Permissions Management

You can create custom policies in either of the following ways:


● Visual editor: Select cloud services, actions, resources, and request conditions
without the need to know policy syntax.
● JSON: Edit JSON policies from scratch or based on an existing policy.
For details, see Creating a Custom Policy. This section describes common Huawei
HiLens custom policies.

A Sample Custom Policy of Huawei HiLens


● Example: Denying deletion of developed skills
A deny policy must be used in conjunction with other policies to take effect. If
the permissions assigned to a user contain both Allow and Deny actions, the
Deny actions take precedence over the Allow actions.
The following method can be used if you need to assign permissions of the
Huawei HiLens FullAccess policy to a user but also forbid the user from
deleting developed skills. You can create a custom policy for denying deletion
of developed skills and assign both policies to the group the user belongs to.
Then the user can perform all operations on Huawei HiLens except deleting
developed skills. The following is an example deny policy:
{
"Version": "1.1",
"Statement": [
{
"Effect": "Deny",
"Action": [
"hilens:project:deleteProject"
]
}
]
}

3.3 Permissions Policies and Supported Actions

3.3.1 Introduction
You can use IAM to implement fine-grained permissions management for your
Huawei HiLens resources. If your HUAWEI CLOUD account does not need
individual IAM users, then you may skip this section.
By default, new IAM users do not have permissions assigned. You need to add the
users to one or more groups, and attach permissions policies or roles to these
groups. Users inherit permissions from the groups to which they are added and
can perform specified operations on cloud services based on the permissions.
You can grant users permissions by using roles and policies. Roles: A type of
coarse-grained authorization mechanism provided by IAM that defines permissions
related to user responsibilities. Policies: Policies define API-based permissions for
operations on specific resources under certain conditions, allowing for more fine-
grained, secure access control of cloud resources.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 16


Huawei HiLens
User Guide 3 Permissions Management

NOTE

If you want to allow or deny the access to an API, fine-grained authorization is a good
choice.

An account has all the permissions required to call all APIs, but IAM users must be
assigned the required permissions. The permissions required for calling an API are
determined by the actions supported by the API. Only users who have been
granted permissions allowing the actions can call the API successfully. For
example, if an IAM user queries ECSs using an API, the user must have been
granted permissions that allow the hilens:servers:list action.

Supported Actions
Huawei HiLens provides system-defined policies that can be directly used in IAM.
You can also create custom policies and use them to supplement system-defined
policies, implementing more refined access control. Operations supported by
policies are specific to APIs. The following are common concepts related to
policies:
● Permission: a statement in a policy that allows or denies certain operations.
● Action: added to a custom policy to control permissions for specific
operations.
● Authorization scope: A custom policy can be applied to IAM projects or
enterprise projects or both. Policies that contain actions supporting both IAM
and enterprise projects can be assigned to user groups and take effect in both
IAM and Enterprise Management. Policies that only contain actions for IAM
projects can be used and only take effect for IAM. For details, see Differences
Between IAM and Enterprise Management.
● API: RESTful APIs that can be called in a custom policy.
Huawei HiLens supports the following actions that can be defined in custom
policies:
● Device Management Permissions
● Skill Development Permissions
● Skill Market Permissions
● Product Management Permissions

3.3.2 Device Management Permissions


Table 3-1 Device management

Permission Method Action Minimum


Dependent
Action

Deregister a PUT hilens:device:delet -


device. eDevice

Upgrade device PUT hilens:device:upgr -


firmware. adeDeviceFirmwa
re

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 17


Huawei HiLens
User Guide 3 Permissions Management

Permission Method Action Minimum


Dependent
Action

Register a device. POST hilens:device:regis -


terDevice

Update the device PUT hilens:device:upda -


information. teDevice

Update the device PUT hilens:device:upda -


configuration teDeviceConfig
information.

Obtain the device GET hilens:device:getD -


configuration eviceConfig
information.

Obtain the list of GET hilens:device:getD -


devices. eviceList

Obtain the list of GET hilens:device:getD -


skills installed on eviceSkillList
a device.

Uninstall a DELETE hilens:skill:uninsta -


specified skill on a llSkill
specified device.

Update the PUT hilens:skill:update -


configuration SkillConfig
information of a
specified skill on a
specified device.

Start a specified POST hilens:skill:startSki -


skill on a specified ll
device.

Stop a specified POST hilens:skill:stopSki -


skill on a specified ll
device.

Obtain the GET hilens:skill:getConf -


configuration ig
information of a
specified skill on a
specified device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 18


Huawei HiLens
User Guide 3 Permissions Management

3.3.3 Skill Development Permissions


Table 3-2 Skill development permissions
Permission Method Action Minimum
Dependent
Action

Create a model PUT hilens:model:conv -


conversion job. ertModel

Release a PUT hilens:project:publ obs:object:GetObj


developed skill to ishProject ect
the skill market. obs:object:PutObj
ect
obs:object:PutObj
ectAcl

Download a skill PUT hilens:template:do obs:object:GetObj


template. wnLoadTemplate ect

Delete a skill DELETE hilens:model:delet -


model. eModel

Create a skill. POST hilens:project:crea obs:object:GetObj


teProject ect
obs:bucket:HeadB
ucket
obs:bucket:Create
Bucket
obs:object:PutObj
ect
obs:bucket:ListAll
MyBuckets
obs:bucket:ListBuc
ket

Edit a developed PUT hilens:project:upd obs:object:GetObj


skill. ateProject ect
obs:bucket:HeadB
ucket
obs:bucket:Create
Bucket
obs:object:PutObj
ect
obs:bucket:ListAll
MyBuckets
obs:bucket:ListBuc
ket

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 19


Huawei HiLens
User Guide 3 Permissions Management

Permission Method Action Minimum


Dependent
Action

Import a skill POST hilens:model:impo obs:object:GetObj


model to Huawei rtModel ect
HiLens. obs:bucket:HeadB
ucket
obs:bucket:ListAll
MyBuckets
obs:bucket:ListBuc
ket

Delete a DELETE hilens:project:dele -


developed skill. teProject

Add a skill POST hilens:template:co -


template to llectTemplate
favorites.

Deploy a PUT hilens:project:depl obs:object:GetObj


developed skill to oyProject ect
a device.

Remove a skill DELETE hilens:template:de -


template from leteCollectedTem-
favorites. plate

Obtain the list GET hilens:model:getC -


and details of onvertJob
model conversion
jobs.

Obtain the details GET hilens:template:ge -


about a skill tTemplate
template.

Obtain the details GET hilens:model:getM -


about a skill odel
model.

Obtain the details GET hilens:project:getP -


about a roject
developed skill.

Obtain the list of GET hilens:model:getC -


model conversion onvertJobList
jobs.

Obtain the list of GET hilens:project:getP -


developed skills. rojectList

Obtain the list of GET hilens:model:getM -


skill models. odelList

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 20


Huawei HiLens
User Guide 3 Permissions Management

Permission Method Action Minimum


Dependent
Action

Obtain the list of GET hilens:template:ge -


skill templates. tTemplateList

3.3.4 Skill Market Permissions


Table 3-3 Skill market management

Permission Method Action Minimum


Dependent
Action

Customize a skill. POST hilens:market:crea -


teCommissionSkill

Download a skill GET hilens:market:dow obs:object:GetObj


from the skill nloadSkill ect
market.

Create a skill POST hilens:market:crea -


order in the skill teSkillOrder
market.

Install a skill POST hilens:market:inst -


purchased from allSkill
the skill market.

Delete a custom DELETE hilens:market:dele -


skill. teCommissionSkill

Remove a PUT hilens:market:with -


released skill from drawSkill
the catalog of the
skill market.

Obtain the GET hilens:market:get -


information about CommissionSkill
a custom skill.

Obtain the skill GET hilens:market:getS -


billing killBillingInfo
information.

Obtain the skill GET hilens:market:getS -


details of the skill killInfo
market.

Obtain the skill GET hilens:market:getS -


order list of the killOrderList
skill market.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 21


Huawei HiLens
User Guide 3 Permissions Management

Permission Method Action Minimum


Dependent
Action

Obtain the list of GET hilens:market:get -


custom skills. CommissionSkill-
List

Obtain the skill GET hilens:market:getS -


list of the skill killList
market.

3.3.5 Product Management Permissions


Table 3-4 Product management
Permission Method Action Minimum
Dependent
Action

Distribute skill POST hilens:product:creat -


orders to eProductLicense
products.

Update the skill PUT hilens:product:upda -


order information teProductLicense
of a product.

Delete a product. DELETE hilens:product:delet -


eProduct

Delete the skill DELETE hilens:product:delet -


order information eProductLicense
of a product.

Create a product. POST hilens:product:creat -


eProduct

Update the PUT hilens:product:upda -


product teProduct
information.

Obtain the list of GET hilens:product:getP -


products. roductList

Obtain the skill GET hilens:product:getP -


order list of a roductLicenseList
product.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 22


Huawei HiLens
User Guide 4 Creating a Workspace

4 Creating a Workspace

Workspace is a way of isolating resources, such as models and skills, between


different users.

Resource Isolation
Each HUAWEI CLOUD account or IAM account has a default workspace, which
can be used to view all resources created by the current account on Huawei
HiLens.
The table below lists resources that are isolated between different workspaces.

Table 4-1 Isolated resources


Navigation Tree Isolated Resource

Device Management > Devices Registered HiLens Kit devices and


device resources, including skills,
cameras, alarms, and firmware
versions

Skill Development > Models Models imported (converted) to


Huawei HiLens

Skill Development > HiLens Studio Skill projects created on HiLens Studio,
skills developed on HiLens Studio, and
devices on which the skills are installed

Skill Development > Skills Skill resource created on the console

Data Management (Beta) Logs generated when devices in


different workspaces run skills

The table below lists resources that are shared by all workspaces.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 23


Huawei HiLens
User Guide 4 Creating a Workspace

Table 4-2 Shared resources

Navigation Tree Shared Resource

Skill Market Skills that can be shared in the skill


market and skills purchased by the
current account

Device Management > Products Newly created cameras with HiSilicon


Hi35xx series chips on Huawei HiLens

Skill Development > Skill Templates Templates built in Huawei HiLens and
templates added to My Favorites by
the current account

Creating a Workspace
1. Log in to the Huawei HiLens console. In the navigation pane, choose
Workspaces.
The Workspaces page is displayed.
2. Click Create Workspace in the upper right corner.
The Create Workspaces page is displayed.
3. Enter the workspace name and description, and click Create Now in the
lower right corner. The Workspaces page is displayed. You can view the newly
created workspace.
The workspace description cannot contain the following characters: #~^$
%&*<>{}[]\/|

Modifying a Workspace
Currently, you can change the name and description of a custom workspace, but
cannot change the name of the default workspace.

1. Log in to the Huawei HiLens console. In the navigation pane, choose


Workspaces.
The Workspaces page is displayed.
2. Select the workspace to be modified and click Modify in the Operation
column.
3. In the dialog box, modify the workspace name and description, and click OK.

Deleting a Workspace
You can delete a workspace that is no longer used to release resources. The
default workspace cannot be deleted.

1. Log in to the Huawei HiLens console. In the navigation pane, choose


Workspaces.
The Workspaces page is displayed.
2. Select the workspace to be deleted and click Delete in the Operation column.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 24


Huawei HiLens
User Guide 4 Creating a Workspace

3. Confirm the information in the dialog box and click OK.

Follow-up Operations
After creating different workspaces, you can select a workspace from the drop-
down list under Current Workspace in the left navigation pane and use Huawei
HiLens. For details about how to use Huawei HiLens, see Procedures for Using
Huawei HiLens.

Figure 4-1 Current workspace

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 25


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

5 Subscribing to Huawei HiLens Products

5.1 Subscribing to HiLens Studio


Huawei HiLens is a multimodal AI development platform featuring a device-edge-
cloud synergy. When using Huawei HiLens, you may need to pay for the following:
purchasing HiLens Kit devices, using HiLens Studio to develop skills, purchasing
the HiLens device-edge-cloud synergy platform service, and purchasing skills from
the skill market. Subscription to these HiLens products and services is required.

For details about how these products and services are priced, see "Billing" in the
Service Overview.

HiLens Studio is a multi-language, integrated development environment for


developers. To use it, you need to subscribe to it on the Huawei HiLens console by
choosing the appropriate edition. This section describes how to choose the correct
edition of HiLens Studio and then subscribe to it.

Edition Description
The difference between the basic edition and professional edition of HiLens Studio
lies in whether dedicated inference resources are used exclusively. For details
about the basic edition, see Table 5-1. For details about the professional edition,
see Table 5-2.

Table 5-1 HiLens Studio Basic Edition

Resource Function Billing Mode Billing Description

Storage Creating skill Pay-per-use You will be billed for the


space projects and storage capacity that
uploading models exceeds 5 GB used by the
and data main account and sub-
accounts.
Storage space of less than
5 GB is free of charge.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 26


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Resource Function Billing Mode Billing Description

Physical Debugging and Free of charge -


resources running skills
(shared)

Table 5-2 HiLens Studio Professional Edition


Resource Function Billing Billing Description
Mode

Storage Creating skill Pay-per-use You will be billed for the


space projects and storage capacity that exceeds
uploading models 5 GB used by the main
and data account and sub-accounts.
Storage space of less than 5
GB is free of charge.

Physical Debugging and Pay-per-use You will be billed for the


resources running skills accumulated compute
(dedicated duration of the main account
) and sub-accounts.

Yearly/ You can purchase a resource


Monthly package. During the validity
(computing period of a resource package,
resource if you use more resources
package) than those included in the
package, you will be billed on
a pay-per-use basis for the
excess resources used.
After you purchase a yearly/
monthly computing and
inference resource package of
HiLens Studio Professional
Edition, HiLens Studio
Professional Edition will be
automatically enabled.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 27


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Resource Function Billing Billing Description


Mode

Yearly/ During the validity period of


Monthly your yearly/monthly
subscription, all your usage is
covered by this subscription
without generating extra fees.
After your subscription
expires, you will be
automatically switched to the
pay-per-use mode.
After you purchase a yearly/
monthly computing and
inference resource package of
HiLens Studio Professional
Edition, HiLens Studio
Professional Edition will be
automatically enabled.

Subscribing to HiLens Studio


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.
The My Skills page is displayed.
2. Click Subscription in the upper right corner.
The Buy Huawei HiLens Product page is displayed.
3. Fill in the information based on Table 5-3, read Notes and Notice, and click
Buy Now.

Table 5-3 Parameters for subscribing to HiLens Studio


Parameter Description

Region Select a region. Currently, HiLens Studio is available


in regions CN North-Beijing4 and CN North-
Beijing1.

ProductName Select HiLens Studio.

ProductType Select the HiLens Studio edition you want to


subscribe to. There are two HiLens Studio editions:
basic and professional. They have different billing
modes and options. For details, see Edition
Description.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 28


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Parameter Description

Billing Mode Select a billing mode for HiLens Studio. Pay-per-use,


Pay-per-use package, and Yearly/Monthly are
supported.
Enter the required information based on the billing
mode you choose.
● Pay-per-use: The price varies depending on the
HiLens Studio edition you choose. For details, see
Pay per Use.
● Pay-per-use package: Only the Professional
edition supports pay-per-use package option.
Enter the required information based on Table
5-4.
● Yearly/Monthly: Only the Professional edition
supports the yearly/monthly billing option. Enter
the required information based on Table 5-5.

Table 5-4 Parameters for the pay-per-use package billing mode


Parameter Description

Resource Type For the pay-per-use package billing mode, the


resource type is Computing and inference
resources.

Specifications Select the duration for using the computing and


inference resources.

Required Duration Select the validity period of the HiLens Studio


subscription. Currently, only a 1 Year subscription is
supported.

Table 5-5 Parameters for the yearly/monthly billing mode


Parameter Description

Resource Type For a yearly/monthly subscription, the resource type


is Computing and inference resources.

Online Accounts Maximum number of HUAWEI CLOUD accounts and


IAM accounts that can be online at the same time.
If you select Auto-renew, the subscription will be
automatically renewed upon expiration.

Required Duration Duration for using HiLens Studio Professional


Edition.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 29


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Parameter Description

Effective Time The yearly/monthly subscription of HiLens Studio


takes effect Immediately.

4. Confirm the order information and click Submit in the lower right corner.
5. On the displayed payment page, select a payment method, check the order
details, and click Pay. Enter your payment password to purchase HiLens
Studio.

Follow-up Operations
After purchasing HiLens Studio, you can develop skills in it. For details, see
Development Environment HiLens Studio.

5.2 Subscribing to HiLens Device-Edge-Cloud Synergy


Platform Service
Huawei HiLens is a multimodal AI development platform featuring a device-edge-
cloud synergy. When using Huawei HiLens, you may need to pay for the following:
purchasing HiLens Kit devices, using HiLens Studio to develop skills, purchasing
the HiLens device-edge-cloud synergy platform service, and purchasing skills from
the skill market. Subscription to these HiLens products and services is required.
Huawei HiLens provides the HiLens device-edge-cloud synergy platform service. If
you register more than one device, you need to purchase the HiLens device-edge-
cloud synergy platform service. After you activate the devices on the Device
Management page, you can install basic skills you developed onto these devices.

Application Scenario
● If you register more than one device, you need to purchase the HiLens device-
edge-cloud synergy platform service. After you activate the devices on the
Device Management page, you can install basic skills you developed in the
console, in HiLens Studio, or using trainable skill templates onto these devices.
● To install skills purchased from the skill marketplace, there is no need to
purchase the HiLens device-edge-cloud synergy platform service or activate
any permission.
● If you have only registered device, there is also no need to purchase the
HiLens device-edge-cloud synergy platform service or activate any permission.

Subscription
1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.
The My Skills page is displayed.
2. Click Subscription in the upper right corner.
The Buy Huawei HiLens Product page is displayed.
3. Fill in the information based on Table 5-6, read Notes and Notice, and click
Buy Now.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 30


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Table 5-6 Parameters for subscribing to the HiLens device-edge-cloud synergy


platform service
Parameter Description

Region Select a region. Currently, the HiLens device-edge-


cloud synergy platform service is available in regions
CN North-Beijing4 and CN North-Beijing1.

ProductName Select HiLens Device-Edge-Cloud Synergy


Platform Service.

Billing Mode Only the Yearly/Monthly billing mode is supported.

Type Type of devices where you plan to install basic skills,


including HiLens Kit/Atlas 500.

Quantity Number of devices for which the service needs to be


purchased.

Required Duration The duration for using the service can be 1 Year, 3
Years, or 5 Years. The counting starts when your
device is first activated.
For example, if you purchased the HiLens device-
edge-cloud synergy platform service for three years
on January 1, 2019, and activated a device on June
1, 2019 for the first time, then you can install self-
developed basic skills on this device from June 1,
2019 to June 1, 2022.

Effective Time The purchased service takes effect Immediately.


That is, the time when the device is activated for the
first time within the validity period of the service.

4. Confirm the order and click Submit in the lower right corner.
5. On the displayed payment page, select a payment method, check the order
details, and click Pay. Enter your payment password to purchase the service.

Renewing an Order
You can renew the HiLens device-edge-cloud synergy platform service upon
expiration. The device is automatically activated upon renewal.

NOTE

Canceled renewals are not eligible for a 5-day unconditional refund.

1. Log in to Huawei HiLens. In the navigation pane, choose Subscription >


Order Management.
The My Skills page is displayed.
2. Click the Platform Service tab page.
3. Locate the order you want to renew, and click Renew in the Operation
column.
The Renew page is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 31


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

4. On the Renew page, drag the slider to select the Renewal Duration, which
can be 1 year, 3 years, or 5 years.
If you want to set a unified renewal date (Actual renewal duration = Currently
selected duration + Duration from the current expiration data to the new
expiration data):

a. Click on the right. In the displayed Set Renewal Date dialog box,
select the renewal date from the Change To drop-down list, and click
Yes.
b. Select Renew on the standard renewal date, the X day of every
month.
5. Click Pay in the lower right corner. On the displayed payment page, select a
payment method, check the order details, and click Pay. Enter your payment
password to renew the order.
After the payment is made, a message is displayed indicating that the order is
paid successfully. Return to the Huawei HiLens console, choose Device
Management > Devices, and check whether the status of the activated
device is updated about 30 seconds later.

Follow-up Operations
After purchasing the HiLens device-edge-cloud synergy platform service, you must
activate your devices before you can install basic skills you developed onto these
devices. For details, see Activating Devices (Purchasing HiLens Device-Edge-
Cloud Synergy Platform Service).

5.3 Purchasing HiLens Kit Devices


HiLens Kit is a multimodal AI development suite that performs data analysis and
inference over diverse data like images, video, and audio, with support for a
device-cloud synergy. It can be used in intelligent surveillance, smart homes, AI
education, smart industries, smart stores, and more scenarios.

Huawei HiLens allows you to manage HiLens Kit devices, develop and install skills
on the cloud. You can purchase HiLens Kit devices one-off on the HUAWEI CLOUD
official website.

Procedure
1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.
The My Skills page is displayed.
2. Click Subscription in the upper right corner.
The Buy Huawei HiLens Product page is displayed.
3. Enter the required information based on Table 5-7, and click Buy Now in the
lower right corner.
The page for purchasing HiLens Kit is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 32


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Table 5-7 Parameters for purchasing a HiLens Kit device

Parameter Description

Region Select a region. Currently, Huawei HiLens is available in


regions CN North-Beijing4 and CN North-Beijing1.

ProductName Select HiLens Kit.

Billing Mode HiLens Kit supports the One-off billing mode only.

4. Set the quantity and click Buy Now.


5. On the displayed page, enter the buyer's information and shipping address,
confirm the order information, and select I have read and agree to the
HUAWEI CLOUD Hardware Sales Agreement.
6. Click Pay and complete the payment.

Follow-up Operations
After purchasing a HiLens Kit device, register it with Huawei HiLens for device
management. For details, see Registering HiLens Kit Devices.

5.4 Purchasing Skills


After you register a device, you can purchase skills from the skill market of
Huawei HiLens and install them to your device to enable AI capabilities. For
example, if you install a facial recognition skill on your device, your device can
recognize faces.

1. Log in to the Huawei HiLens console. In the navigation pane, choose


Subscription > Order Management.
The My Skills page is displayed.
2. Click Subscription in the upper right corner.
The Buy Huawei HiLens Product page is displayed.
3. Enter the required information based on Table 5-8 and click Check Now in
the lower right corner.
Select and purchase the required skills in Skill Market. For details, see Using
the Skill Market.

Table 5-8 Parameters for purchasing a skill

Parameter Description

Region Select a region. Currently, Huawei HiLens is available in


regions CN North-Beijing4 and CN North-Beijing1.

ProductName Select Skill

Billing Mode Skills are billed on a Yearly /Monthly basis.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 33


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

5.5 Subscribing to Huawei RPA WeAutomate

5.5.1 Purchasing and Using Huawei RPA WeAutomate


Huawei RPA WeAutomate uses deep learning algorithms, including OCR and NLP,
to simulate and enhance human-machine interactions and create automated
workflows. As an enterprise-class intelligent automation platform, it provides you
with functions provided by RPA, AI technologies, and applets, and helps you
streamline the last mile for digital transformation. For details about Huawei RPA
WeAutomate, go to the Basic Information page for the tool.

Log in to the Huawei HiLens console. In the navigation pane, choose Subscription
> Tools/Plugins. Click the Huawei RPA WeAutomate card. The Basic
Information page of Huawei RPA WeAutomate is displayed by default. On this
page, you can view a detailed description of Huawei RPA WeAutomate.

Before using Huawei RPA WeAutomate, you need to purchase and activate it by
performing the following steps:

Step 1: Purchasing the Tool

Step 2: Obtaining the ESN

Step 3: Activating the Tool

Step 4: Importing the License File

Step 1: Purchasing the Tool


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Tools/Plugins.
2. Click the Huawei RPA WeAutomate card.
The Huawei RPA WeAutomate page is displayed.
3. Click Buy Now.
The Buy Huawei HiLens Product page is displayed.
4. Set the required parameters by referring to Table 5-9, and then click Buy
Now.

Table 5-9 Parameters for Huawei RPA WeAutomate purchase

Parameter Description

Region Select a region. Currently, Huawei RPA WeAutomate


is available only in CN North-Beijing4.

ProductName Select Tools.

Billing Mode Huawei RPA WeAutomate supports only the yearly/


monthly billing mode.

ProductType The product type is Huawei RPA WeAutomate.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 34


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Parameter Description

Version Type Currently, only the Server edition is supported.

WeAutomate This parameter is fixed to 1.


Management Center

WeAutomate Studio Select the number of WeAutomate Studios to be


purchased.

Attended Robot Select the number of attended robots.

Unattended Robot Select the number of unattended robots.

Required Duration The default value is 1 Year.

5. Confirm the order information and click Submit.


6. On the Pay page displayed, check the order details, select the payment
method, and click Pay. Enter your payment password to purchase Huawei RPA
WeAutomate.

Step 2: Obtaining the ESN


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Tools/Plugins.
2. Click the Huawei RPA WeAutomate card.
The Basic Information page of Huawei RPA WeAutomate is displayed by
default.
3. Click Try Online and configure your personal information. Then select a
Tenant Name and click Privacy Policy. After you read the Privacy Policy,
click Accept.

Figure 5-1 Try Online

4. Click Submit.
After you submit the application, an approval process will take place.
5. Choose Subscription > Tools/Plugins and click Huawei RPA WeAutomate
card. Then, click Try Online on the page displayed.
The WeAutomate management center is displayed.
6. Click Menu in the upper left corner of the page and choose RPA Orchestrator
> License.
The License page is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 35


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

7. Click Global License to go to the Global License tab page, and then copy the
ESN number.

Step 3: Activating the Tool


1. On the Huawei HiLens console, choose Subscription > Order Management,
and click Tools/Plugins.
2. Select the tool you purchased in Step 1: Purchasing the Tool and click
Activate in the Operation column.
The Activate dialog box is displayed.
3. Paste the ESN obtained in Step 2: Obtaining the ESN in the text box and
click OK.
4. Save the license file to the local PC and compress it into a .zip package.

Step 4: Importing the License File


1. Choose Subscription > Tools/Plugins and click Huawei RPA WeAutomate
card. Then, click Try Online on the page displayed.
The WeAutomate management center is displayed.

Figure 5-2 WeAutomate Management Center

2. Click Menu in the upper left corner of the page and choose RPA Orchestrator
> License.
The License page is displayed.
3. Click Global License to go to the Global License tab page, and click Upload.
The dialog box for uploading a file is displayed.
4. Select the .zip package that contains the license file obtained in Step 3:
Activating the Tool, and click Upload (or Open).
5. After the upload is complete, click Import.
Then, you can use Huawei RPA WeAutomate.

5.5.2 Trying the Standalone Edition of Huawei RPA


WeAutomate
Huawei RPA WeAutomate uses deep learning algorithms, including OCR and NLP,
to simulate and enhance human-machine interactions and create automated
workflows. As an enterprise-class intelligent automation platform, it provides you
with functions provided by RPA, AI technologies, and applets and helps you
streamline the last mile for digital transformation. For details about Huawei RPA
WeAutomate, go to the Basic Information page for the tool.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 36


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Log in to the Huawei HiLens console and choose Subscription > Tools/Plugins.
Click the Huawei RPA WeAutomate card. The Basic Information page of Huawei
RPA WeAutomate is displayed by default. On this page, you can view a detailed
description of Huawei RPA WeAutomate.

Before purchasing Huawei RPA WeAutomate, you can try the standalone edition.

● Step 1: Obtaining the ESN


● Step 2: Activating the Tool
● Step 3: Importing the License File

Step 1: Obtaining the ESN


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Tools/Plugins.
2. Click the Huawei RPA WeAutomate card.
The Basic Information page of Huawei RPA WeAutomate is displayed by
default.
3. Click Download to switch to the Download tab page.
4. Select WeAutomate Studio or WeAutomate Assistant based on your needs
and click Download in the Operation column.

Figure 5-3 Downloading the tool

– WeAutomate Studio
i. Download WeAutomate Studio to your local PC. The default name is
HUAWEI_AntRobot_Studio_2.13.0-SPC2.exe.
ii. Double-click the .exe file you downloaded and install it as prompted.
iii. Run the application after the installation is complete. Click on the
left and click License.
iv. Copy the ESN.
– WeAutomate Assistant
i. Download WeAutomate Assistant to your local PC. The default name
is HUAWEI_AntRobot_Assistant_2.13.0.zip.
ii. Decompress the .zip file you downloaded. Open
HUAWEI_AntRobot_Assistant_2.13.0>ADC_1.5.RC30_Component_P
KG_IPA-Agent. Double-click install.bat, and install it as prompted.

iii. Run the application after the installation is complete. Click in the
upper right corner and select Settings.
The General tab page is displayed by default.
iv. Copy the Machine ESN.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 37


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Step 2: Activating the Tool


1. On the Huawei HiLens console, choose Subscription > Tools/Plugins, and
click Huawei RPA WeAutomate card.
The Huawei RPA WeAutomate page is displayed.
2. Click Activate Trial.
The TryActivated dialog box is displayed.
3. Paste the ESN obtained in Step 1: Obtaining the ESN in the text box and
click OK.
4. Save the license file to your local computer.
NOTE

The license file can be downloaded again on the Huawei HiLens console.
1. Choose Subscription > Tools/Plugins, click Huawei RPA WeAutomate card, and
click Activate Trial.
2. In the dialog box, click License download, select the license file to be downloaded,
and click Download.

Step 3: Importing the License File


● WeAutomate Studio
a. Run the RPA tool. Click on the left of the navigation pane, and select
License.
b. On the Apply License page, click Import to import the license file
obtained in Step 2: Activating the Tool.
When Import success is displayed in the upper right corner of the page,
the tool is successfully activated.
● WeAutomate Assistant

a. Run the RPA tool. Click in the upper right corner, and select Settings.
The General tab page is displayed by default.
b. Click Import on the right of License Status.
When a message is displayed indicating a successful import, the tool is
successfully activated.

Follow-up Operations
After the activation succeeds, you can try the standalone edition of Huawei RPA
WeAutomate.

5.6 Managing Orders


Products purchased from Huawei HiLens can be managed in a unified manner.
They include skills purchased from the skill market of Huawei HiLens, customized
skills, skills purchased from the AI Gallery, and the HiLens device-edge-cloud
synergy platform service.
● Skill Orders: managing skills purchased from the skill market of Huawei
HiLens.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 38


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

● AI Gallery: managing skills purchased from the AI Gallery.


● Custom Skills: managing skills customized in the skill market of Huawei
HiLens.
● Platform Service: managing the HiLens device-edge-cloud synergy platform
service.

Skill Orders
Log in to the Huawei HiLens console. In the navigation pane, choose Subscription
> Order Management. The Skill Orders tab page is displayed by default. The
Skill Orders tab page displays all the skills you purchased and the order details.
On the Skill Orders tab page, you can perform the following operations:
● Install a skill
Click Install in the Operation column to install the skill on a registered
device. For detailed operations, see Installing a Skill.
● Expand the capacity of an order
a. Click Expand Capacity in the Purchase Details column to increase the
number of copies.
b. On the Purchase Skill page, specify Quantity, select I agree to the
Privacy Statement and the Declaration, and click Buy Now in the lower
right corner.
c. On the Confirm page, confirm the order details and click Submit in the
lower right corner.
d. On the Pay page, select a payment method and click Pay in the lower
right corner.
Capacity expansion is supported only for orders that use the yearly/monthly
billing mode.
● Distribute a skill
Click Operation in the Operation column to expand the drop-down list, and
click Distribute to distribute the skill to products. For detailed operations, see
Distributing Skills.
● Download a skill
Click Operation in the Operation column to expand the drop-down list, and
click Download. The browser automatically downloads the SDK package of
the selected skill.

AI Gallery
In the navigation pane of the Huawei HiLens console, choose Subscription >
Order Management, and click the AI Gallery tab.
This page displays the HiLens skills you have subscribed to from the ModelArts AI
Gallery plus the subscription details.

Custom Skills
Log in to the Huawei HiLens console. In the navigation pane, choose Skill Market
> My Skills. Then click the Custom Skills tab.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 39


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

The Custom Skills page displays the skills that you have customized. For details
about operations related to skill customization, see Customizing Skills. On the
Custom Skills page, you can perform the following operations to manage
customization requirements:
● Buy
You can buy licenses for a customized skill.
● Delete
You can click Delete to delete unnecessary customization requirements.
NOTE

Skills in Customizing or Customized status cannot be deleted.

Platform Service
Log in to the Huawei HiLens console. In the navigation pane, choose Subscription
> Order Management. Then click the Platform Service tab.
The Platform Service page displays the HiLens device-edge-cloud synergy
platform service that you have subscribed to. For details about how to subscribe to
this service, see Subscribing to HiLens Device-Edge-Cloud Synergy Platform
Service. On the Platform Service page, you can perform the following operations
to manage the platform service:
● Transfer activation quota
You can transfer the device activation quota enabled by the HiLens device-
edge-cloud synergy platform service purchased using your current account to
another account in the same region. For details, see Transferring Activation
Quota. After the activation quota is transferred, you can activate devices
using the account to which the activation quota is transferred.
● Renew
If the platform service you purchased has expired, you can renew it to obtain
a new order number and activate devices again. For details, see Renewing an
Order.

Transferring Activation Quota


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.
The My Skills page is displayed.
2. Click Platform Service to switch to the Platform Service tab page.
3. Select the order to be transferred, click Operation in the Operation column
to expand the drop-down list, and click Transfer Activation Quota.
The Transfer Activation Quota dialog box is displayed.
4. Click Edit in the Operation column, set parameters by referring to Table
5-10, and click Save in the Operation column.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 40


Huawei HiLens
User Guide 5 Subscribing to Huawei HiLens Products

Table 5-10 Parameters for activation quota transfer


Parameter Description

Account ID Account ID to which the device activation quota is


transferred.
Click the username in the upper right corner of the console
and choose My Credentials to obtain the account ID, as
shown in Figure 5-4.

User ID User ID to which the device activation quota is transferred.


Click the username in the upper right corner of the console
and choose My Credentials to obtain the user ID, as shown
in Figure 5-4.

Remaining How many devices can be activated using the quota you are
Quota transferring. The device activation quota of the current order
cannot exceed the total activatable devices.

Figure 5-4 My Credentials

5. Click OK.
The device activation quota is transferred.
After the activation quota is transferred, you can activate devices using the
account to which the activation quota is transferred. For details, see Activating
Devices Using Other Subscriber's Order Number .

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 41


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

6 Registering HiLens Kit Devices

6.1 Registering a HiLens Kit Device


Introduction to HiLens Kit
HiLens Kit is a brand of multimedia devices with AI inference capabilities. It packs
powerful computing, HD camera access, and multiple ports into a compact kit. Its
hardware has an integrated Atlas 200 AI Accelerator Module (Atlas 200 for short)
for quick access to the network and maximized computing power of the Ascend
310 AI processor. The HiLens Kit device is perfect for AI developers in pre-research
and development as well as video surveillance domains. Its built-in HiLens
Framework provides abundant APIs for running skills.
A HiLens Kit device provides an onboard 32 GB eMMC and one micro SD slot for
connecting an external micro SD card. The micro SD card supports a maximum
rate of SDR50 and a maximum capacity of 2 TB. For details about how to connect
a micro SD card to a HiLens Kit device, see Using an SD Card. For detailed
parameters, see Table 6-1. For details about the product, see HiLens Kit User
Guide > Product Description.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 42


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-1 HiLens Kit

Table 6-1 HiLens Kit parameters

Chip CP Micro SD Camera Mic Net U HD Audi OS W


U rop work SB MI o i-
hon Port Out Fi
e

Asce Hi 1 2- 2 1 2 1 1 Lin Su
nd 35 megapix ux pp
310 59 el, 720p or
(8 A te
GB (4 d
RAM G
) B)

NOTE

● The HiLens Kit product is now available on the HUAWEI CLOUD website, you can
directly purchase it. If you want to purchase many HiLens Kit devices at once, contact
the local Huawei office or call the HUAWEI CLOUD pre-sales hotline.
● HiLens Kit devices support system file configuration. You can connect a PC to a HiLens
Kit device and use SSH to log in to the HiLens Kit device. HiLens Kit device systems
cannot be ported to other operating systems.
● Each HiLens Kit device has a built-in camera. It can also connect to external IP cameras
of 4K or a lower resolution. For details, see Configuring Cameras. For a development
example, see Developing a Safety Helmet Detection Skill (with an External IPC).

Reference documents

When you obtain the documents for the first time, register an account and your
product with the enterprise technical support website (Support-E website). Enter
the product serial number (SN) of the HiLens Kit device to complete product
registration. For details, see Enhance My Account Privilege.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 43


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

The SN is at the bottom of the HiLens Kit device and is a string of 20 characters,
for example, 21023XXXXXXXXXXXXXXX.
After the product registration application is submitted, if the system displays a
message indicating that the product registration is successful, go to the next step.
If the system displays a message indicating that the product is to be reviewed,
wait until the product is successfully reviewed and go to the next step. The
product will be reviewed within one workday.
● HiLens Kit User Guide
This document describes the appearance, logical structure, and specifications
of the Atlas 200 HiLens Kit and provides guidance for users to install, connect,
power on, power off, and configure the Atlas 200 HiLens Kit.
● Atlas 200 HiLens Kit Intelligent Edge System User Guide
This document describes the system architecture of the Huawei HiLens
intelligent edge system and guide users through managing and maintaining
the Atlas 200 HiLens Kit using this system.
Methods for registering a HiLens Kit device
To enable HiLens Kit devices with AI skills, you need to register them with the
Huawei HiLens console so that you can manage the devices and their skills on the
console.
This section describes how to log in to a HiLens Kit device, register it with the
cloud-based Huawei HiLens console, and manage it on the console.
● Currently, only HiLens Kit devices released by Huawei can be registered.
● You can install and use only skills "oriented to Ascend 310 chips" on HiLens
Kit devices.
You can register HiLens Kit devices using the HiLens Kit intelligent edge system or
SSH. The following are the processes and operation guides:
● Registering a Device Using the Intelligent Edge System
● Registering a Device Using SSH
Common operations
Initialization Configuration: The HiLens Kit device comes pre-installed with the
Euler operating system. You do not need to install one. You can log in to the
Huawei HiLens intelligent edge system using a browser to perform initialization
configuration.
Changing the Initial User Name and Password: For security purposes, change
the initial password upon the first login and periodically change the password.
Configuring a Firewall: To prevent users beyond the allowed IP address range
from accessing the HiLens Kit intelligent edge system, you can configure a firewall
to prevent the system from being attacked.
Restoring Factory Settings: If the system of the HiLens Kit device is damaged by
mistake and cannot be restored to normal use, you need to restore the factory
settings.
Using an SD Card: When using a HiLens Kit device, insert an SD card to store skill
data.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 44


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Registering a Device Using the Intelligent Edge System


Registering a device with Intelligent Edge System (IES) is performed on the GUI of
IES, which is simple.

NOTE

● Before registering a device with IES, you need to upgrade the system firmware to
version 2.2.200.011. Read Upgrading the HiLens Kit System Firmware Version
carefully to evaluate the service continuity risks caused by the upgrade. If you do not
accept the risks caused by the upgrade of the system firmware, use SSH to register the
device.
● Before using the intelligent edge system to register a HiLens Kit device, you need to
disable login protection. After accessing the Account Security Settings page, you can
enable login protection by choosing Account Security Settings > Critical Operations.
If login protection is not enabled for the account, ignore this requirement.

Figure 6-2 shows the procedure for registering your device using the intelligent
edge system. Table 6-2 details every step.

Figure 6-2 Procedure for registering a device using the intelligent edge system

Table 6-2 Procedure description


Procedure Description Detailed Instructions

Connect a Before registering a HiLens Kit Connecting a HiLens Kit


HiLens Kit device with the Huawei HiLens Device to a PC
device to a PC. console, you need to connect the
HiLens Kit device to a PC.

Upgrade the To register a HiLens Kit device Upgrading the HiLens


HiLens Kit using the intelligent edge system, Kit System Firmware
system you need to upgrade the HiLens Kit Version
firmware. system firmware version to
2.2.200.011.

Synchronize To ensure successful device Synchronizing the Time


the time zone registration, you need to Zone and Time
and time. synchronize the device's time zone
and time with the actual time zone
and time.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 45


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Procedure Description Detailed Instructions

Configure the A HiLens Kit device can be Configuring the


networking. connected to a router in wireless or Wireless Network
wired mode. You can select either Configuring the Wired
of the two networking modes. Network
Do not connect a router to a wired
network and a wireless network at
the same time. If you connect the
router to a wireless network, the
default gateway will be
automatically deleted. If you
connect the router to a wired
network again, you need to
configure the default gateway. You
are advised to connect the router
to a wireless network, in case
you forget the device IP address
after updating it.

Register the Register the device with the Registering a HiLens Kit
HiLens Kit console and check the device Device
device. status on the console.

Registering a Device Using SSH


Registering a device using SSH indicates that you log in to the HiLens Kit system
using SSH and run Linux commands to register a device. It allows you to configure
system files of HiLens Kit.
Figure 6-3 shows the procedure for registering your device using SSH. Table 6-3
details every step.

Figure 6-3 Procedure for registering a device using SSH

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 46


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Table 6-3 Procedure description

Procedure Description Detailed Instructions

Connect a Before registering a HiLens Kit Connecting a HiLens Kit


HiLens Kit device with the Huawei HiLens Device to a PC
device to a PC. console, you need to connect the
HiLens Kit device to a PC.

Log in to the Connect to the HiLens Kit device Logging In to a HiLens


HiLens Kit using SSH and use Linux Kit Device Using SSH
device using commands to perform
SSH. corresponding operations on the
device.

Configure the A HiLens Kit device can be Wireless Network


networking. connected to a router in wireless or Configuration (SSH)
wired mode. You can select either Wired Network
of the two networking modes. Configuration (SSH)
A router cannot be connected to a
wired network and a wireless
network at the same time. If you
connect the router to a wireless
network, the default gateway will
be automatically deleted. If you
connect the router to a wired
network again, you need to
configure the default gateway. You
are advised to connect the router
to a wireless network, in case
you forget the device IP address
after updating it.

Register the Register the device with the Registering a HiLens Kit
HiLens Kit console and check the device Device
device. status on the console.

6.2 Registering a Device Using the Intelligent Edge


System

6.2.1 Connecting a HiLens Kit Device to a PC


Before registering a HiLens Kit device with the Huawei HiLens console, you need
to connect the HiLens Kit device to a PC.

Prerequisites
● You have at least one HiLens Kit device.
● Your HUAWEI CLOUD account is not in arrears.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 47


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

● If you use the intelligent edge system to register a device, the system
firmware version must be 2.2.200.011 or later. If your firmware version is
earlier than 2.2.200.011, upgrade it first.
To query the system firmware version, log in to the Huawei HiLens
intelligent edge system webUI, and choose Maintenance > Firmware
Upgrade to view the current version number.
You are advised to upgrade the firmware of new HiLens Kit hardware to
achieve better stability.
If the firmware version is earlier than 2.2.200.011, you can only register it
using SSH. After the registration using SSH is successful, you can upgrade the
system firmware version later. For details about the upgrade methods and
risks, see Upgrading the HiLens Kit System Firmware Version.
● By default, devices registered using the intelligent edge system are registered
to the CN North-Beijing4 region.
If you do not accept the restrictions, select Registering a Device Using SSH.
If you want to register the device to another region, use the SSH tool to
modify the device configuration. For details, see (Optional) Switching the
Device Registration Region to CN North-Beijing1.

Connecting a HiLens Kit Device to a PC Using a Network Cable


Figure 6-4 and Table 6-4 show the ports on the rear panel of the HiLens Kit
device.

Figure 6-4 Ports on the rear panel

Table 6-4 Description of ports on the rear panel


Port Description

1 Power button

2 Power socket

3 Management network port

1. Connect a 12 V DC power adapter to the power socket on the rear panel of


the HiLens Kit device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 48


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

2. Press and hold the power button for 1 to 2 seconds to power on the HiLens
Kit device.
3. Connect one end of the network cable to the management network port of
the device and the other end to an Ethernet port of the PC.

Interconnecting the Network Between the PC and the HiLens Kit Device
Set an IP address and a subnet mask or route for the PC so that the PC can
properly communicate with the device.

1. Click the network icon in the lower right corner of the PC and click
Network & Internet settings.
2. On the Network & Internet settings page, click Change adapter settings to
enter the Network Connections page.
3. After the HiLens Kit device is connected to the PC using a network cable, a
corresponding connection is displayed on the Network Connections page
of the PC. Right-click the connection (generally named Local Area
Connection) and choose Properties from the shortcut menu. The Local Area
Connection Properties dialog box is displayed.
4. Double-click Internet Protocol Version 4 (TCP/IPv4) and select Use the
following IP address. Then, enter an IP address that is in the same network
segment as the device IP address and click the Subnet mask text box to
automatically generate a subnet mask. Click OK.
For details about the initial IP address of the device, see the Default Value of
Initial IP address of the management network port in HiLens Kit User
Guide > Default Credentials.
NOTE

● You can connect to the HiLens Kit device using SSH from your local PC only when
the IP address configured in Local Area Connection Properties > Internet
Protocol Version 4 (TCP/IPv4) > Properties is in the same network segment as
the device IP address. The same network segment means that the first three
octets of the local connection IP address are the same as that of the device IP
address. For example, if the device IP address is 192.168.2.111, the IP address (in
the same network segment as the device IP address) configured in Local Area
Connection Properties > Internet Protocol Version 4 (TCP/IPv4) > Properties
can be 192.168.2.x, where x is an integer from 2 to 255 except 111.
● If the device IP address has been modified, configure the IP address in Local Area
Connection Properties > Internet Protocol Version 4 (TCP/IPv4) > Properties to
an IP address in the same network segment as the new device IP address. For
details about how to modify an IP address, see Configuring the Wired Network.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 49


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-5 Modifying network properties

Follow-up Operations
To register a HiLens Kit device using the intelligent edge system, you need to
upgrade the HiLens Kit system firmware version to 2.2.200.011. For details, see
Upgrading the HiLens Kit System Firmware Version.

6.2.2 Upgrading the HiLens Kit System Firmware Version


To register a HiLens Kit device using the intelligent edge system, you need to
upgrade the HiLens Kit system firmware version to 2.2.200.011 (TR6). Before the
upgrade, read the following content carefully.

Upgrade Prerequisites and Precautions


● If the system firmware version is earlier than 2.2.200.011, you can upgrade it.
To query the system firmware version, log in to the Huawei HiLens
intelligent edge system webUI, and choose Maintenance > Firmware
Upgrade to view the current version number.
For details, see the HiLens Kit Update Guide.
● After the HiLens Kit system firmware is upgraded, its version becomes
2.2.200.011, and the HiLens_Device_Agent firmware will also be upgraded to
1.0.6. (If the HiLens Kit device is in use and the current HiLens_Device_Agent
firmware version is later than 1.0.6, the latest HiLens_Device_Agent firmware
version is retained.)
● If your HiLens Kit device is newly registered and used for the first time, you
are advised to upgrade its firmware to the latest version to ensure better
system stability.
● If your HiLens Kit device has been registered and is in use, you are advised to
read the upgrade risks carefully and determine whether to perform the
upgrade.

Upgrade Risks
Before the upgrade, read the following risks carefully and exercise caution when
performing the upgrade.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 50


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

● Before upgrading the firmware version of a HiLens Kit device that has been
registered and is in use, contact the contact person to evaluate the risk of the
upgrade on service continuity.
● Upgrading the HiLens Kit system firmware version will reinstall the entire
system directory. As a result, the software installed in the system directory will
be lost. To locate the system directory, run the df -h command to view the
current partition information. The root directory corresponding to /dev/
mmcblk0p2 is the system directory. This directory is the default software
installation directory. During the upgrade, the software installed in it will be
lost. Files in other non-system directories, such as the /dev/mmcblk0p*
directory, are not affected during the upgrade.
Tips: To prevent the system directory from affecting the upgrade, you can
redirect software packages that support redirection installation to the /opt
directory of the HiLens Kit device system to avoid file loss in subsequent
system upgrades. For example, you can run the yum --installroot=/opt
install xxx command to redirect the YUM installation software package XXX.
Software packages that do not support redirection installation, such as RPM
packages involved in YUM and ROS installation, can be deployed only in the
system directory and will be lost after the upgrade.
● After the HiLens Kit system firmware version is upgraded, some of the
original skills may fail to run. Exercise caution when performing this
operation.

Upgrade Advantages
● Devices can be registered using the intelligent edge system. For details about
the registration process, see Registering a Device Using the Intelligent Edge
System.
● The device can be logged in using user admin and keep online for up to one
hour.
After the upgrade, you can run the timeout command as user admin to set
the timeout period. The maximum timeout period is 1 hour. For example, to
set the timeout period to 1 hour, run the timeout 3600 command.
● You must change the default username and password upon the first login to
the intelligent edge system to prevent security risks caused by the use of the
default username and password.
● Hardware and resource monitoring is also available. When the hardware is
abnormal or the resource usage exceeds the alarm threshold, an alarm is
reported.
● Security upgrade is performed on third-party components.

Prerequisites
Use a network cable to connect a HiLens Kit device to a PC. For details, see
Connecting a HiLens Kit Device to a PC.

Upgrade Procedure
If you have registered and used your HiLens Kit devices, carefully read Upgrade
Risks before the upgrade.
Upgrade the system firmware version twice. The operations are as follows:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 51


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

For details, see the HiLens Kit Update Guide.


1. When you obtain the upgrade package for the first time, register an account
and register your product with the enterprise technical support website
(Support-E website). Enter the product serial number (SN) of the HiLens Kit
device to complete product registration. For details, see Enhance My Account
Privilege.
The SN is marked at the bottom of the HiLens Kit device and is a string of 20
characters, for example, 21023XXXXXXXXXXXXXXX.
After the product registration application is submitted, if the system displays a
message indicating that the product registration is successful, go to the next
step. If the system displays a message indicating that the product is to be
reviewed, wait until the product is successfully reviewed and go to the next
step. The product will be reviewed within one workday.
2. Log in to the Huawei Enterprise website, choose Technical Support >
Product and Solution Support > Server - Intelligent Computing > Ascend
Computing. Under Intelligent Edge Hardware, click A200-3000HiLens.
If an incorrect product is selected, the SN fails to pass the check and the
upgrade cannot be performed.
3. Click Software Download. In the software version list, select
A200-3000HiLens-FWV2.2.200.011.hpm and download it to the local PC.
4. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
5. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
6. On the main menu, choose Maintenance > Firmware Update > System
Firmware.
The System Firmware page is displayed.
7. Click on the right of Update File, and select a file, that is, the upgrade
package downloaded in step 3.
The system displays a message indicating that the file has been added.
NOTE

Do not close the current page or switch to another page during the upload process.
Otherwise, the upload will fail.
8. Click Upgrade. In the confirmation box that is displayed, select After the
update is complete, the system restarts automatically.
If you do not select this option, you need to manually restart the system for
the update to take effect.
9. Click OK.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 52


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

You can view the update package version and progress on the page.
10. Wait for about 10 minutes. The system displays a message indicating that the
upgrade is successful.
If you perform the upgrade for the first time, log in to Huawei HiLens
intelligent edge system again and repeat step 3 to step 8.
NOTE

To ensure successful device registration, use the same upgrade package when
performing the second upgrade.
If you have performed the upgrade twice, the HiLens Kit firmware has been
upgraded.

Follow-up Operations
● If the source HiLens_Device_Agent firmware version is later than 1.0.7, you
also need to upgrade it after upgrading the HiLens Kit system firmware
version. For details, see Upgrading HiLens_Device_Agent Firmware. (That is,
if the HiLens_Device_Agent firmware version is already the latest, you also
need to update it again.)
● After the HiLens Kit system firmware and HiLens_Device_Agent firmware are
upgraded, you need to synchronize the time zone and time when registering
the device. For details, see Synchronizing the Time Zone and Time.

6.2.3 Synchronizing the Time Zone and Time


To ensure successful device registration, you need to synchronize the device's time
zone and time with the actual time zone and time.

Prerequisites
Perform the following operations in sequence:
1. Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.
2. Upgrade the HiLens Kit system firmware version. For details, see Upgrading
the HiLens Kit System Firmware Version.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 53


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

3. Choose Management > Time.


The Set system time page is displayed.
4. Set Area to Asia and Time Zone to Shanghai, and click Save.
The system automatically exits.
5. Log in to the Huawei HiLens intelligent edge system again.
6. Choose Management > Time.
The Set system time page is displayed.
7. Check the Time. If the time is incorrect, click to correct it and click Save.
If the time is incorrect, skills cannot be installed after the device registration.

Follow-up Operations
Network configuration: A HiLens Kit device can be connected to a router in
wireless or wired mode. You can select either of the two networking modes.

The following sections describe how to use the two networking modes.

● Configuring the Wireless Network


● Configuring the Wired Network

A router cannot be connected to a wired network and a wireless network at the


same time. If you connect the router to a wireless network, the default gateway
will be automatically deleted. If you connect the router to a wired network again,
you need to configure the default gateway. You are advised to connect the
router to a wireless network, in case you forget the device IP address after
updating it.

6.2.4 Configuring the Wireless Network


A HiLens Kit device can be connected to a router in wireless or wired mode. This
section describes the wireless network configuration mode.

NOTE

A router cannot be connected to a wired network and a wireless network at the same time.
If you connect the router to a wireless network, the default gateway will be automatically
deleted. If you connect the router to a wired network again, you need to configure the
default gateway. You are advised to connect the router to a wireless network, in case
you forget the device IP address after updating it.
If you select the wired network configuration mode, see Configuring the Wired Network.

Configuration Requirements
To connect to a router through a wireless network, enter the network's
password first.

Currently, HiLens Kit devices support only 2.4 GHz wireless networks with general
encryption types. The name of a wireless network consists of 8 to 63 characters
but cannot contain single or double English quotation marks.

● The 2.4 GHz wireless networks comply with IEEE802.11n, IEEE802.11g, and
IEEE802.11b protocols.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 54


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

● The supported wireless network encryption types include WEP, WPA-PSK/


WPA2-PSK, and AES.
● Wireless networks that need to be verified are not supported.
● TKIP encryption is not supported.
● The IP address of the router gateway cannot be set to xxx.xxx.0.xxx, for
example, 192.168.0.1. In addition, the router gateway and the HiLens Kit
device cannot be in the same network segment. For example, if the device IP
address is 192.168.2.111, the IP address of the router gateway cannot be set
to 192.168.2.xxx.

Prerequisites
Perform the following operations in sequence:
1. Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.
2. Upgrade the HiLens Kit system firmware version. For details, see Upgrading
the HiLens Kit System Firmware Version.
3. Synchronize the time zone and time of the device. For details, see
Synchronizing the Time Zone and Time.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wired Network.
The Wired Network page is displayed.
4. Under the Configure IP Address area, check whether the IP Address has a
Default Gateway. See Figure 6-6.

Figure 6-6 Checking the default gateway

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 55


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

– If no default gateway exists, go to the next step.


– If the default gateway exists, perform the following operations:
Click Modify in the Operations column. In the displayed Modify IP
Address dialog box, delete the existing value in the Default Gateway
text box and click OK.
Go to the next step.
5. Choose Management > Network > Wireless Network.
The Wireless Network tab page is displayed.
6. Click to enable the Wi-Fi.
The system searches for the nearby Wi-Fi hotspots.
7. Click to refresh the hotspot information.

8. Click .
The WIFI Connection dialog box is displayed.
9. Enter the Wi-Fi password in the Password text box, as shown in Figure 6-7.
Click OK.
A message is displayed in the upper right corner, indicating that the wireless
network is successfully connected to the router.

Figure 6-7 Connecting to a router through a wireless network

Checking the IP Address of a Wireless Network


After a wireless network is configured, you can obtain its IP address from the
Huawei HiLens intelligent edge system.
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 56


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wireless Network.
The Wireless Network tab page is displayed.
4. In the upper right corner of the card of the wireless network you are
connected to, click WIFI Detail.
The WIFI detail dialog box is displayed.
IP is the IP address of the wireless network.

Figure 6-8 Checking the IP address of a wireless network

Follow-up Operations
Register the HiLens Kit device. For details, see Registering a HiLens Kit Device.

6.2.5 Configuring the Wired Network


A HiLens Kit device can be connected to a router in wireless or wired mode. This
section describes the wired network configuration mode.

NOTE

A router cannot be connected to a wired network and a wireless network at the same time.
If you connect the router to a wireless network, the default gateway will be automatically
deleted. If you connect the router to a wired network again, you need to configure the
default gateway. You are advised to connect the router to a wireless network, in case
you forget the device IP address after updating it.
For details about the wireless network configuration, see Registering a HiLens Kit Device.

Explanation
If a wired network is used to directly connect to a router, you need to modify
the device IP address to ensure that the device IP address and the router IP
address are in the same network segment.
The same network segment means that the first three octets of the device IP
address are the same as that of the router IP address. For example, if the device IP
address is 192.168.2.111, the router IP address can be 192.168.2.x, where x is an
integer from 2 to 255 except 111.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 57


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Preparations
Perform the following operations in sequence:
1. Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.
2. Upgrade the HiLens Kit system firmware version. For details, see Upgrading
the HiLens Kit System Firmware Version.
3. Synchronize the time zone and time of the device. For details, see
Synchronizing the Time Zone and Time.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://IP address of
Huawei HiLens intelligent edge system. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wired Network.
The Wired Network page is displayed.

Figure 6-9 Connecting to a router through a wired network

4. Click Check after Check Network Status to check whether the network is
connected.
5. Change the IP address.
a. Click Modify in the row containing the IP address you want to change.
b. Change the IP Address by referring to Table 6-5. In this example, the
router IP address is 192.168.2.1, as shown in Figure 6-10. After changing
the IP address, click OK.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 58


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

c. Click Save and restart the system for the IP settings to take effect.

Table 6-5 Parameters for changing an IP address

Parameter Description

Function Usage of the IP address.


The value contains 1 to 32 characters, including
letters, digits, and underscores (_).

IP Address IPv4 address to be changed.


The IP address must be in the same network
segment as the router IP address.

Default Default gateway corresponding to the new IP


Gateway address.
NOTE
Ensure that the default gateway is globally unique.

Figure 6-10 Changing the IP address

6. Remove the network cable from the PC, disconnect the device from the PC,
and then connect the device to the router using the network cable.
7. Configure DNS.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 59


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

a. On the home page of the Huawei HiLens intelligent edge system, choose
Management > Network > Wired Network. Click Add under Configure
DNS Address.
Add the DNS address nameserver 8.8.8.8.
b. Click OK.
c. Click Save and restart the system for the settings to take effect.

Follow-up Operations
Register the HiLens Kit device. For details, see Registering a HiLens Kit Device.

6.2.6 Registering a HiLens Kit Device


Prerequisites
Perform the following operations in sequence:
1. Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.
2. Upgrade the HiLens Kit system firmware version. For details, see Upgrading
the HiLens Kit System Firmware Version.
3. Synchronize the time zone and time of the device. For details, see
Synchronizing the Time Zone and Time.
4. Select either of the following network configuration modes:
– Configuring the Wireless Network
– Configuring the Wired Network
A router cannot be connected to a wired network and a wireless network at
the same time. If you connect the router to a wireless network, the default
gateway will be automatically deleted. If you connect the router to a wired
network again, you need to configure the default gateway. You are advised
to connect the router to a wireless network, in case you forget the device
IP address after updating it.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Maintenance > NMS Registration.
The NMS Registration page is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 60


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

4. Select HUAWEI HiLens Cloud Register for Select NMS Mode and enter the
basic information according to Table 6-6.
If the HUAWEI HiLens Cloud Register option is not available, upgrade the
HiLens system firmware version twice. For details, see Upgrading the HiLens
Kit System Firmware Version.
If the device is restored to factory settings, upgrade the HiLens system
firmware version twice. For details, seeUpgrading the HiLens Kit System
Firmware Version.

Table 6-6 Device registration parameters


Parameter Description

Device Name HiLens Kit device name, which is


user-defined. Only letters, digits, and
underscores (_) are allowed. The
name cannot start with a digit, and
it cannot contain only digits.

Account Name HUAWEI CLOUD account name. For


details about related concepts, see
IAM Basic Concepts.
NOTE
The account used to register a HiLens
Kit device must be a HUAWEI CLOUD
account.

User Name IAM username. For details about


related concepts, see IAM Basic
Concepts. If no IAM account is
available, the User Name is the
same as the Account Name.

Password Password of the HUAWEI CLOUD


account

The username, account name, and device name used for registering a HiLens
Kit device can contain only letters, digits, and underscores (_). The names
cannot start with a digit or contain digits only.
5. Click Save.
A message is displayed in the upper right corner, indicating that the
registration is successful.

Viewing the Registered Device on the Huawei HiLens Console


Log in to the Huawei HiLens console. In the navigation pane, choose Device
Management > Devices. All registered devices are displayed in the device list by
default. If you can view the device you registered and its status is Online, the
device registration is successful.
If the registration fails or the device is offline, rectify the fault by following the
instructions provided in HiLens Kit Registration Failed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 61


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

NOTE

By default, devices registered using the intelligent edge system are registered to the CN
North-Beijing4 region. You need to switch the console region to CN North-Beijing4 if you
are not in this region.

Figure 6-11 Device registration status

6.3 Registering a Device Using SSH

6.3.1 Connecting a HiLens Kit Device to a PC


To operate configurations such as system files of a HiLens Kit device, you can
register it using SSH, log in to it, and run corresponding Linux commands. The
following uses PuTTY as an example to describe how to log in to a HiLens Kit
device using SSH in a Windows 7 environment.

Preparations
● You have at least one HiLens Kit device.
● Your HUAWEI CLOUD account is not in arrears.
● Ensure that you have obtained the following data:
– IP address of the device to be connected
For details about the initial IP address of the device, see the Default
Value of Initial IP address of the management network port in HiLens
Kit User Guide > Default Credentials.
– Username and password for logging in to the device to be connected
For details about the initial username and password of the device, see the
Default Value of Initial user name and password in HiLens Kit User
Guide > Default Credentials.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 62


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

If this is not your first login, use the new account name and password.
For details about how to change the password, see Changing the Initial
User Name and Password.
● Ensure that you have downloaded PuTTY.exe. This is third-party software.

Connecting a HiLens Kit Device to a PC Using a Network Cable


Figure 6-12 and Table 6-7 show the ports on the rear panel of the HiLens Kit
device.

Figure 6-12 Ports on the rear panel

Table 6-7 Description of ports on the rear panel

Port Description

1 Power button

2 Power socket

3 Management network port

1. Connect a 12 V DC power adapter to the power socket on the rear panel of


the HiLens Kit device.
2. Press and hold the power button for 1 to 2 seconds to power on the HiLens
Kit device.
3. Connect one end of the network cable to the management network port of
the device and the other end to an Ethernet port of the PC.

Interconnecting the Network Between the PC and the HiLens Kit Device
Set an IP address and a subnet mask or route for the PC so that the PC can
properly communicate with the device.

1. Click the network icon in the lower right corner of the PC and click
Network & Internet settings.
2. On the Network & Internet settings page, click Change adapter settings to
enter the Network Connections page.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 63


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

3. After the HiLens Kit device is connected to the PC using a network cable, a
corresponding connection is displayed on the Network Connections page
of the PC. Right-click the connection (generally named Local Area
Connection) and choose Properties from the shortcut menu. The Local Area
Connection Properties dialog box is displayed.
4. Double-click Internet Protocol Version 4 and select Use the following IP
address. Then, enter an IP address that is in the same network segment as
the device IP address and click the Subnet mask text box to automatically
generate a subnet mask. Click OK.
For details about the initial IP address of the device, see the Default Value of
Initial IP address of the management network port in HiLens Kit User
Guide > Default Credentials.
NOTE

● You can connect to the HiLens Kit device using SSH from your local PC only when
the IP address configured in Local Area Connection Properties > Internet
Protocol Version 4 Properties is in the same network segment as the device IP
address. The same network segment means that the first three octets of the local
connection IP address are the same as that of the device IP address. For example, if
the device IP address is 192.168.2.111, the IP address (in the same network
segment as the device IP address) configured in Local Area Connection Properties
> Internet Protocol Version 4 Properties can be 192.168.2.x, where x is an integer
from 2 to 255 except 111.
● If the device IP address has been modified, configure the IP address in Local Area
Connection Properties > Internet Protocol Version 4 Properties to an IP address
in the same network segment as the new device IP address. For details about how
to modify an IP address, see Wired Network Configuration (SSH).

Figure 6-13 Modifying the Attributes of a Network in the VPC

Follow-up Operations
Log in to the HiLens Kit device using SSH. For details, see Logging In to a HiLens
Kit Device Using SSH.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 64


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

6.3.2 Logging In to a HiLens Kit Device Using SSH

Prerequisites
You have connected a HiLens Kit device to a PC. For details, see Connecting a
HiLens Kit Device to a PC.

Procedure
1. Use SSH to remotely connect to the HiLens Kit device.
a. Start PuTTY, click Session, enter the device IP address in the Host Name
(or IP address) text box, and enter the port number in the Port text box.
Assume that the device IP address is 192.168.2.111 and the port number
is 22. Figure 6-14 shows the page.

Figure 6-14 Using PuTTY to log in to the HiLens Kit device

b. Click Open.
Log in to the device.
2. Use SSH to remotely connect to the device system.
After the admin@192.168.2.111's password prompt, enter the admin
password. For details about the preset password for the first login, see HiLens
Kit User Guide > Default Credentials.
3. Use SSH to remotely log in to the developer CLI.
a. After the IES:/-> prompt, run the develop command.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 65


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

b. After the Password prompt, enter the root password. For details about
the preset password for the first login, see HiLens Kit User Guide >
Default Credentials.

Figure 6-15 Connecting to the device using SSH

4. Use SSH to remotely modify the device time.


a. Run the following command to change the time zone to that of China
(GMT+8):
timedatectl set-timezone Asia/Shanghai
b. Modify the device time. Assume that the current time is 19:19:19 on
October 17, 2019. Run the following commands:
date -s "2019-10-17 19:19:19"
hwclock -w
reboot
5. By default, a device is registered in region CN North-Beijing4. To register the
device in CN North-Beijing1, switch the device registration region.

(Optional) Switching the Device Registration Region to CN North-Beijing1


By default, a device is registered in region CN North-Beijing4. To register the
device in CN North-Beijing1, modify the configuration file of the device. The
procedure is as follows:

1. Run the following command on PuTTY to open the DNS file:


vi /home/hilens/hda/etc/hda.conf
2. Change the device registration region. Under the comment #Select the
registration region on HUAWEI CLOUD, default to CN North-Beijing4,
change region=cn-north-4 to:
region = cn-north-1
Save the modification.
3. Run the following command to restart the device:
reboot

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 66


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Follow-up Operations
Network configuration: A HiLens Kit device can be connected to a router in
wireless or wired mode. You can select either of the two networking modes.

The following sections describe how to use the two networking modes.

● Wireless Network Configuration (SSH)


● Wired Network Configuration (SSH)

A router cannot be connected to a wired network and a wireless network at the


same time. If you connect the router to a wireless network, the default gateway
will be automatically deleted. If you connect the router to a wired network again,
you need to configure the default gateway. You are advised to connect the
router to a wireless network, in case you forget the device IP address after
updating it.

6.3.3 Wireless Network Configuration (SSH)


A HiLens Kit device can be connected to a router in wireless or wired mode. This
section describes the wireless network configuration mode.

NOTE

A router cannot be connected to a wired network and a wireless network at the same time.
If you connect the router to a wireless network, the default gateway will be automatically
deleted. If you connect the router to a wired network again, you need to configure the
default gateway. You are advised to connect the router to a wireless network, in case
you forget the device IP address after updating it.
If you select the wired network configuration mode, see Wired Network Configuration
(SSH).

Configuration Requirements
To connect to a router through a wireless network, enter the network's
password first.

Currently, HiLens Kit devices support only 2.4 GHz wireless networks with general
encryption types. The name of a wireless network consists of 8 to 63 characters
but cannot contain single or double English quotation marks.

● The 2.4 GHz wireless networks comply with IEEE802.11n, IEEE802.11g, and
IEEE802.11b protocols.
● The supported wireless network encryption types include WEP, WPA-PSK/
WPA2-PSK, and AES.
● Wireless networks that need to be verified are not supported.
● TKIP encryption is not supported.
● The IP address of the router gateway cannot be set to xxx.xxx.0.xxx, for
example, 192.168.0.1. In addition, the router gateway and the HiLens Kit
device cannot be in the same network segment. For example, if the device IP
address is 192.168.2.111, the IP address of the router gateway cannot be set
to 192.168.2.xxx.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 67


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Prerequisites
● Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wired Network.
The Wired Network page is displayed.
4. Under the Configure IP Address area, check whether the IP Address has a
Default Gateway. See Figure 6-16.

Figure 6-16 Checking the default gateway

– If no default gateway exists, go to the next step.


– If the default gateway exists, perform the following operations:
Click Modify in the Operations column. In the displayed Modify IP
Address dialog box, delete the existing value in the Default Gateway
text box and click OK.
Go to the next step.
5. Choose Management > Network > Wireless Network.
The Wireless Network tab page is displayed.
6. Click to enable the Wi-Fi.
The system searches for the nearby Wi-Fi hotspots.
7. Click to refresh the hotspot information.

8. Click .

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 68


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

The WIFI Connection dialog box is displayed.


9. Enter the Wi-Fi password in the Password text box, as shown in Figure 6-17.
Click OK.
A message is displayed in the upper right corner, indicating that the wireless
network is successfully connected to the router.

Figure 6-17 Connecting to a router through a wireless network

Checking the IP Address of a Wireless Network


After a wireless network is configured, you can obtain its IP address from the
Huawei HiLens intelligent edge system.

1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.
NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wireless Network.
The Wireless Network tab page is displayed.
4. In the upper right corner of the card of the wireless network you are
connected to, click WIFI Detail.
The WIFI detail dialog box is displayed.
IP is the IP address of the wireless network.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 69


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-18 Checking the IP address of a wireless network

Follow-up Operations
Register the HiLens Kit device. For details, see Registering a HiLens Kit Device.

6.3.4 Wired Network Configuration (SSH)


A HiLens Kit device can be connected to a router in wireless or wired mode. This
section describes the wired network configuration mode.

NOTE

A router cannot be connected to a wired network and a wireless network at the same time.
If you connect the router to a wireless network, the default gateway will be automatically
deleted. If you connect the router to a wired network again, you need to configure the
default gateway. You are advised to connect the router to a wireless network, in case
you forget the device IP address after updating it.
For details about the wireless network configuration, see Wireless Network Configuration
(SSH).

Explanation
If a wired network is used to directly connect to a router, you need to modify
the device IP address to ensure that the device IP address and the router IP
address are in the same network segment.

The same network segment means that the first three octets of the device IP
address are the same as that of the router IP address. For example, if the device IP
address is 192.168.2.111, the router IP address can be 192.168.2.x, where x is an
integer from 2 to 255 except 111.

Prerequisites
● Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.

Procedure
1. Log in to the Huawei HiLens intelligent edge system using a browser on the
local PC. Enter the address of the Huawei HiLens intelligent edge system in
the address box, and press Enter. The address format is https://Huawei
HiLens intelligent edge system IP address. The default IP address is
192.168.2.111. Press Enter.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 70


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

NOTE

If "There is a problem with this website's security certificate" is displayed, click


Continue to this website (not recommended).
2. On the login page, enter login information.
Enter the username and password.
For the initial user name and password, see Default Data.
3. Choose Management > Network > Wired Network.
The Wired Network page is displayed.

Figure 6-19 Connecting to a router through a wired network

4. Click Check after Check Network Status to check whether the network is
connected.
5. Change the IP address.
a. Click Modify in the row containing the IP address you want to change.
b. Change IP Address by referring to Table 6-8. In this example, the router
IP address is 192.168.2.1, as shown in Figure 6-20. After changing the IP
address, click OK.
c. Click Save and restart the system for the IP settings to take effect.

Table 6-8 Parameters for changing an IP address

Parameter Description

Function Usage of the IP address.


The value contains 1 to 32 characters, including
letters, digits, and underscores (_).

IP Address IPv4 address to be changed.


The IP address must be in the same network
segment as the router IP address.

Default Default gateway corresponding to the new IP


Gateway address.
NOTE
Ensure that the default gateway is globally unique.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 71


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-20 Changing the IP address

6. Remove the network cable from the PC, disconnect the device from the PC,
and then connect the device to the router using the network cable.
7. After the connection is complete, log in to the device using SSH. Run the
following command to check whether the connection is successful:
ping 8.8.8.8
or
ping www.huaweicloud.com
If the device is connected successfully, the following information is displayed:

Figure 6-21 Wired connection prompt

If the device connection fails, perform the next step.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 72


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

8. Remotely configure DNS using SSH.


a. Run the following command on PuTTY to open the DNS file:
vi /etc/resolv.conf
b. Delete the original content and change the parameter to the following:
nameserver 8.8.8.8
c. Save the settings and exit. See Figure 6-22. Repeat the previous step to
check whether the connection is successful.

Figure 6-22 Configuring DNS

Follow-up Operations
Register the HiLens Kit device. For details, see Registering a HiLens Kit Device.

6.3.5 Registering a HiLens Kit Device


Prerequisites
● Use a network cable to connect the PC and the device. For details, see
Connecting a HiLens Kit Device to a PC.
● Select either of the following network configuration modes:
– Wireless Network Configuration (SSH)
– Wired Network Configuration (SSH)
A router cannot be connected to a wired network and a wireless network at
the same time. If you connect the router to a wireless network, the default
gateway will be automatically deleted. If you connect the router to a wired
network again, you need to configure the default gateway. You are advised
to connect the router to a wireless network, in case you forget the device
IP address after updating it.

Procedure
1. Run the following command to remotely register the HiLens Kit device with
the Huawei HiLens console using SSH:
hdactl register -uUsername -dAccount name -nDevice name
Press Enter. The Password prompt is displayed.
Username is the IAM username, and Account name is the HUAWEI CLOUD
account name. For detailed concepts, see Basic Concepts of IAM. If no IAM
account is available, the Account name is the same as the Username.
Customize the Device name by yourself.
The username, account name, and device name used for registering a HiLens
Kit device can contain only letters, digits, and underscores (_). The names
cannot start with a digit or contain digits only.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 73


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

2. Enter the password of the HUAWEI CLOUD account after the Password
prompt and press Enter to complete the registration.
If the IAM user and HUAWEI CLOUD account are different, enter the IAM user
password following the Password prompt.
If an error message indicating that the device cannot be registered, restore
the device to factory settings and register it again.
NOTE

● IAM users are not allowed to register devices with sub-projects. For detailed
concepts, see IAM Basic Concepts.
● After the device is registered, you can log in to the Huawei HiLens console and
choose Device Management > Devices to view the device status. Your device is
offline for a short period of time.
3. Log in to the Huawei HiLens console. In the navigation pane, choose Device
Management > Devices to view the device status, as shown in Figure 6-23.

Figure 6-23 Device status

a. Wait 3 minutes. If the device is online, the device is restarted successfully.


b. Wait for 3 minutes. If the device is still offline, check whether the device
time is consistent with the current time. For details, see Device
Registration Failure.

Viewing the Registered Device on the Huawei HiLens Console


Log in to the Huawei HiLens console. In the navigation pane, choose Device
Management > Devices. All registered devices are displayed in the device list by
default. If you can view the device you registered and its status is Online, the
device registration is successful.
If the registration fails or the device is offline, rectify the fault by following the
instructions provided in HiLens Kit Registration Failed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 74


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-24 Device registration status

NOTICE

When you check the device registration status:


● If the device registration region is not changed, the CN North-Beijing4 region
is displayed by default. Ensure that the region is CN North-Beijing4 in the
upper left corner of the Huawei HiLens console.
● To perform operations in (Optional) Switching the Device Registration
Region to CN North-Beijing1, select CN North-Beijing1 in the upper left
corner of the Huawei HiLens console.

6.4 Configure Networking

6.4.1 Networking Configuration Modes


HiLens Kit devices can be connected to routers in wired or wireless mode. You can
select either mode to configure the network, or use both wired and wireless
modes to connect to an external network and the internal network of a company
or school.

● Scenario 1: Use a wireless network.


Configuring the Wireless Network
Wireless Network Configuration (SSH)
● Scenario 2: Use a wired network.
Configuring the Wired Network
Wired Network Configuration (SSH)

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 75


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

● Scenario 3: Use a wireless network to connect to an external network and a


wired network to connect to the internal network of a company or school.
Wireless Network (External Network) and Wired Network (Internal
Network)
NOTE

You are advised not to use a wireless network and a wired network to connect to the
same router at the same time. You are advised to use a wireless network to avoid
forgetting or losing the device IP address after updating it.

6.4.2 Wireless Network (External Network) and Wired


Network (Internal Network)
This section describes how to use a wireless network (Wi-Fi) to connect to an
external network and use a wired network to connect to the internal network of a
company or school.
Method 1: Configure the wireless network, and then configure the wired network.
Add the deleted default routing entries of the wireless network IP address.
Method 2: Configure the wired network, and then configure the wireless network.
Add the deleted default routing entries of the wired network IP address.
This section uses method 1 to describe how to configure networking using both
wireless and wired modes for a HiLens Kit device.

Preparations
1. Use a network cable to connect the HiLens Kit device to the local PC.
2. Enter https://XXX.XXX.XXX.XXX in the address box of a browser and press
Enter to open the login page of the HiLens intelligent edge system.
XXX.XXX.XXX.XXX is the default IP address of the device. For details about
the default parameters, see Default Parameters.
3. Enter the username and password. For details about the default parameters,
see Default Parameters.
4. Use the default IP address to log in to the HiLens Kit device using SSH and go
to the CLI with the administrator permission (develop). For details, see
Logging In to a HiLens Kit Device Using SSH.
If the IP address assigned to the internal network of a company or school
needs to be bound to the MAC address of the connected HiLens Kit device, fix
the MAC address of the wired network port (eth0) on the device.
a. Run the ifconfig command on the CLI with the administrator permission
to view the MAC address of the wired network port on the HiLens Kit
device.
As shown in Figure 6-25, the content in the red box is the target MAC
address.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 76


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-25 Viewing the MAC address

b. On the CLI with the administrator permission, open the vi /etc/rc.d/


rc.local file and add the following content to the file:
Ifconfig eth0 down
Ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx (xx:xx:xx:xx:xx:xx indicates the
MAC address.)
Ifconfig eth0 up
c. Restart the device for the modification to take effect.

Step 1: Configuring the Wireless Network


Use the wireless network to connect to the external network and dynamically
obtain the IP address of the wireless network. To connect to a router through a
wireless network, enter the network's password first.
● Procedure
For details about the requirements and procedure for configuring the wireless
network, see Wireless Network Configuration (SSH).
● Network Verification
a. On the CLI, run the ifconfig command to view the IP address of the
HiLens Kit device.
For example, in the following figure, the IP address of the wireless
network is 192.168.137.26, and wlan0 is the wireless network port.

Figure 6-26 Device IP address

b. Run the route command to check routing entries.


Assume that the wireless network IP address is 192.168.137.26 and the
allocated default gateway is 192.168.137.1.

Figure 6-27 Routing entry information

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 77


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

c. Run the following command to check whether the wireless network is


successfully connected:
ping www.huaweicloud.com
If the device is connected successfully, the following information is
displayed:

Figure 6-28 Wireless connection prompt

Step 2: Configuring the Wired Network


● Procedure
If you use a wired network to connect to the internal network of a company
or school, you need to add an internal network IP address on the wired
network port. If domain name resolution is required, configure the
corresponding DNS.
a. Enter https://XXX.XXX.XXX.XXX in the address box of a browser and
press Enter to open the login page of the HiLens intelligent edge system.
XXX.XXX.XXX.XXX is the default IP address of the device. For details
about the default parameters, see Default Parameters.
b. Enter the username and password. For details about the default
parameters, see Default Parameters.
c. Choose Management > Network > Wired Network.
The Wired Network page is displayed.

Figure 6-29 Wired network configuration

d. Under Configure IP Address, click Add. In the displayed dialog box, enter
the internal IP address information according to Table 6-9 and click OK.
e. Under Configure IP Address, click Save.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 78


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Table 6-9 New IP address parameters


Parameter Description

Function Usage of the IP address.


The value contains 1 to 32 characters, including
letters, digits, and underscores (_).

IP Address IPv4 address to be changed.


The IP address must be in the same network
segment as the router IP address.

Default Default gateway corresponding to the new IP


Gateway address.
NOTE
Ensure that the default gateway is globally unique.

Figure 6-30 Adding an IP address

f. Configure the DNS address for the internal network. The DNS
configuration method varies depending on whether the HiLens Kit system
firmware has been upgraded.

▪ The HiLens Kit system firmware has been upgraded.


The HiLens Kit system firmware version has been upgraded to
2.2.200.011. For details, see Upgrading the HiLens Kit System
Firmware Version. You can configure DNS as follows:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 79


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

1) On the Management > Network > Wired Network page of the


intelligent edge system, click Add under Configure DNS
Address.
The Add DNS Address dialog box is displayed.

Figure 6-31 Adding DNS address

2) In the dialog box that is displayed, enter the DNS address of the
internal network of a company or school, and click OK.
3) Under Configure DNS Address, click Save.

▪ The HiLens Kit system firmware has not been upgraded.


Remotely configure DNS using SSH.
Open the vi /etc/resolv.conf file in PuTTY and add the DNS address.
nameserver x.x.x.x (x.x.x.x indicates the newly added DNS address.)
Save the file and exit.
● Network Verification
a. Use the default IP address to log in to the HiLens Kit device using SSH.
For details, see Logging In to a HiLens Kit Device Using SSH.
b. Run the ifconfig command to view the IP address of the device.
For example, in the following figure, the IP address of the wired network
is 10.78.14.58, eth0 is the wired network port, and eth0:1 is the newly
added IP address.

Figure 6-32 Device IP address

c. Run the route command to check routing entries.


For example, if the IP address of the wired network is 10.78.14.58 and
the allocated default gateway is 192.168.137.1, the default routing

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 80


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

information corresponding to the IP address allocated in Step 1:


Configuring the Wireless Network is missing. As a result, the external
network cannot be accessed.

Figure 6-33 Routing entry information

Step 3: Adding Routing Entries


Manually add the default routing entries corresponding to the IP address allocated
in Step 1: Configuring the Wireless Network.

● Procedure
a. Use the default IP address to log in to the HiLens Kit device through SSH
and go to the CLI with the administrator permission (develop). For
details, see Logging In to a HiLens Kit Device Using SSH.
b. Run the corresponding command on the CLI to add the default routing
entries.
For example, the default gateway corresponding to the IP address
allocated in Step 1: Configuring the Wireless Network is
192.168.137.1.
route add default gw 192.168.137.1
c. Remove the network cable from the PC and disconnect the network
between the PC and HiLens Kit device. Then, use the network cable to
connect the HiLens Kit device to the internal network.
● Network Verification
a. On the PC in the internal network, use the new internal network IP
address (10.78.14.58 in this example) to log in to the HiLens Kit device
through SSH. For details, see Logging In to a HiLens Kit Device Using
SSH.
b. Run the ping command to check whether the wired network (external
network) and wireless network (internal network) are successfully
connected.
If the device is connected successfully, the following information is
displayed:

Figure 6-34 Wired connection prompt

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 81


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

Figure 6-35 Wireless connection prompt

6.5 Configuring a Firewall


To prevent users beyond the allowed IP address range from accessing the HiLens
Kit intelligent edge system, you can remotely configure a firewall through SSH to
prevent the system from being attacked.

Configuration Mode
● Configure a hardware firewall.
If a hardware firewall exists, contact O&M personnel to configure it to allow
access to the IP addresses of HiLens Kit devices.
● Configure a software firewall.
If no hardware firewall is deployed, configure a software firewall. For details,
see Configuring a Software Firewall.

Configuring a Software Firewall


1. Connect your HiLens Kit device to your PC using a network cable and log in to
the device in SSH mode. For detailed operations, see Connecting a HiLens Kit
Device to a PC.
2. Run the following command on PuTTY:
iptables -I INPUT -p tcp --dport 443 -j DROP
Disable all users to access the HiLens Kit intelligent edge system through port
443.
3. Configure the IP addresses that are allowed to access the HiLens Kit
intelligent edge system through port 443 as required.
– Run the following command on PuTTY to configure the IP address of a
HiLens Kit device to access the HiLens Kit intelligent edge system
(assume that the device IP address is 192.168.2.111):
iptables -I INPUT -s 192.168.2.111 -p tcp --dport 443 -j ACCEPT
– Run the following command on PuTTY to configure one IP address to
access the HiLens Kit intelligent edge system (assume that the allowed IP
address is 10.61.120.127):
iptables -I INPUT -s 10.61.120.127 -p tcp --dport 443 -j ACCEPT
– Run the following command on PuTTY to configure a network segment
to access the HiLens Kit intelligent edge system (assume that the
network segment is 10.61.120.*, where * is an integer from 0 to 255):
iptables -I INPUT -s 10.61.120.0/24 -p tcp --dport 443 -j ACCEPT
4. Go to the /home/data/user directory on PuTTY and write the configuration
commands in step 2 and step 3 to the user_init.sh file to prevent the
configurations in step 2 and step 3 from becoming invalid after the HiLens Kit
device is restarted.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 82


Huawei HiLens
User Guide 6 Registering HiLens Kit Devices

If the user_init.sh file does not exist in the /home/data/user directory, create
one.

6.6 Using an SD Card


HiLens Kit is multi-modal AI development suite featuring device-cloud synergy. It
generates video and image data during use. Generally, data is stored in OBS
through APIs. To store data locally, an external SD card is required because the
disk space of HiLens Kit devices is limited.

Procedure
1. Insert an SD card into the port (Micro SD) on the rear panel of the HiLens Kit
device.
2. Log in to the HiLens Kit device using SSH. For details, see Logging In to a
HiLens Kit Device Using SSH.
3. Run the following command to locate the SD card:
ls -al /dev/mmcblk*
The command output is as follows:
dev/mmcblk1
4. Run the following command to save and back up the data stored in the SD
card and format the SD card.
mkfs.ext4 /dev/mmcblk1
Run the command at the EulerOS prompt.
If the SD card has been formatted, skip this step.
5. Run the following command to create the sd path:
mkdir /mnt/sd
The device is mounted to the mount /dev/ mmcblk1/mnt/sd path.
6. Run the df command to query the file system.
Run the following commands to perform a read/write test on the local file
mount /dev/ mmcblk1/mnt/sd:
– Write command: cp test.txt /mnt/sd
– Read command: cp /mnt/sd/test.txt ./

NOTE

Before removing the SD card, run the following command to unmount the partition from
the device:
umount /mnt/sd
This prevents files from being damaged.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 83


Huawei HiLens
User Guide 7 Managing Devices

7 Managing Devices

7.1 Device Management Overview


The platform supports registration, management, and deregistration of HiLens Kit
devices and Atlas 500 AI edge stations. Manufacturers can use the Huawei HiLens
console to manage devices that run HiSilicon Hi35xx series chips in batches and
deploy AI capabilities onto them. For details, see Overview. The following
operations apply only to HiLens Kit devices.

Before managing the devices, you need to register devices on the Huawei HiLens
console. For detailed descriptions and connection guides, see Registering HiLens
Kit Devices.

Device Management Operations


● Activating Devices (Purchasing HiLens Device-Edge-Cloud Synergy
Platform Service): If you register more than one device, you need to
purchase the HiLens Device-Edge-Cloud Synergy Platform Service. After you
activate the devices on the Device Management page, you can install basic
skills you developed onto these devices.
● Managing Skills on Devices: Install skills, configure runtime parameters, and
start, stop, or uninstall skills on registered devices.
● Viewing Device Information: Check the basic information or upgrade status
of a device.
● Viewing Device Logs: After using a HiLens skill, you can view the device
agent logs and skill logs.
● Upgrading HiLens_Device_Agent Firmware: Upgrade the firmware version
when a new version is available.
● Configuring Cameras: Connect more IP cameras to a registered device and
manage them.
● Deregistering Devices: Deregister a device to release resources when the
device is no longer used.
● Viewing Device Alarms: You can check the device's alarm information on the
Huawei HiLens console and handle the alarm on the device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 84


Huawei HiLens
User Guide 7 Managing Devices

● Viewing Device Data: In the navigation pane of the Huawei HiLens console,
click Data Management. On the Data Management page that is displayed,
you can select a device to download and view all of its data.

7.2 Activating Devices (Purchasing HiLens Device-Edge-


Cloud Synergy Platform Service)
If you register more than one device, you need to purchase the HiLens Device-
Edge-Cloud Synergy Platform Service. After you activate the devices on the Device
Management page, you can install the basic skills developed on the console or in
HiLens Studio onto these devices.

NOTE

For the first registered device, you do not need to purchase the HiLens Device-Edge-Cloud
Synergy Platform Service and activate this device. You can directly install the basic skills you
developed onto this device.

Activation Method
● 30-day free trial
If you have more than one device, the platform service is free of charge
permanently for the first registered device, and other devices can enjoy a 30-
day free trial. For details, see 30-Day Free Trial Activation.
● Activation using the order number
To activate your device, purchase the HiLens Device-Edge-Cloud Synergy
Platform Service and activate the device within the validity period of the
order. The activation lasts as long as the validity period of your order. Read
Notes on Order-based Activation carefully before activating your device.
If the order is purchased by yourself, activate your device using the order
number of your own account. For details, see Activating Devices Using Your
Own Order Number.
If the order is purchased by another subscriber, activate your device using the
order number of that subscriber's account. To do so, use that subscriber's
account to transfer the device activation quota to your account and then use
your account to activate the device. For details, see Activating Devices Using
Other Subscriber's Order Number .
● Activation using a test device
Only HiLens Kit devices support this option. For details, see Activating
Devices Using a Test Device. For test devices that are not purchased from
the HUAWEI CLOUD official website, you can choose to activate them using
their SNs.

Notes on Order-based Activation


● Your devices must be activated before the HiLens Device-Edge-Cloud Synergy
Platform Service you purchased expires. Otherwise, your devices cannot be
activated.
● For devices that have been registered and then activated, they will always
remain activated until they are deregistered. If devices are deregistered and
then registered again, they will need to be activated again.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 85


Huawei HiLens
User Guide 7 Managing Devices

● After being activated for the first time, your devices can be activated as many
times as you want until the platform service in yearly/monthly billing mode
expires. That is, no matter how many times you activate your devices, you can
install the skills you developed onto the devices within the period starting
from the first time your devices are activated and ending at the time the
platform service in year/monthly billing mode expires.
● Your devices must be activated before the platform service order expires.
Otherwise, the activation fails.
● If you cannot install the skills you developed onto devices because the
platform service expires, purchase a new HiLens Device-Edge-Cloud Synergy
Platform Service and activate your devices again.

30-Day Free Trial Activation


1. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Device Management > Devices.
The Devices page is displayed.
2. Select a device whose Basic skill permission is Unactivated and click
Activate Permission.
The Activate Permission dialog box is displayed.
3. Select 30-day free trial and click Next.
4. Confirm the trial information, including the first activation time, trial period,
and expiry time, and click OK.

Activating Devices Using Your Own Order Number


Before using the order number to activate a device, you need to purchase the
HiLens Device-Edge-Cloud Synergy Platform Service. For details, see Subscribing
to HiLens Device-Edge-Cloud Synergy Platform Service.

1. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Device Management > Devices.
The Devices page is displayed.
2. Select a device whose Basic skill permission is Unactivated and click
Activate Permission.
The Activate Permission dialog box is displayed.
3. Select Activate using order No and choose an order number that will be
used to activate devices.
Select Purchase by me from the drop-down list next to Order ID and select
the order number of the platform service you purchased from the second
drop-down list.
If you have not purchased the platform service yet, click Buy to go to the Buy
Huawei HiLens Product page, and buy the service. For details, see
Subscribing to HiLens Device-Edge-Cloud Synergy Platform Service.
4. Click Next and confirm the order ID and order information.
5. Click OK to activate the basic skill permission of the device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 86


Huawei HiLens
User Guide 7 Managing Devices

Activating Devices Using Other Subscriber's Order Number


If you want to use another subscriber's order number to activate your devices, log
in to the Huawei HiLens console using that subscriber's account, transfer the
activation permission to your account, and activate the devices using your
account.

● Step 1: Transfer the activation quota.


a. Log in to the Huawei HiLens console using that subscriber's account. In
the navigation pane on the left, choose Product Subscription > Order
Management.
The My Skills page is displayed.
b. Click Platform Service tab.
c. Select the order to be transferred, click Operation in the Operation
column to expand the drop-down list, and click Transfer Activation
Quota.
The Transfer Activation Quota dialog box is displayed.
d. Click Edit in the Operation column, set parameters by referring to Table
7-1, and click Save in the Operation column.

Table 7-1 Parameters for activation quota transfer

Parameter Description

Account ID Account ID to which the device activation quota is


transferred.
Click the username in the upper right corner of the
console and choose My Credentials to obtain the
account ID, as shown in Figure 7-1.

User ID User ID to which the device activation quota is


transferred.
Click the username in the upper right corner of the
console and choose My Credentials to obtain the user
ID, as shown in Figure 7-1.

Remaining How many devices can be activated using the quota you
Quota are transferring. The device activation quota of the
current order cannot exceed the total activatable
devices.

Figure 7-1 My Credentials

e. Click OK.
The device activation quota is transferred.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 87


Huawei HiLens
User Guide 7 Managing Devices

● Step 2: Activate devices.


a. Log in to the Huawei HiLens console using your account. In the
navigation pane on the left, choose Device Management > Devices.
The Devices page is displayed.
b. Select a device whose Basic skill permission is Unactivated and click
Activate Permission.
The Activate Permission dialog box is displayed.
c. Select Activate using order No and choose an order number that will be
used to activate devices.
Select Purchase by others from the drop-down list next to Order ID and
select the order whose device activation quota is transferred.
If you have not purchased the platform service yet, click Buy to go to the
Buy Huawei HiLens Product page, and buy the service. For details, see
Subscribing to HiLens Device-Edge-Cloud Synergy Platform Service.
d. Click Next and confirm the order ID and order information.
e. Click OK to activate the basic skill permission of the device.

Activating Devices Using a Test Device


1. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Device Management > Devices.
The Devices page is displayed.
2. Select a device whose Basic skill permission is Unactivated and click
Activate Permission.
The Activate Permission dialog box is displayed.
3. Select Activate using test device and enter the Device SN.
The SN, usually attached to the bottom of the device, is a unique device
identifier with 20 characters, for example, 210xxxxxxxxxxxxxxxxx.
4. Click Next to confirm the Device SN and SN Info.
5. Click OK to activate the basic skill permission of the device.

7.3 Managing Skills on Devices

7.3.1 Skill Management Overview


For registered devices that are displayed as Online, you can manage their skills on
the Huawei HiLens platform, including installing new skills, adding runtime
configurations, and starting, stopping, and uninstalling skills.

Skill
A skill is an AI application ready to run on a camera or another computing device.
It consists of a model and logic code. The logic code is the skill's framework, and is
responsible for controlling skill running, including data reading, model import,
model inference, and result output. The model is trained by AI algorithms based
on big data and is responsible for inference in key scenarios during skill running.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 88


Huawei HiLens
User Guide 7 Managing Devices

The Skill Market of Huawei HiLens provides extensive skills for users.

● The application scenarios for Huawei HiLens skills include smart campus,
smart home, smart vehicle-mounted terminals, smart shopping mall, and
more.
● Skills are classified into two types by device: skills for Ascend chips and skills
for HiSilicon Hi35xx series chips.

Figure 7-2 Chip

Before You Start


● A maximum of five skills can be installed on a device.
● No skill information is displayed on the skill management page of a newly
registered device. You need to install new skills before using the device.
● The Huawei HiLens console can manage only HiLens Kit devices. Therefore,
only skills oriented to Ascend chips can be managed here.
● You can purchase, customize, and install skills on devices from the Skill
Market.
● You can also develop skills on the Huawei HiLens console or in HiLens
Studio.
● In the device list, click the device card to enter the device details page. The
Skill Management page is displayed by default, on which you can view the
skills installed on the device. The skill statuses include Installing, Faulty,
Stopped, and Running.

Supported Operations
Go to the Skill Management page: In the navigation pane of the Huawei HiLens
console, choose Device Management > Devices. In the device list, select the
device to be managed and click the device card. The device details page displays
the Skill Management tab by default.

On the Skill Management tab, you can view the information about skills installed
on the device. If the skill is in container image format, you can click on the left
of the skill name to view the status of each instance of the skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 89


Huawei HiLens
User Guide 7 Managing Devices

● Installing a Skill
● Adding Runtime Configurations
● Starting or Stopping Skills
● Uninstalling Skills
● View skill run logs on the device: On the Skill Management tab page,
choose More > View Log in the row of the target skill to go to the Data
Management page and view the real-time or historical running data of the
skill. For details, see Managing Data.
● Configure a subscription message for a skill: On the Skill Management
tab, choose More > View Skill Message to switch to the Skill Messages tab,
where you can directly configure a subscription object for the skill. For details,
see Subscribing to Skill Messages.

7.3.2 Installing a Skill


You can purchase required skills from the skill market and install them onto your
devices to enable the devices with AI capabilities.

Prerequisites
● At least one device exists on the Device Management > Devices page and
the device status is Online.
● At least one skill exists on the Subscription > Order Management > Skill
Orders or AI Gallery page. If you have not purchased any skills, no
information is displayed on this page. You are advised to purchase skills or
subscribe to them by referring to Subscribing to Skills from the ModelArts
AI Gallery.
● If the skills in Subscription > Order Management > Skill Orders do not
meet your requirements, you can go to Subscription > All Skills to purchase
other required skills or go to Subscription > Order Management > Custom
Skills to customize skills.

Procedure
1. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. In the device list, click the target device card.
The Skill Management page is displayed by default.
2. On the Skill Management page, click Add Skill in the upper right corner to
switch to the Skill Market > My Skills page.
3. By default, the Orders from Skill Market page is displayed, showing the list
of skills purchased by your account from the HiLens Skill Market.
You can also click Orders from AI Gallery to switch to the Orders from AI
Gallery page to display the list of skills purchased by your account from the
ModelArts AI Gallery.
4. Select the skill to be installed.
– On the My Orders page: Click Install in the Operation column of the
skill list.
– On the AI Gallery page: Click on the left of the target skill name to
view the skill information, and click Install.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 90


Huawei HiLens
User Guide 7 Managing Devices

NOTE

Only skills (with sufficient quota) oriented to Ascend 310 chips can be selected.
5. In the skill installation dialog box that is displayed, select the device to which
the skill is to be installed. In the Specifications column, specify the number of
channels used by the skill on each device. If you want to install the skill on
multiple devices, select Yes in the Batch Installation column as required.
Then, click Install.
6. Perform the following operations to check whether the skill is installed
properly. If the skill status is Installation succeeded, the skill is successfully
installed on each device.
a. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. The device list page is displayed.
b. Click Skill Management of the registered device. The status of the
installed skill is Stopped. Click Start in the Operation column and click
OK to start the skill on the device.
The skill status changes to Running after a short period of time,
indicating that the skill is successfully running on the device.
Table 7-2 describes the skill statuses.

Figure 7-3 Viewing skill status

Table 7-2 Skill installation statuses

Status Description

Stopped The skill stops running on the device.

Running The skill is running on the device.

7.3.3 Adding Runtime Configurations


You may need to configure related parameters for some running skills. For
example, upload a facial image library to the facial recognition skill.

Context
● You can add and modify configurations of skills whose developers have
configured the runtime configuration function for them.
● Runtime Configurations are classified into Global and Video configurations.
– The Global configuration takes effect for the entire device.
– The Video configuration indicates a camera-channel configuration,
requiring the skill to process multi-channel videos. For example, if a facial
image library is configured for each camera, the facial recognition skill
can perform recognition on multiple channels of videos.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 91


Huawei HiLens
User Guide 7 Managing Devices

Adding Runtime Configurations


1. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. In the device list, click the target device card.
The Skill Management page is displayed by default.
2. On the Skill Management page, click the target skill card.
The skill details page is displayed.
3. On the Skill Management page, click Runtime Configurations in the
Operation column.
4. In the dialog box that is displayed, set the runtime configuration parameters.
You can click next to each parameter to view its details.
The parameters are classified into Global and Video configurations. The
Global configuration takes effect for the entire device. The Video
configuration indicates a camera-channel configuration, requiring the skill to
process multi-channel videos. For example, if a facial image library is
configured for each camera, the facial recognition skill can perform
recognition on multiple channels of videos.

7.3.4 Subscribing to Skill Messages


After you subscribe to messages for a specified skill, the subscription object
(recipient) will receive an email or SMS notification when the skill has any output.
For example, assume that a skill has the function of detecting strangers and
sending messages, that is, the skill's Product Description on the skill details page
contains "This skill supports notification messages". Then, after you install the skill
and subscribe to a message topic (Configuring Subscription Objects), the
configured subscription object will receive an email or SMS notification when the
device detects a stranger.

Precautions
● When subscribing to a message for the first time, restart the skill so that the
subscription object can receive the message. For details about how to restart
the skill, see Starting or Stopping Skills.
● Message subscription incurs certain fees. For details, see Simple Message
Notification Pricing Details.

Prerequisites
● The skill supports the message notification function. This function is
configured during skill development. For details about the guide and APIs, see
the Huawei HiLens Developer Guide.
If the message notification function is not configured for a skill, common
users cannot receive notification messages from the skill.
● The skill has been deployed on a device and is in the Running state. Users
cannot receive notification messages from a skill not in the Running state.

Configuring Subscription Objects


A subscription object is the recipient of notification messages. When the device
detects a specified scenario (for example, a stranger detection skill installed on the

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 92


Huawei HiLens
User Guide 7 Managing Devices

device detects a stranger), the subscription object can receive a notification


message.
1. Log in to the Huawei HiLens console, choose Device Management > Devices
in the navigation pane. The device list page is displayed.
2. Click the card of the device where the skill is installed. The Skill Management
page is displayed by default.
3. Click the name of the skill for which you want to configure a subscription
object. The skill details page is displayed.
4. Click the Skill Messages tab.

Figure 7-4 Skill message

5. Set the Current Skill Topic.


– To add a new topic:
i. Click on the right of Existing Topics. In the text box that is
displayed, enter a topic name, which contains a maximum of 255
characters, starting with a letter or digit. Only letters, digits,
underscores (_), and hyphens (-) are allowed. Then, click .
ii. Click on the right of the topic. In the dialog box that is displayed,
click OK to confirm the skill topic setting.
– To add an existing topic:
Click on the right of an existing topic. In the dialog box that is
displayed, click OK to confirm the skill topic setting.
6. Click Back to Skill Messages in the upper right corner of the Skill Messages
tab to configure the message recipient of the current skill topic.
7. Click on the right of the subscription list. The Message Management
dialog box is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 93


Huawei HiLens
User Guide 7 Managing Devices

Figure 7-5 Message recipients

8. Edit the message recipients of the current topic as follows:


– To add a new recipient:
Click Add Message Recipient and enter recipient information in the text
boxes that are displayed. For details about the parameters, see Table 7-3.
Confirm the information and click .
– To edit an existing recipient:
Click on the right of a message recipient and re-enter the recipient
information in the text boxes. For details about the parameters, see Table
7-3. Confirm the information and click .

Table 7-3 Message recipient parameters

Parameter Description

Recipient Name of the subscription object

Receiving Mode Message receiving mode. The options are Email and
Text message.

Mobile Number/ Mobile number or email address used for receiving


Email Address messages

You can click Set to Default to set the default recipient for quick subscription.
(You can click on the right of the subscription list in step 4 to perform
quick subscription.)
9. Click to select the recipient who subscribes to the skill, and click OK.
The subscription list is displayed. You can view the added recipient.
To add multiple message recipients, go to step 7.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 94


Huawei HiLens
User Guide 7 Managing Devices

Figure 7-6 Subscription list

10. After the message recipient is added, the recipient will receive a text message
or email. Click Confirm Subscription.
The subscription is successful if you receive a feedback indicating successful
subscription.

Figure 7-7 Confirming the subscription

After the recipient confirms the subscription, you need to restart the skill, so
that the recipient will receive an email or SMS notification when the skill has
any output.
In the subscription list, the recipient icon changes from gray to orange .
NOTE

● The QQ mailbox intercepts notification messages. If the recipient is a QQ mailbox


address, you need to add the service to the whitelist. The procedure is as follows:
1. Log in to the QQ mailbox.
2. Choose Settings > Spam.
3. In the Whitelist column, click Set Email Whitelist.
4. Enter system@info.huaweicloud.com and click Add to whitelist.
● Currently, messages sent to Google mailbox, Microsoft series mailboxes, and
NetEase series mailboxes will not be intercepted.

7.3.5 Configuring Hard Example Settings


Some skills can collect hard examples. You need to set the hard example
parameters before running the skills.

Prerequisites
● The skill supports hard example upload.
● You have created a hard example dataset on ModelArts to train the hard
example filtering model. For details, see Creating a Dataset.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 95


Huawei HiLens
User Guide 7 Managing Devices

Setting Hard Examples


1. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. In the device list, click the target device card.
The Skill Management page is displayed by default.
2. On the Skill Management page, locate the target skill and choose Runtime
Configurations in the Operation column.
3. Click Hard Example Settings and enter related information.

Table 7-4 Hard example settings

Parameter Description

Model Name Name of a hard example filtering


model. You do not need to set this
parameter.

Model Type Type of the hard example filtering


model, such as image classification
and object detection. You do not
need to set this parameter.

Camera Hard example data of the specified


camera to be uploaded

Output Dataset Dataset for training the hard


example filtering model. You need to
create a hard example dataset on
ModelArts in advance. For details,
see Creating a Dataset.

Total Sample Size Number of samples in the output


dataset

Progress Total volume of uploaded hard


example data

Parameter Settings Parameter values to be set for the


hard example filtering model. Click
on the left of the model name
and set Value in Parameter
Settings. You can click on the
right of the parameter name to view
the parameter description. See
Figure 7-8.

Figure 7-8 Hard example settings

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 96


Huawei HiLens
User Guide 7 Managing Devices

4. After the configuration is complete, click Execute Configuration in the upper


right corner.

7.3.6 Starting or Stopping Skills


You can start or stop skills on a device as required. After a skill is started
successfully on a device, its status becomes Running, indicating that the skill has
been used by the device. After a skill is stopped successfully on a device, its status
becomes Stopped.

Before Your Start


● You can Start skills in the Stopped status.
● You can stop Running skills and uninstall Faulty or Stopped skills.
● After installing a skill, you need to start the skill so that it can run on the
device. For details, see Starting a Skill.

Starting a Skill
On the Skill Management tab page, select a skill whose status is Stopped, and
click Start in the Operation column. Skill startup involves a command delivery
process, so you need to wait for a period of time before you can view the skill
status update on the page.

Stopping a Skill
On the Skill Management tab page, select a skill whose status is Running, and
click Stop in the Operation column. Skill stop involves a command delivery
process, so you need to wait for a period of time before you can view the skill
status update on the page.

7.3.7 Uninstalling Skills


If a skill is no longer needed, you can uninstall it on the Huawei HiLens console.

Before Your Start


● You can uninstall skills only from devices in the Online (Running) status. You
cannot uninstall skills from offline devices.
● Uninstalling a skill will delete the skill and skill data on the device. Exercise
caution when performing this operation.

Uninstalling a Skill
1. On the Skill Management tab page, select the target skill and click Uninstall
in the Operation column.
2. In the dialog box that is displayed, confirm the information about the skill to
be uninstalled and click OK.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 97


Huawei HiLens
User Guide 7 Managing Devices

7.4 Viewing Device Information


On the device list page, you can view the basic information about or the upgrade
status of a registered device.

Viewing Basic Device Information


The Device Management > HiLens Kit List page displays basic information about
each device, as shown in Figure 7-9.

Figure 7-9 Device card

Click the name on a device card to enter the device details page, as shown in
Figure 7-10. You can view the device details and manage the device on this page,
including managing skills and cameras, and upgrading firmware.

Figure 7-10 Device details page

7.5 Viewing Device Logs


After running a HiLens skill, you can view the device agent logs and skill logs.

Query Methods
● Viewing Logs Using SSH: Connect to the HiLens Kit device using SSH and
view the logs.
● Logging In to the Intelligent Edge System to Download Logs: After the
firmware is upgraded to version 1.0.4 or later, you can also log in to Huawei
HiLens intelligent edge system to download and view logs.
● Managing Data: On the Data Management (Beta) page of the Huawei
HiLens console, you can download and view skill running logs of each device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 98


Huawei HiLens
User Guide 7 Managing Devices

Viewing Logs Using SSH


1. Connect to a HiLens Kit device using SSH. For details, see Connecting a
HiLens Kit Device to a PC.
2. Run corresponding commands to view logs based on the firmware version.
– Firmware versions earlier than 1.0.4 (excluding 1.0.4):

▪ Run the following command to check the device agent log:


tail -f /home/hilens/hda/log/hdad.log

▪ Run the following command to view the skills log:


tail -f /home/hilens/hda/log/developer.skill name.skill ID.log
– Firmware 1.0.4 to 1.1.1:

▪ Run the following command to view the device agent log:


tail -f /home/log/alog/hilens/hda/hdad.log

▪ Run the following command to view the skills log:


tail -f /home/log/alog/hilens/hda/developer.skill name.skill ID.log
– Firmware 1.1.2 or later:

▪ Run the following command to view the device agent log:


tail -f /home/log/alog/hilens/hda/hdad.log

▪ Run the following command to view the skills log:


tail -f /home/log/alog/hilens/skills/developer.skill name.skill ID/
developer.skill name.skill ID.log
NOTE

To ensure that your device can run newer and better skills, you are advised to upgrade
its firmware in a timely manner. For details about how to upgrade the firmware, see
Upgrading HiLens_Device_Agent Firmware.

Logging In to the Intelligent Edge System to Download Logs


This operation applies only to firmware 1.0.4 and later versions. You are advised to
upgrade the firmware in a timely manner. For details, see Upgrading
HiLens_Device_Agent Firmware.
1. Connect your HiLens Kit device to your PC using a network cable in SSH
mode. For detailed operations, see Connecting a HiLens Kit Device to a PC.
2. Enter https://192.168.2.111 (assume that the device IP address is
192.168.2.111) in the address box of a browser. You are advised to use Google
Chrome or Internet Explorer 11 or later.
– Use the default account admin and preset password to log in to the
Huawei HiLens intelligent edge system for the first time. For details
about the default parameters, see HiLens Kit User Guide > Default
Credentials.
– If this is not your first login, use your new account name and password.
For details about how to change the password, see Changing the Initial
User Name and Password.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 99


Huawei HiLens
User Guide 7 Managing Devices

3. Click Maintenance.
4. Click Log Collection to go to the Log Collection page.
5. Click Collect. In the dialog box that is displayed, click OK to download and
decompress the log package to your PC. The default package name is
Euler_Atlas500Log_2.2.0.031_2019***.
The device agent log path is as follows:
Euler_Atlas500Log_2.2.0.031_2019***\log\NPU\home\log\alog\hilens\hda
\hdad.log
The skill log path is as follows:
Euler_Atlas500Log_2.2.0.031_2019***\log\NPU\home\log\alog\hilens\hda
\developer.skill name.skill ID.log
For firmware 1.1.2 or later, the skill log path is as follows:
Euler_Atlas500Log_2.2.0.031_2019***\log\NPU\home\log\alog\hilens\skills
\developer.skill name.skill ID\developer.skill name.skill ID.log

7.6 Upgrading HiLens_Device_Agent Firmware


If the device manufacturer pushes a new firmware version, you can upgrade the
HiLens Framework version on the Huawei HiLens console. As services keep
evolving, engineers will continuously upgrade the HiLens Framework versions. To
ensure that your device can run newer and better skills, you are advised to
upgrade its firmware in a timely manner.

Before You Start


● You can only upgrade firmware for Online devices.
● In the HiLens Kit list, if Firmware Version of a device is Upgradable, the
firmware of a later version exists. You can upgrade it.
● When the firmware is being upgraded, you cannot perform other operations
on the device.

Figure 7-11 Prerequisites for upgrading firmware

Upgrading Firmware
1. In the navigation pane, choose Device Management > Devices.
2. Click Batch Upgrade Firmware in the upper right corner. The Batch Upgrade
Firmware dialog box is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 100


Huawei HiLens
User Guide 7 Managing Devices

3. Select the firmware name and target firmware version. The devices that can
be upgraded are displayed, including the device name, device type, firmware
name, and firmware version.

Figure 7-12 Batch Upgrade Firmware

4. Select the device to be upgraded and click OK.


During the upgrade, you can view the firmware version and upgrade progress
on the device details page, as shown in Figure 7-13. If the version Status
displays Upgrade succeeded, the firmware is successfully upgraded.

Figure 7-13 Firmware version and status

7.7 Configuring Cameras


A HiLens Kit device has a built-in camera and can connect to and manage
multiple IP cameras (the number of cameras cannot be greater than the total
number of channels supported by the skills installed on the device).

NOTE

● Built-in HiLens Kit cameras do not support night vision.


● HiLens Kit can connect to IP cameras of 4K or lower resolution, but cannot connect to
thermographic cameras.

Adding a Camera
1. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. In the device list, click the name of the target device
to enter the device details page.
2. Click Camera Management to switch to the Camera Management tab on
the device details page.
3. Click Add Camera in the upper right corner. In the displayed dialog box, enter
related information.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 101


Huawei HiLens
User Guide 7 Managing Devices

Figure 7-14 Adding a camera

Table 7-5 Camera configurations


Parameter Description

Name Name of a camera, which is used for identification. This


parameter is user-defined.

User Name Username for logging in to the IP camera. You can


obtain it from the camera's user manual.

Password Password for logging in to the IP camera.

Protocol Protocol used by the camera to transmit videos. The


default value is rtsp and cannot be changed.

Path URL for accessing videos shot by the camera, for


example, 192.168.0.1/root. Obtain it from the user
guide of the camera.

4. After entering and confirming the information, click OK to add the camera
and deliver the configurations to the device. A row of camera information is
added on the Camera Management page.

Editing Camera Information


You can edit information for cameras that have been added to a device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 102


Huawei HiLens
User Guide 7 Managing Devices

1. In the navigation pane of the Huawei HiLens console, choose Device


Management > Devices. In the device list, click the name of the target device
to enter the device details page.
2. Click Camera Management to switch to the Camera Management tab page
on the device details page.
3. Locate the target camera and click Edit in the Operation column. Then
modify the camera information and click Execute Configuration.
Only User Name, Password, Protocol, and Path can be modified. Once the
Name is determined, it cannot be changed.

Deleting a Camera
You can delete unnecessary cameras that have been added to a device.

1. In the navigation pane of the Huawei HiLens console, choose Device


Management > Devices. In the device list, click the name of the target device
to enter the device details page.
2. Click Camera Management to switch to the Camera Management tab on
the device details page.
3. Locate the target camera, click Delete in the Operation column, and click
OK.

NOTE

Deleted cameras cannot be recovered. Exercise caution when performing this operation.

7.8 Deregistering Devices


After a device is deregistered, it is unbound from the cloud-based Huawei HiLens.
The Huawei HiLens console removes the corresponding device records and loses
control over the device.

The device can be registered with Huawei HiLens under a new account only after
it is deregistered from the current account.

Prerequisites
If the device to be deregistered has been activated, unbind the device before you
deregister it.

In the navigation pane of the Huawei HiLens console, choose Device


Management > Devices, click Activate Permission on card of the target device,
and unbind the device as prompted.

Deregistering a Device
1. In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. The device list page is displayed.
2. Select a device and choose Operation > Deregister.
You can also click the device name on a device card to go to the device details
page and click Deregister Device in the upper right corner.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 103


Huawei HiLens
User Guide 7 Managing Devices

3. In the dialog box that is displayed, confirm the information about the device
to be deregistered, and click OK.
After a device is deregistered, the skills deployed on it are uninstalled at the
same time.
NOTE

Before deregistering a device, you need to uninstall its skills purchased from the skill
market. If you deregister a device without uninstalling the skills installed in the skill
market, the skills and logs will be deleted when the device is registered again.

7.9 Viewing Device Alarms


When a device is faulty or works abnormally due to certain reasons, Huawei
HiLens generates alarms based on the faults of different modules. You can view
the device's hardware alarm information on the Huawei HiLens console and
handle the alarm on the device.
Huawei HiLens can also monitor services. You can configure alarm receiving
settings. When skills on a device cannot run properly, Huawei HiLens sends
service alarms to you in real time.

NOTE

● The alarm function is available only on devices whose firmware version is 1.0.7 or later.
The alarm notification function is available only on devices whose firmware version is
1.0.0 or later. For details about how to upgrade the firmware, see Upgrading
HiLens_Device_Agent Firmware.
● The alarm information of a device can be synchronized to the Huawei HiLens console
only when the device is Online.

Alarm Severity
● Minor
A minor alarm has a minor impact on the system, but you need to take
corrective actions as soon as possible to prevent a more severe alarm.
● Major
A major alarm has a major impact on the system. It affects the normal
operating of the system or may cause service interruption.
● Critical
A critical alarm may power off the device, and even interrupt system services.
You must take corrective actions immediately.

Procedure for Viewing Alarms


In the navigation pane of the Huawei HiLens console, choose Device
Management > Devices. On the card of the device where an alarm is generated,
click Device Alarms to enter the corresponding tab page.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 104


Huawei HiLens
User Guide 7 Managing Devices

Figure 7-15 Device alarms

You can view the alarm information in the device's alarm list and handle the
alarm on the device. The alarm information includes the alarm Title, Severity,
Content, Impaction, Suggestion, Generated At, and Operation. Device alarms
have three severity levels: Minor, Major, and Critical. For details, see Alarm
Severity.

Figure 7-16 Device alarm list

After you handle the alarm on the device, the alarm will be automatically cleared
if no exception is detected on the device.

Configuring Alarm Receiving Settings


1. Log in to the Huawei HiLens console, choose Device Management > Devices
in the navigation pane. The device list page is displayed.
2. Click Device Alarms. On the right of the Device Alarms page, click Configure
Alarm Receiving Settings.
3. In the Alarm Settings area, select service alarms that can be received in real
time, and specify Alarm Window and Alarm Frequency.
– Alarm Window is the period during which alarms can be sent to
subscribers.
– Alarm Frequency is the maximum number of times alarms can be sent
to subscribers during the specified period. For example, if the alarm
frequency is set to 3 times per Day, the maximum number of the alarms
can be sent to you per day is 3.
Click on the left of a service alarm to view the alarm description and
impact.
Hardware alarms cannot be received in real time.
4. Click Save in the upper right corner of the Device Alarms tab page.
5. Click on the right of Subscription list, select a subscription type (text
message or email), enter the communication mode (mobile number or email
address), and set the alarm recipient.
6. Confirm the information and click .

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 105


Huawei HiLens
User Guide 7 Managing Devices

7. After the message recipient is added, the recipient will receive a text message
or email. Click Confirm Subscription.
The service alarm subscription is successful if you receive a feedback
indicating successful subscription.

Deleting an Alarm
You can delete alarms based on actual conditions.

1. In the navigation pane of the Huawei HiLens console, choose Device


Management > Devices. On the card of the device where an alarm is
generated, click Device Alarms to enter the corresponding tab page.
2. In the alarm list, click Delete in the Operation column of a processed alarm.
The Delete Alarm dialog box is displayed.
3. Click OK.

Figure 7-17 Deleting an alarm

7.10 Performing One-Click Health Check


Due to time zone and network problems, devices may be displayed as offline on
the console, skills fail to be started, or firmware fails to be upgraded. You can
perform one-click health checks to quickly locate and resolve the problems.

Prerequisites
The cloud-side one-click health check function is available for devices whose
firmware version is 1.1.0 or later. For details about how to upgrade the firmware,
see Upgrading HiLens_Device_Agent Firmware.

Cloud-Side Health Check Items


● Process Information: Check whether the basic process is running properly.
● Dependency Library: Check whether the dependency library of the device is
deleted by mistake and whether it can be properly called.
● Time: Check whether the time zone and time are correct.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 106


Huawei HiLens
User Guide 7 Managing Devices

Cloud-Side Health Check Procedure


1. Log in to the Huawei HiLens console. In the navigation pane, choose Device
Management > Devices.
2. On the displayed device list, click the card of the target device.
The device details page is displayed.
3. Click One-Click Health Check in the upper right corner.
Wait for a period of time. After the system check is complete, the Health
Check dialog box is displayed, showing the process, dependency library, and
time statuses.
If a status is abnormal, the cause of the exception is displayed in the Health
Check dialog box. You can rectify the fault based on the cause.

Device-Side Health Check Items


You can also log in to the HiLens Kit device system through SSH to perform health
checks on devices.
● Checking network connectivity of devices
● Checking whether the type of the wireless network connected to the device
meets the requirements
● Checking whether a device is offline

Device-Side Health Check Procedure


1. Connecting a HiLens Kit Device to a PC
2. Logging In to a HiLens Kit Device Using SSH
3. Running hdactl health_check

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 107


Huawei HiLens
User Guide 8 Developing Skills on the Console

8 Developing Skills on the Console

8.1 Skill Overview


A skill can be abstractly understood as "algorithm model + logic code". The
algorithm model handles AI inference, and the logic code handles inference result
processing. For details about the skills, see Skill.

This section describes how to use empty templates and basic skill templates to
develop skills on the Huawei HiLens console.

Skill Development Overview


As shown in Figure 8-1, skills are classified into two types based on the chip types:
skills used on HiLens Kit devices and skills used on devices that run HiSilicon
Hi35xx series chips. The Huawei HiLens platform supports quick, convenient, and
efficient skill development with skill templates, and also allows you to develop
models and logic code to meet your specific requirements in more scenarios. You
can use trainable skill templates to develop skills that meet industry scenarios. In
this way, you can upload training data without coding to improve model precision.
For details, see Process for Creating Skills Using Trainable Skill Templates.

Skills that run on HiSilicon Hi35xx series chips have high requirements on chip
memory and performance. You need to optimize the skill models. If you want to
develop skills of this type, contact Huawei HiLens platform personnel for support.

Figure 8-1 Skill development scenarios

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 108


Huawei HiLens
User Guide 8 Developing Skills on the Console

Developing New Skills on the Console


Before creating a skill, determine its type. Different skills have different models
and logic code, but their creation process is the same.

NOTE

Developing skills on the Huawei HiLens console may occupy OBS resources and incur fees.
For details about the OBS pricing, see Product Pricing Details.

For details about the skill creation process, see Figure 8-1.
● Using basic skill templates: Ensure that there are available basic skill
templates on the platform. You can also use trainable templates to develop
skills. For details, see Process for Creating Skills Using Trainable Skill
Templates.
● Using empty templates: To develop a skill using an empty template, you
need to develop its model and logic code. If your model format does not meet
our requirements, the Huawei HiLens platform will convert the model format
during model import.

Figure 8-2 Skill development

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 109


Huawei HiLens
User Guide 8 Developing Skills on the Console

Table 8-1 Common operations for creating a skill


Catego Common Operation Quick Link
ry

Using a Obtain a skill template. Obtaining Skill Templates


skill
templa Create a skill using the Creating Skills
te basic skill template.

Using Develop a model. Developing Models


an
empty Import (convert) the Importing (Converting) Models
templa model.
te Compile the logic code. Writing the Code

Create a skill using the Creating Skills


empty template.

Related Operations
On the Huawei HiLens platform, you can not only develop skills, but also manage
your developed skills. The detailed operations are as follows.

Table 8-2 Skill Related Operations


Operation Description

Creating Skills After determining the type of the skill to be developed,


create the skill according to Developing New Skills on
the Console.

Editing Skills After a skill is created, you can edit and modify the skill,
including its basic information, content, messages, and
runtime configurations.

Installing and After a skill is created, you can deploy it to devices, view
Debugging Skills the skill videos to check its effects, and debug it
repeatedly.

Releasing Skills After a skill is debugged and verified, you can release it
to the skill market and share it with all or some users.

Deleting Skills You can delete skills that are no longer used to release
resources.

8.2 Creating Skills


8.2.1 Creating a Skill Using a Skill Template
This section describes how to use a basic skill template to create a skill. When you
use a basic skill template to create a skill, the default values in the skill template

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 110


Huawei HiLens
User Guide 8 Developing Skills on the Console

can be directly used, including the logic code and algorithm model. You only need
to enter basic information about the skill.

Prerequisites
● Ensure that the HUAWEI CLOUD account is not in arrears. Developing skills
on the Huawei HiLens console may occupy OBS resources and incur fees. For
details about the OBS pricing, see Product Pricing Details.
● You have searched and obtained the skill template that meets your service
response requirements on the Skill Templates page. For details, see
Obtaining Skill Templates.

1. Starting to Create a Skill


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Skills.
2. Click Create Skill in the upper right corner. The Create Skill page is
displayed.

2. Selecting a Template
1. Click Select Template for Skill Templates. The Select Skill Template dialog
box is displayed.

Figure 8-3 Selecting a skill template

2. Select the template you want and click OK.


The area for editing the skill content on the Create Skill page is displayed.
The default configuration of the selected template is automatically loaded.
You can view the related information on the right pane of the page.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 111


Huawei HiLens
User Guide 8 Developing Skills on the Console

Figure 8-4 Basic skill information

3. Filling in Related Information


After selecting an existing template, you can enter the skill information, including
the basic information, skill content, and (Optional) runtime configurations by
referring to Creating a Skill Using an Empty Template.
The Skill Code Value is automatically initialized based on the selected template.
You need to specify parameters such as the Name and Skill Version, which are
not contained in the skill template. You can modify the content of the skill
template as required or retain all of the default values.

4. Confirming Information and Creating the Skill


After setting the preceding parameters, you can view the parameter values on the
right pane. If a parameter is incorrectly set, a red cross is displayed on the right.
Confirm the information and click OK to create the skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 112


Huawei HiLens
User Guide 8 Developing Skills on the Console

Figure 8-5 Confirming information and creating the skill

After the skill is created, the Skill Development > Skills page is displayed, where
the skill is displayed in the Not Released status. You can release the skill to the
skill market.

After the skill is released, its status becomes Reviewing. Huawei HiLens personnel
will complete the review within three working days. After the skill release is
approved, the status changes Released.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 113


Huawei HiLens
User Guide 8 Developing Skills on the Console

8.2.2 Creating a Skill Using an Empty Template


This topic describes how to use an empty template to create a skill. If you choose
to use an empty template, you need to prepare the algorithm model and logic
code in advance.

Context
● Developing skills on the Huawei HiLens console may occupy OBS resources
and incur fees. For details about the OBS pricing, see Product Pricing Details.
● The algorithm model must be in .om format and meet the requirements of
Huawei HiLens. For details, see Developing Models.
● Logic code can be handled (stored) in either of the following ways: Online
Compilation and Upload From OBS.
– If your code logic is simple, you are advised to compile the code online.
– If your code structure is complex, you are advised to develop the code in
a local integrated development environment (IDE) and upload it in .zip
or .tar.gz format from OBS. For details about how to use OBS to upload
files, see Object Storage Service Getting Started. Uploading files to OBS
is charged. For details about the OBS pricing, see Product Pricing
Details.
NOTE

● Before uploading a file, ensure that the OBS bucket is in the same region as
Huawei HiLens.
● If you upload code from OBS, compress all code files before uploading them.
The uploaded files must be in .zip or tar.gz format, and the main file must be
in the level-1 directory. As shown in the following example, the entry code
(main.py) is in the level-1 directory. Other code needs to be designed as
required. You can pack the model and code together to upload them.
● The file (for example, main.py) where the entry code is located is configured
through the Function Execution Entry parameter, which will be described
later.
The following is a code directory example:
skill/
|---main.py #Main file. The file name is the same as the value of parameter Code
Configuration of the new skill.
|---depends/ #Optional, used to store the model file.
|---workspace/ #Workspace, used to store data generated by the skill.
|---data/ # Used to store runtime configurations.

● If the skill is in the container image format, upload the image to SWR. For
details, see Uploading an Image Through a Docker Client.

Prerequisites
● Ensure that the HUAWEI CLOUD account is not in arrears. Developing skills
on the Huawei HiLens console may occupy OBS resources and incur fees. For
details about the OBS pricing, see Product Pricing Details.
● The model used for creating a skill has been imported to Huawei HiLens.
● If you select Upload From OBS, upload the logic code to your OBS bucket in
advance.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 114


Huawei HiLens
User Guide 8 Developing Skills on the Console

1. Starting to Create a Skill


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Skills.
2. Click Create Skill in the upper right corner. The Create Skill page is
displayed.

2. Filling In Basic Information


On the Create Skill page, select Create from Scratch for Skill Templates and fill
in the basic information. Table 8-3 describes related parameters.

Figure 8-6 Filling in basic information

Table 8-3 Basic information

Parameter Description

Skill Templates Whether to use a template to develop a skill. If you select


an existing template, the model and code of the template
are used. That is, all parameters in the Skill Content
module use the values specified by the template.

Name Name of a skill. The name is also used as the root directory
name when the skill is delivered to a device.
The name is a string of 3 to 60 characters that can contain
only letters, digits, hyphens (-), and underscores (_). It must
start with a letter and end with a letter or digit.
NOTE
Skills in the skill market cannot share the same name. If you want
to release a skill to the skill market, use a globally unique name to
name the skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 115


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

Skill Version Skill version. The version number is in the format of A.A.A,
where A is a natural number consisting of a maximum of
three digits, for example, 1.0.0.
If A contains more than one digit, it cannot start with 0.
For example, 01.0.0 is not allowed.

Chip Chip supported by the skill. For skills running on HiLens Kit
devices, select the Ascend 310 chip.

Skill Code Value Used for skill verification to prevent fake skills. The value
must be the same as that on the initialization interface in
the code. For details about the usage, see Initializing the
HiLens Framework in the Huawei HiLens Developer Guide.

Applicable Application scenario of the skill, such as sub-scenarios of


Scenario Smart Campus, Smart Home, Smart In Vehicle Device,
and Smart Mall and Supermarket, and Others

Icon Icon of the skill

OS Platform Operating system platform where the skill runs, including


Linux, Android, iOS, LiteOS, and Windows. The HiLens Kit
device uses the Linux distribution EulerOS developed based
on CentOS. Therefore, if the skill is to run on HiLens Kit
devices, select Linux.

Description Detailed description about the skill.


You can enter a maximum of 2,048 characters. Special
characters ~^$%& are not allowed.
NOTE
If messages need to be sent to users' mobile phones or email
addresses, (for example, when a stranger is detected, a message
needs to be sent to notify the user), you need to add This skill
supports notification messages. in the description. The message
to be sent needs to be specified in Writing the Code. For details,
see the Huawei HiLens Developer Guide.

3. Setting the Skill Content


Enter the skill content based on your model and logic code. For details about the
parameters, see Table 8-4.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 116


Huawei HiLens
User Guide 8 Developing Skills on the Console

Figure 8-7 Setting the skill content

Table 8-4 Skill content parameters


Parameter Description

Skill Format Format of the skill. The value can be Skill package or
Container image.

Runtime Language Runtime language of the logic code. Currently, the


value can be Python3.7 or C/C++. If you select C/C++
for development, online code compilation is not
supported. You need to develop the code offline,
compile and pack the code in the Linux environment,
and upload it to OBS.

Function Execution The startup of a skill uses the code execution file as the
Entry entry, which is similar to the main function of the C
language. The main file must be in the level-1 directory.
● For skills of the Skill package format, the main file
must be in the root directory of the skill package.
For example, a Python skill file must end with .py.
● For skills of the Container image format, if
ENTTRYPOINT is configured in dockerfile, the
description can be left blank. Otherwise, the path of
the execution file in the image must be entered.
The file name contains a maximum of 1,024 characters.
Only letters, digits, and underscores (_) are allowed.
Special characters #~^ are not allowed.

Model Core algorithms of the skill. Train the model locally or


in ModelArts and import it to the Huawei HiLens
platform. Click the plus sign (+). In the dialog box that
is displayed, select a model in the model management
list on the Huawei HiLens platform.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 117


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

Code Entry Mode Upload mode of the logic code.


NOTE
Firmware 1.1.2 or later supports configuring Python
dependencies for skills. During skill development, you can
configure Python dependencies for a skill as required. For
details, see "How Do I Configure Python Dependencies for a
Skill".
● Online Compilation
When you use the logic code for online skill
development, a .zip package is automatically
generated and uploaded to OBS. Huawei HiLens
automatically creates an OBS bucket for storing skill
packages. The naming rule of the bucket is
<project_id>-hilens-skill. You can go to OBS, find
the OBS bucket with the corresponding naming rule,
and obtain the code package file edited online.
● Upload From OBS
You can develop complex project code offline,
manually generate a .zip or .tar.gz package, upload
it to OBS, and select the .zip or .tar.gz package from
OBS here. Before uploading the code to OBS, you
can package the model together. For details about
the model and code structures, see the specifications
defined in Context.
● Select Container Image
For skills in the container image format, you can
upload their container image files to SWR in
advance. For details, see Uploading an Image
Through a Docker Client.

4. (Optional) Setting Runtime Configurations


You need to set parameters for some running skills. For example, import facial
image libraries when using facial recognition skills. If users configure runtime
configurations when running a skill, Huawei HiLens will record the configurations
in the code for other developers to use. You can click Add Tag on the page and
enter your configuration by referring to Table 8-5.

You can also click Preview JSON to view the runtime configuration's format.
Developers can obtain the skill configurations in JSON format through the
get_skill_config interface provided by the HiLens Framework and read the field
values to use the user configurations.

The runtime configurations in JSON format are as follows:


{
//Global configuration
"Language": "enum",
//Channel-based video configuration
"multi_camera": [ //The key value multi_camera is fixed, indicating channel-based camera configuration.
{
"camera_names": [ //The key value camera_names is fixed, indicating the cameras included in

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 118


Huawei HiLens
User Guide 8 Developing Skills on the Console

the group configuration.


"cameraX",
"cameraY"
],
"FaceLib": { //Configuration name
"from": "file source", //File type value, indicating the service from which the file comes, for
example, OBS.
"path": "file path" //File type value, indicating the file path.
}
}
],
}

Table 8-5 Runtime configuration parameters

Parameter Description

Name Configuration name. This field can be used to obtain the


configuration value in the logic code. A runtime
configuration refers to the content configured by users
when a skill is running. For example, facial recognition
skills require users to upload facial image libraries. Note
that the runtime configuration is optional. If a
configuration is added, the configuration Name and
Description are mandatory.

Value Type Type of the value of a configuration item.


The value can be int, float, enum, string, or file.

Constrain Value range of the configuration. This parameter is related


to the value type.
● Numeral type (int and float): The value range is an
open or closed interval. For example, [1, 100) indicates
that the value is greater than or equal to 1 and less
than 100.
● string and file: You do not need to set this parameter.
● enum: The value range is a set, for example, {a, b}.

Explanation Describes the function of the configuration item and how


to configure it. This field is important. Users can set a
configuration based on the description here. Therefore,
if a skill has a runtime configuration, developers must
explain it clearly.

Object A HiLens Kit device can connect to multiple external


cameras (the number of cameras cannot be greater than
the total number of channels supported by the skills
installed on the device). Therefore, you can develop skills
that support multiple video channels.
● If you select Video, the configuration takes effect for
videos of each camera on the device. For example,
camera 1 and camera 2 use different facial image
libraries.
● If you select Global, all cameras on the device use the
same configuration value.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 119


Huawei HiLens
User Guide 8 Developing Skills on the Console

5. (Optional) Setting Hard Example Upload


The application scenarios of skills are easily affected by uncontrollable factors,
such as the camera position, angle, object proportion, and light. The data used for
training the model cannot cover all application scenarios. Therefore, Huawei
HiLens supports the function of uploading hard examples. When creating skills, set
the model information for hard example filtering. Then, call the hard example
filtering API of the configured model in the skill code. For details, see section
"Hard Example Upload" in the Huawei HiLens Developer Guide.
You can set the parameters for hard example upload by referring to Table 8-6.
You can click Preview JSON Format to view the hard example upload settings in
JSON format.

Table 8-6 Description of fields in the hard example upload settings


Parameter Description

Model Name Name of the model for hard example


filtering. This field can be used in the
logic code to call the hard example
filtering model.
Note that hard example upload is
optional. However, if a hard example
setting is added, Model Name, Model
Type, Parameter, and Value Type are
mandatory, and Default Value is
optional.

Model Type Type of the hard example filtering


model, such as image classification
and object detection

Parameter Parameter for using the hard example


filtering model

Value Type Parameter value type of the hard


example filtering model
The value can be int, float, enum,
string, or file.

Default Value Default parameter value of the hard


example filtering model

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 120


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

Description Description of the application scenario


of the hard example filtering model
and the method of setting hard
examples when the skill is used. This
field is significant. Users who use
skills will set hard examples based
on the description of this field.
Therefore, you must explain hard
example upload setting clearly here.

You can click Add Hard Example to add a hard example filtering model. You can
also click Delete in the Operation column to delete a model.
When creating a skill, you can set the API for uploading hard examples. Users set
the model parameter values and datasets for hard example filtering as required
after a skill is installed on a device and then run the skill. For details about how to
configure hard example settings, see Configuring Hard Example Settings.

6. (Optional) Elastic Skill Parameters


Some skills can be deployed on devices and can also call cloud-based algorithm
APIs. For these device-cloud collaborated skills, you need to configure elastic skill
parameters. For details, see Table 8-7.

NOTE

Before configuring elastic skill parameters, you need to develop a model and import it to
ModelArts. The model must be in Normal state and its Deployment Type is Real-Time
Services.

Table 8-7 Elastic skill parameters


Parameter Description

Web Request URI Request path of the ModelArts model.


Enter a string of 1 to 255 characters
starting with a slash (/). Special
characters such as #~^$%*<> are not
allowed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 121


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

Model Address Address of the ModelArts model.


1. By default, the model is imported
from ModelArts. Select a model
framework from the corresponding
drop-down list.
Currently, only the TensorFlow and
Caffe model frameworks are
supported.
2. Select the model to be imported
from the model list.

Request Method Method for the model to send


requests. Currently, POST, GET, PUT,
and DELETE are supported.

Compute Resource Compute resource used by the


algorithm model. Currently, GPU and
CPU are supported.

6. Confirming Information and Creating the Skill


After setting the preceding parameters, you can view the parameter values on the
right pane. If a parameter is incorrectly set, a red cross is displayed on the right.
Confirm the information and click OK to create the skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 122


Huawei HiLens
User Guide 8 Developing Skills on the Console

Figure 8-8 Confirming information and creating the skill

After the skill is created, the Skill Development > Skills page is displayed, where
the skill is displayed in the Not Released status. You can release the skill to the
skill market.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 123


Huawei HiLens
User Guide 8 Developing Skills on the Console

8.3 Obtaining Skill Templates


Skill templates can be used to quickly create skills to improve the development
efficiency.
This section describes how to obtain and use skill templates.

Skill Template Introduction


Skill templates are classified into basic templates, HiLens Studio templates, and
trainable templates.
● Basic templates
Algorithm template and logic code of existing skills, which can be used to
develop skills on the Huawei HiLens console
● HiLens Studio templates
Algorithm template and logic code of existing skills, which can be used to
develop skills in HiLens Studio. When developing skills, you can import new
models to HiLens Studio or modify and debug logic code in HiLens Studio.
Currently, HiLens Studio templates are not displayed on the Skill
Development > Skill Templates page. You can access HiLens Studio and
select a HiLens Studio template to create a skill. For details, see Creating a
Skill Project.
You can also perform the following operations on the basic templates:
● Viewing a Skill Template
● Downloading a Skill Template
● Adding a Skill Template to Favorites
● Creating a Skill Using a Skill Template

Viewing a Skill Template


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Skill Templates. The All tab page is displayed.
2. Click a skill template card. The skill template's details page is displayed, on
which you can view the basic information and runtime parameters of the skill.
3. You can click the My Favorites tab to view the list of skills you have added to
favorites, and click a skill card to go to the details page.

Downloading a Skill Template


1. On the All, Basic Templates, or My Favorites tab page, click a skill template
card. The details page is displayed.
2. Click Download Template in the upper right corner to download the skill
template package to your local PC.
The package is in the .zip format. A downloaded package contains the
algorithm model and logic code of the skill template. Some skill templates
may not have algorithm models. In this case, the package contains only the
logic code file.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 124


Huawei HiLens
User Guide 8 Developing Skills on the Console

Adding a Skill Template to Favorites


● On the All tab page, click a skill template card. The details page is displayed.
Click Add to Favorites in the upper right corner.

● On the All tab page, click the icon on a skill template card.

After you add a skill template to favorites, it will be displayed on the My Favorites
page. Click the icon on the card again or click the Remove from Favorites
button in the upper right corner of the skill details page to remove the template
from your favorites.

Creating a Skill Using a Skill Template


1. On the All, Basic Templates, or My Favorites tab page, click a skill template
card. The details page is displayed.
2. Click Create Skill Using Template in the upper right corner. The Create Skill
page is displayed. For details about the skill creation parameters, see
Creating a Skill Using a Skill Template.

8.4 Managing Algorithm Models

8.4.1 Developing Models

Prerequisites
Currently, the HiLens Kit AI chip supports only .om models, which can be
converted from TensorFlow or Caffe models. However, .om models do not support
all operators of the TensorFlow and Caffe models. Therefore, you need to use
operators supported by .om models during TensorFlow/Caffe model development.
In this case, the TensorFlow and Caffe models can be converted into .om models.
For details about the TensorFlow and Caffe operator boundaries supported by .om
models, see Caffe Operator Boundaries and TensorFlow Operator Boundaries.

NOTE

.om models are not fully compatible with the built-in Keras APIs of TensorFlow.
.om models do not support Caffe2.

Developing Models Using ModelArts


ModelArts is a one-stop development platform for AI developers. You can use
ModelArts to develop algorithm models used on the Huawei HiLens platform.

After a model is developed or trained using ModelArts, it is stored in the model list
of ModelArts. For details, see the ModelArts User Guide. Currently, Huawei
HiLens supports only the algorithm models developed using TensorFlow and Caffe
engines. Therefore, you are advised to select a correct engine type and model
storage format when using ModelArts for development.

Models generated by ExeML of ModelArts cannot be used on the Huawei HiLens


platform.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 125


Huawei HiLens
User Guide 8 Developing Skills on the Console

Developing Models Offline


You can use a familiar algorithm model development tool to develop an algorithm
model locally.
Currently, only the algorithm models developed by TensorFlow or Caffe engines
are supported, and the models you developed must be saved in .pb
or .caffemodel format. Then, use the model import/conversion function of
Huawei HiLens to convert the models to the .om format supported by Ascend 310
chips.

Follow-up Operations
After models are developed, you need to import them into the Huawei HiLens
console. Then, use the model import/conversion function of Huawei HiLens to
convert models developed using TensorFlow and Caffe engines to the .om format
supported by Ascend 310 chips. For details, see Importing (Converting) Models.

8.4.2 Importing (Converting) Models


A skill can be abstractly understood as "algorithm model + logic code". The
algorithm model handles AI inference, and the logic code handles inference result
processing. Therefore, you need to import models to Huawei HiLens before
developing skills.

Model Requirements
The models to be imported can be in .om, .pb, or .caffemodel format. Only
models in .om format can run on HiLens Kit devices. If you import a model in .pb
or .caffemodel format, the Huawei HiLens platform automatically converts it into
the .om format.
Not all models can be successfully converted. Before importing and converting a
model, check whether it uses the TensorFlow and Caffe operator boundaries
supported by .om models. For details, see Caffe Operator Boundaries and
TensorFlow Operator Boundaries.

Prerequisites
You can train a model in ModelArts or locally.
● Importing a ModelArts model file
Before importing a ModelArts model file, train your algorithm model in
ModelArts. For details about how to train a model, see the ModelArts
Documentation.
NOTE

● Models developed by ExeML of ModelArts cannot be imported to Huawei HiLens.


● Huawei HiLens can import only the model files instead of models trained on
ModelArts.
● Importing a model trained locally
Before importing a custom model, upload it to OBS. A non-om model
package contains Caffe model files .caffemodel and .prototxt and

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 126


Huawei HiLens
User Guide 8 Developing Skills on the Console

configuration file .cfg, or TensorFlow model file .pb and configuration


file .cfg. Prepare the configuration file .cfg based on the model file. For
details, see "AIPP Configuration".
For details about how to upload model files to OBS, see Object Storage
Service Getting Started. The directory to which the model files are uploaded
must meet certain specifications. For details, see Model Input Directory
Specifications.
Uploading files to OBS is charged. For details about the OBS pricing, see
Product Pricing Details.
When uploading files to OBS, ensure that the OBS bucket and Huawei HiLens
are in the same region and the OBS folder name meets the following
requirements:
– Cannot contain special characters \:*?"<>|.
– Cannot start or end with a period (.) or slash (/).
– The absolute path of the folder can contain a maximum of 1,023
characters.
– Cannot contain two or more adjacent slashes (/).

Importing (Converting) a Model


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Models. The Models page is displayed.
2. Click Import (Convert) Model in the upper right corner.
3. On the Import Model page, set parameters by referring to Table 8-8, confirm
the information, and click OK.

Table 8-8 Importing a custom model


Paramete Description
r

Name Name of the model to be imported. A model name contains 2


to 24 characters. Only lowercase letters, digits, and hyphens (-)
are allowed. It must start with a lowercase letter and end with
a lowercase letter or digit.

Version Version of the model to be imported.


The value is in the number.number.number format, for
example, 2.1.3. Each number ranges from 0 to 999. When it
has two or more digits, it cannot start with 0.

Descriptio Description of the model to be imported. The value contains 1


n to 100 characters. Special characters &!"'\<>= are not allowed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 127


Huawei HiLens
User Guide 8 Developing Skills on the Console

Paramete Description
r

Model Source of the model to be imported, including Import From


Source OBS and Import From ModelArts.
● Importing a model from OBS
Click Import From OBS, select the bucket and folder where
the custom model is stored on OBS, and click OK.
● Importing a model from ModelArts
1. Click Import From ModelArts and select a model
framework from the drop-down list on the right,
including TensorFlow, Caffe, and OM (obtained from
the conversion task).
After you import a TensorFlow or Caffe model, the
Huawei HiLens platform converts it into the .om format
and then imports it. The .om model is obtained from the
previous conversion task.
2. Select the model to be imported from the model list.

Type If you select a model (non-om model) whose format needs to


be converted for Model Source, you need to select a model
conversion template, which can be TF-FrozenGraph-To-
Ascend-HiLens, TF-SavedModel-To-Ascend-HiLens, TF-
FrozenGraph-To-Ascend, TF-SavedModel-To-Ascend or Caffe
to Ascend.
● TF-FrozenGraph-To-Ascend-HiLens
This template converts TensorFlow frozen_graph models into
those run on Ascend chips. If the firmware version of your
HiLens Kit system is 2.2.200.011 or you use HiLens Studio
for debugging, you are advised to use this template for
model conversion.
● TF-SavedModel-To-Ascend-HiLens
This template converts TensorFlow saved_model models into
those run on Ascend chips. If the firmware version of your
HiLens Kit system is 2.2.200.011 or you use HiLens Studio
for debugging, you are advised to use this template for
model conversion.
● TF-FrozenGraph-To-Ascend
This template converts TensorFlow frozen_graph models into
those run on Ascend chips. If the firmware version of your
HiLens Kit system is earlier than 2.2.200.011, you are
advised to use this template for model conversion.
● TF-SavedModel-To-Ascend
This template converts TensorFlow saved_model models into
those run on Ascend chips. If the firmware version of your
HiLens Kit system is earlier than 2.2.200.011, you are
advised to use this template for model conversion.
● Caffe to Ascend
Caffe models can be converted into models that can run on
Ascend chips.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 128


Huawei HiLens
User Guide 8 Developing Skills on the Console

Paramete Description
r

Import If you select a model (non-om model) that needs to be


From converted in Model Source, this parameter is automatically
initialized based on the model source. The directory must
contain the model file and configuration file required for
conversion. For details about the model input directory
specifications, see Model Input Directory Specifications.

Export To If you select a model (non-om model) that needs to be


converted in Model Source, click to select the OBS directory
to which the converted model is exported. Ensure that no .om
model exists in the directory. For details about the model
output directory specifications, see Model Output Directory
Specifications.

Advanced Includes the Input Tensor Shape and out_nodes parameters.


Options For details, see Table 8-9.

Table 8-9 Advanced options


Parameter Description

Input Tensor Shape Specifies the shape of the input data of the model.
The input data is in the format of NHWC, for
example, input_name:1,224,224,3.
If you select a non-om model for Model Source and
the conversion template is TF-FrozenGraph-To-
Ascend-HiLens or TF-SavedModel-To-Ascend-
HiLens, you must specify the input tensor shape.
input_name must be the node name in the network
model before model conversion. The name is
mandatory when the model has dynamic shape
input. For example, in input_name1:? ,h,w,c, the
question mark (?) indicates the batch size, that is,
the number of images processed at a time. It is used
to convert the original model with a dynamic shape
into an offline model with a fixed shape.
Use commas to separate multiple inputs.

out_nodes Specifies the output node, for example,


node_name1:0;node_name1:1;node_name2:0.
node_name must be the node name in the network
model before model conversion. The digit after each
colon (:) indicates the sequence number of the
output. For example, node_name1:0 indicates the
0th output of node_name1.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 129


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

input_format The default input data format is NHWC. If the actual


format is NCHW, you need to set this parameter to
NCHW.

net_format Specifies the preferred data format for network


operators. Possible values are ND (N cannot be more
than 4) and 5D. This parameter only takes effect if
the input data of operators on the network supports
both ND and 5D formats. ND indicates that
operators in the model are converted into the
NCHW format. 5D indicates that operators in the
model are converted into the Huawei-developed 5D
format. 5D is the default value.

fp16_high_prec Specifies whether to generate a high-precision FP16


Davinci model.
● The default value is 0, indicating that a common
FP16 Davinci model is generated, which has
better inference performance.
● The value 1 indicates that a high-precision FP16
Davinci model with better inference precision is
generated.

output_type FP32 is the default value and is recommended for


classification and detection networks. For image
super-resolution networks, UINT8 is recommended
for better inference performance.

After the model is imported, the Models page is displayed. You can view the
imported model in the list.

Viewing Details About a Model


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Models. The Models page is displayed.
You can view the Model Name, Version, Model Size, Import Time, Status,
Description, and Operation in the list. The model status can be Converting,
Conversion failed, Conversion succeeded, Import failed, and Import
succeeded.
2. Click Details in the Operation column of a model. The Model Details page is
displayed.
You can view the Basic Information and Log Information of the model, as
shown in Figure 8-9.
Table 8-8 describes the Basic Information parameters.
For the model that needs to be converted, you can enter keywords in the
upper right corner of the Log Information area to quickly locate key
information in a log. You can also join the forum to discuss and resolve
problems.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 130


Huawei HiLens
User Guide 8 Developing Skills on the Console

Figure 8-9 Model details

Reconverting a Model
If the imported model is not in the .om format and is in Conversion failed status,
you can modify the model parameters and convert it again.

You can view the model status on the Models page of the Huawei HiLens console.

1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Models. The Models page is displayed.
2. Click Details in the Operation column of a model. The Model Details page is
displayed.
You can view the Basic Information and Log Information of the model.
For the model that needs to be converted, you can enter keywords in the
upper right corner of the Log Information area to quickly locate key
information in a log. You can also join the forum to discuss and resolve
problems.
3. On the Basic Information tab page, click to modify the Type, Advanced
Options, Import From, Export To, and Description parameters. After the
modification is complete, click to save the modification. Table 8-8 describes
related parameters.
4. After modifying the model parameters, click Reconvert in the upper right
corner to convert the model again.

Deleting a Model
You can delete imported (converted) models based on service requirements.
Models in the Converting state cannot be deleted.

1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Models. The Models page is displayed.
2. Locate a model and click Delete in the Operation column to delete it. You
can also click Details in the Operation column and click Delete Model in the
upper right corner of the model details page to delete the model.

8.4.3 Model Input Directory Specifications


The input directory of a model (oriented to Ascend chips) developed locally or
developed in ModelArts and converted on Huawei HiLens must meet certain

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 131


Huawei HiLens
User Guide 8 Developing Skills on the Console

specifications. Huawei HiLens has the following requirements on the model input
directory:

● Input directory specifications for Caffe models:


|
|---xxxx.caffemodel Model parameter file, mandatory. Only one model parameter file can exist in
the input directory.
|---xxxx.prototxt Model network file, mandatory. Only one model network file can exist in the
input directory.
|---insert_op_conf.cfg Insertion operator configuration file, optional. Only one insertion operator
configuration file can exist in the input path.
|---plugin Custom operator directory, optional The input directory can contain only one
plugin folder. Only custom operators developed based on Tensor Engine (TE) are supported.

● Input directory specifications for TensorFlow models (in frozen_graph or


saved_model format):
frozen_graph format
|
|---xxxx.pb Model network file, mandatory. Only one model network file can exist in the
input path. The model must be in frozen_graph or saved_model format.
|---insert_op_conf.cfg Insertion operator configuration file, optional. Only one insertion operator
configuration file can exist in the input path.
|---plugin Custom operator directory, optional The input directory can contain only one
plugin folder. Only custom operators developed based on Tensor Engine (TE) are supported.

saved_model format
|
|---saved_model.pb Model network file, mandatory. Only one model network file can exist in
the input path. The model must be in frozen_graph or saved_model format.
|---variables Fixed subdirectory name, including the model weight deviation, mandatory
|---variables.index Mandatory
|---variables.data-00000-of-00001 Mandatory
|---insert_op_conf.cfg Insertion operator configuration file, optional. Only one insertion operator
configuration file can exist in the input path.
|---plugin Custom operator directory, optional The input directory can contain only one
plugin folder. Only custom operators developed based on Tensor Engine (TE) are supported.

8.4.4 Model Output Directory Specifications


After a model import (conversion) task is executed, Huawei HiLens outputs the
converted model to a specified OBS path. The output directories of models from
different conversion tasks and oriented to Ascend chips must meet certain
specifications. Huawei HiLens has the following requirements on the model output
directory:

● Output directory specifications for Caffe models:


|
|---xxxx.om Converted model to run on the Ascend chip. The model file name extension is .om.
|---job_log.txt Conversion log file

● Output directory specifications for TensorFlow models:


|
|---xxxx.om Converted model to run on the Ascend chip. The model file name extension is .om.
|---job_log.txt Conversion log file

8.5 Writing the Code


Huawei HiLens provides a HiLens Framework, which encapsulates bottom-layer
APIs to implement common management functions, enabling you to easily
develop skills and the AI ecosystem. For details about the guide and APIs, see the
Huawei HiLens Developer Guide.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 132


Huawei HiLens
User Guide 8 Developing Skills on the Console

HiLens Framework Sample Code


HiLens Kit devices run on the HiLens Framework. Developers can directly call APIs
of the HiLens Framework when compiling logic code for skill development.
The following is an example of using the HiLens Framework to obtain the camera
content and perform simple processing.

NOTE

● You need to fill in the code execution file during skill development.
● Firmware 1.1.2 or later supports configuring Python dependencies for skills. During skill
development, you can configure Python dependencies for a skill as required. For details,
see "How Do I Configure Python Dependencies for a Skill".
#!/usr/bin/python3
# skillframework 1.0.0 python demo

import hilens # Import the HiLens package.


import cv2 # Import the opencv.

def main():
hilens.init("hello") # Initialize the skill.
model = hilens.Model(hilens.get_model_dir() +
"faceDetection.om") # Construct the model manager.
disp = hilens.Display(hilens.HDMI) # Construct the display.
cap = hilens.VideoCapture() # Construct the camera.
proc = hilens.Preprocessor() # Construct the preprocessor.

hilens.set_log_level(hilens.DEBUG) # Set the log level.


hilens.Info("This is a skillframework python demo") # Print the log.

for i in range(10):
frame = cap.read() # Read a frame of image.
rframe = proc.resize(frame, 480, 480, 1) # Zoom in/out
inputs = [rframe.flatten()] # Construct the model input.
outputs = model.infer(inputs) # Inference
hilens.Info("outputs len: %d" % len(outputs)) # Print the output size.
for o in outputs:
hilens.Info("output shape: " + str(o.shape))
# post process is ignored
disp.show(frame) # Output the image to the display.

hilens.terminate() # Destroy the resource.

if __name__ == "__main__":
main()

8.6 Editing Skills


During skill creation and use, if you find incorrect information, you can edit the
skill's basic information, content, or runtime configurations to correct it.
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Skills.
2. On the Skills page, locate the skill to be edited and click Edit in the
Operation column to enter the Edit Skill page.
Modify the skill content based on parameters described in Creating a Skill
Using an Empty Template.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 133


Huawei HiLens
User Guide 8 Developing Skills on the Console

8.7 Installing and Debugging Skills


After a skill is created, you can install it on a device, and check its running effects
by viewing the skill videos or original videos of the device, to determine whether
the skill can meet service requirements.
You can also locate faults and debug the skill according to the device log. For
detailed operations, see Viewing Device Logs.

Prerequisites
● A HiLens Kit device has been registered with Huawei HiLens and is Online.
For details about device management, see Device Management Overview.
● A skill has been developed and created on Huawei HiLens.
● The HiLens Device-Edge-Cloud Synergy Platform Service has been purchased
and the device has been activated before installing basic skills you developed
onto the device. For details, see Subscribing to HiLens Device-Edge-Cloud
Synergy Platform Service and Activating Devices (Purchasing HiLens
Device-Edge-Cloud Synergy Platform Service).

Installing a Skill
1. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Skill Development > Skills.
The Basic Skills tab page is displayed.
2. Select the skill to be installed and click Install in the Operation column.
3. In the dialog box that is displayed, select the devices to which the skill is
installed and click OK.
If the information similar to the following is displayed, the skill is installed
successfully.

Figure 8-10 Successful installation

4. After the installation is successful, you can go to the Data Management page
to view the skill effect.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 134


Huawei HiLens
User Guide 8 Developing Skills on the Console

8.8 Releasing Skills


After developing and debugging skills, you can release the skills to the skill market
of Huawei HiLens. After the skills are approved by the platform, they can be
purchased and used by other users.

Prerequisites
● A skill has been developed, installed, and debugged, and the debugging
result meets service requirements.

Context
● A released skill will be reviewed within three working days. After being
approved, it is displayed in the list of Skill Market of Huawei HiLens or on
the My Publishings tab page of AI Gallery of the ModelArts console.
● The name of the skill to be released cannot be the same as that of any other
skill in the skill market or the ModelArts AI Gallery.

Releasing a Skill to the Skill Market


1. Log in to the Huawei HiLens console, choose Skill Development > Skills in
the left navigation pane. The Skills page is displayed.
2. Select the skill to be released and click Release in the Operation column.
3. In the displayed Release Skill dialog box, select the service to which the skill
is to be released, set the release information, and click OK.
– Releasing a skill to the Huawei HiLens skill market
Set the release information by referring to Table 8-10.

Table 8-10 Parameters for releasing a skill to the skill market


Parameter Description

Publish Service to which the skill is to be released.


Select HiLens Skill Market.

Billing Policy Billing policy for releasing the skill to the skill
market. The value can be Free or Charged.

Billed By Billing mode after the skill is released.


● If you select the Free billing policy, only
One-off can be selected.
● If you select the Charged billing policy,
Yearly/Monthly and One-off can be
selected.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 135


Huawei HiLens
User Guide 8 Developing Skills on the Console

Parameter Description

Measurement Unit Specifications of each license on each device.


The value can be Number of channels or QPS.
If you select Number of channels, one license
can be installed on a device to use one channel
of video.

Specification Maximum number of video channels that the


Limitation skill can process on a device or the maximum
number of concurrent video channels.

Cloud Service Type For Charged skills, developers need to contact


Huawei HiLens personnel to record the skill
Resource Type product information. The Huawei HiLens
Resource personnel will return a resource code. Enter the
Specification Code code in the Cloud Service Type, Resource
Type, and Resource Specification Code fields.

Privacy Policy User privacy policies involved in this skill.

After the release application is submitted, it will be sent to the Huawei


HiLens background for review. The review will be completed within three
working days.
After the skill is approved, it will be displayed on the Subscription > All
Skills page of the Huawei HiLens console.

8.9 Deleting Skills


You can delete skills that are no longer used to release resources.
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > Skills.
2. On the Skills page, choose More > Delete in the Operation column.
The Delete Skill dialog box is displayed.
3. Confirm the information and click OK.
NOTE

Deleted skills cannot be recovered. Exercise caution when performing this operation.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 136


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

9 Development Environment HiLens


Studio

9.1 Procedure for Using HiLens Studio


HiLens Studio is a multi-language integrated development environment (IDE)
provided for developers. It consists of a code editor, compiler, and debugger.
Developers can compile and debug skill code in HiLens Studio. After the skill code
is debugged successfully, developers can also release the skills, or deploy and run
them on devices from HiLens Studio.

NOTE

Currently, HiLens Studio supports the development and debugging of Python 3.7 and C++
skills.

Functions
Figure 9-1 shows the HiLens Studio GUI. For details about the functions, see
Figure 9-1 and Table 9-1.

Figure 9-1 HiLens Studio GUI

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 137


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-1 Functional area description


Area Function Description

1 Click to view the file directory of a development project. For


details, see Project File Directory Description.

Click to search for the desired project content.

Click to view the code source.

Click to debug the skill code on the current tab page. For details,
see Performing Breakpoint Debugging on the Code.

2 Code editing area (code editor), where you can directly edit the
code of a project.

3
Click to switch to this tab page, where you can release a skill,
install a skill, and start a skill.

Click to switch to this tab page to view the overview of the


current file.

4 Debugging area (debugger), where you can view the code


debugging result.

Using HiLens Studio to Develop Skills


This section describes how to develop skills in HiLens Studio.
Figure 9-2 shows the procedure for using HiLens Studio to develop skills and
Table 9-2 details the procedure.

NOTE

This section describes only the operations involved in developing skills in HiLens Studio. For
details about how to create a skill on the console, see Developing Skills on the Console.

Figure 9-2 Procedure for using HiLens Studio to develop skills

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 138


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-2 Procedure description


Procedure Description Detailed Instructions

Make ● Purchase HiLens Kit devices. Purchasing HiLens Kit


preparations. You must purchase the needed Devices
HiLens Kit devices to run the Subscribing to HiLens
skills you develop. Device-Edge-Cloud
● Purchase the HiLens Device- Synergy Platform
Edge-Cloud Synergy Platform Service
Service and activate your Activating Devices
devices. (Purchasing HiLens
If you register more than one Device-Edge-Cloud
device, you need to purchase Synergy Platform
the HiLens Device-Edge-Cloud Service)
Synergy Platform Service. After
you activate the devices on the
Device Management page,
you can install skills you
developed onto these devices.

Connect devices Connect to the HiLens Kit devices Registering a HiLens Kit
to the cloud. you purchase and register them Device
with the Huawei HiLens platform Registering a Device
to interconnect the devices with Using the Intelligent
the cloud. Edge System
Registering a Device
Using SSH

Develop skills. In HiLens Studio, you can create a Creating a Skill Project
skill project, compile and debug Managing Models
the skill code, and run the skill
(only for HDMI output) and view Compiling/Debugging
the output data. Code Using Real-Time
Video Streams on a
Mobile Phone

Install skills. After editing the skill code in Installing a Skill


HiLens Studio, you can directly
install the skill on your device.

Start skills. After a skill is installed on a Starting or Stopping a


device, you can directly start the Skill
skill in HiLens Studio and view the
skill running effect.

Release skills. You can release a debugged skill Releasing a Skill


from HiLens Studio to the Huawei
HiLens skill market for other users
to use.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 139


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

9.2 Applying for HiLens Studio OBT


HiLens Studio is in the open beta test (OBT) phase. If you are a first-time HiLens
Studio user, apply for the OBT permission first.
HiLens Studio of the latest version has the basic edition and professional edition.
For new users, you need to select whether to enable the basic edition or
professional edition when applying for the OBT. For details about the editions, see
Edition Description. For details about how to apply for the OBT, see Applying for
the OBT.

Edition Description
The difference between the basic edition and professional edition of HiLens Studio
lies in whether dedicated inference resources are used exclusively. For details
about the basic edition, see Table 9-3. For details about the professional edition,
see Table 9-4.

Table 9-3 HiLens Studio Basic Edition

Resource Function Billing Mode Billing Description

Storage Creating skill Pay-per-use You will be billed for the


space projects and storage capacity that
uploading models exceeds 5 GB used by the
and data main account and sub-
accounts.
Storage space of less than
5 GB is free of charge.

Physical Debugging and Free of charge -


resources running skills
(shared)

Table 9-4 HiLens Studio Professional Edition

Resource Function Billing Billing Description


Mode

Storage Creating skill Pay-per-use You will be billed for the


space projects and storage capacity that exceeds
uploading models 5 GB used by the main
and data account and sub-accounts.
Storage space of less than 5
GB is free of charge.

Physical Debugging and Pay-per-use You will be billed for the


resources running skills accumulated compute
(dedicated duration of the main account
) and sub-accounts.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 140


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Resource Function Billing Billing Description


Mode

Yearly/ You can purchase a resource


Monthly package. During the validity
(computing period of a resource package,
resource if you use more resources
package) than those included in the
package, you will be billed on
a pay-per-use basis for the
excess resources used.
After you purchase a yearly/
monthly computing and
inference resource package of
HiLens Studio Professional
Edition, HiLens Studio
Professional Edition will be
automatically enabled.

Yearly/ During the validity period of


Monthly your yearly/monthly
subscription, all your usage is
covered by this subscription
without generating extra fees.
After your subscription
expires, you will be
automatically switched to the
pay-per-use mode.
After you purchase a yearly/
monthly computing and
inference resource package of
HiLens Studio Professional
Edition, HiLens Studio
Professional Edition will be
automatically enabled.

Prerequisites
1. Register a HUAWEI CLOUD account and complete real-name authentication.
For details, see Account Registration Process and Real-Name
Authentication.
2. HiLens Studio is in the OBT phase. The latest version includes the basic
edition and professional edition. You will be charged for the functions or
resources you use based on the selected edition. For details, see Edition
Description. Therefore, to ensure that all functions of HiLens Studio work
properly, you are advised to ensure that your account balance is sufficient.

Applying for the OBT


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 141


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

The HiLens Studio OBT Version Upgrade dialog box is displayed.

Figure 9-3 HiLens Studio OBT Version Upgrade

2. Click and read the OBT Trial Use Agreement. Select I have read and agree
to the OBT Trial Use Agreement. Click Buy Basic Edition or Buy
Professional Edition as required.
Access HiLens Studio of the latest version.
For details about the differences between HiLens Studio Basic Edition and
HiLens Studio Professional Edition, see Edition Description.

9.3 Subscribing to or Unsubscribing from a Version


In addition to subscribing to a HiLens Studio version in Applying for HiLens
Studio OBT, you can also switch or unsubscribe from the version on the HiLens
Studio console.

Prerequisites
● Ensure that the HUAWEI CLOUD account is not in arrears. Developing skills
on the Huawei HiLens console may occupy OBS resources and incur fees. For
details about the OBS pricing, see Product Pricing Details.
● You have applied for the HiLens Studio OBT and the application has been
approved. For details, see Applying for HiLens Studio OBT.

Subscribing to a Version
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
The HiLens Studio page is displayed.
2. Click the account name in the upper right corner and select Subscription
Center from the drop-down list.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 142


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Figure 9-4 Subscription center

3. In the dialog box that is displayed, select the target HiLens Studio version and
click OK.
For details about the basic and professional editions of HiLens Studio, see
Edition Description.

Figure 9-5 Subscribing to HiLens Studio

Unsubscribing from a Version


If you do not need HiLens Studio any more, you can unsubscribe from HiLens
Studio.

NOTE

This operation will permanently delete your data stored in HiLens Studio and the data
cannot be recovered. Exercise caution when performing this operation.

1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
The HiLens Studio page is displayed.
2. Click the account name in the upper right corner and select Subscription
Center from the drop-down list.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 143


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Figure 9-6 Subscription center

3. In the dialog box that is displayed, select Unsubscribe and click OK.

Figure 9-7 Unsubscribing from HiLens Studio

9.4 Creating a Skill Project


This section describes how to use HiLens Studio to create a skill project, organize
the skill files for compilation and debugging, and develop a new skill.

Prerequisites
● Ensure that the HUAWEI CLOUD account is not in arrears. Developing skills
on the Huawei HiLens console may occupy OBS resources and incur fees. For
details about the OBS pricing, see Product Pricing Details.
● You have applied for the HiLens Studio OBT and the application has been
approved. For details, see Applying for HiLens Studio OBT.
● The algorithm model used for creating a skill has been imported to Huawei
HiLens.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 144


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

NOTE

The skills purchased in the skill market cannot be opened in HiLens Studio. You can select a
skill template in HiLens Studio to create a skill project. For details, see Creating a Skill
Project.

1. Creating a Skill Project


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
Wait about 30 seconds. The HiLens Studio page is displayed.
2. On the HiLens Studio page, select New Project from the File drop-down list.
The Select Template to Create HiLens Studio Project dialog box is
displayed.
3. In the Select Template to Create HiLens Studio Project dialog box, select
the skill template that you want to use and click Create Skill.
The Create Skill page is automatically displayed. The default configuration of
the selected template is automatically loaded. You can view the related
information on the right pane of the page.

Figure 9-8 Creating a skill

2. Filling In Basic Information


After an existing skill template is selected, the default parameter settings of the
skill template are automatically loaded. See Table 9-5. You must enter Name and
Skill Version.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 145


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-5 Basic information


Parameter Description

Skill Templates Whether to use a template to develop a skill. If you use


HiLens Studio to create a skill, an existing template with a
preset model and code is used by default. That is, all
parameters in the Skill Content module use the values
specified by the template.

Template selected Name of the selected skill template.

Name Name of the skill. The name is also used as the root
directory name when the skill is delivered to a device.
The skill name cannot be the same as the name of the
selected template.
The name is a string of 3 to 48 characters that can contain
only letters, digits, hyphens (-), and underscores (_). It must
start with a letter, and end with a letter or digit.
NOTE
Skills in the skill market cannot share the same name. If you want
to release a skill to the skill market, use a globally unique name to
name the skill.

Skill Version Skill version. The version number is in the format of A.A.A,
where A is a natural number consisting of a maximum of
three digits, for example, 1.0.0.
If A contains more than one digit, it cannot start with 0.
For example, 01.0.0 is not allowed.

Chip Chip supported by the skill. For skills running on HiLens Kit
devices, select the Ascend 310 chip.

Skill Code Value Used for skill verification to prevent fake skills. The value
must be the same as that on the initialization interface in
the code. For details about the usage, see Initializing the
HiLens Framework in the Huawei HiLens Developer Guide.

Applicable Application scenarios where Huawei HiLens skills apply. The


Scenario value can be sub-scenarios of Campus, Home, In Vehicle
Device, or Mall and Supermarket. If no proper scenario is
available, select Others and enter the scenario name in the
text box.

Icon Icon of the skill

OS Platform Operating system platform where the skill runs, including


Linux, Android, iOS, LiteOS, and Windows. The HiLens Kit
device uses the Linux distribution EulerOS developed based
on CentOS. Therefore, if the skill is to run on HiLens Kit
devices, select Linux.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 146


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Parameter Description

Description Detailed description about the skill. Enter a maximum of


2,048 characters.
NOTE
If messages need to be sent to users' mobile phones or email
addresses, (for example, when a stranger is detected, a message
needs to be sent to notify the user), you need to add This skill
supports notification messages. in the description. The message
to be sent needs to be specified in Compiling/Debugging Code
Using Real-Time Video Streams on a Mobile Phone. For details,
see the Huawei HiLens Developer Guide.

3. (Optional) Setting Runtime Configurations


You need to set parameters for some running skills. For example, import facial
image libraries when using facial recognition skills. If users configure runtime
configurations when running a skill, Huawei HiLens will record the configurations
in the code for other developers to use. You can click Add Tag on the page and
enter your configuration by referring to Table 9-6.
You can also click Preview JSON to view the runtime configuration's format.
Developers can obtain the skill configurations in JSON format through the
get_skill_config interface provided by the HiLens Framework and read the field
values to use the user configurations.
The runtime configurations in JSON format are as follows:
{
//Global configuration
"Language": "enum",
//Channel-based video configuration
"multi_camera": [ //The key value multi_camera is fixed, indicating the channel-based camera
configuration.
{
"camera_names": [ //The key value camera_names is fixed, indicating the cameras included in
the group configuration.
"cameraX",
"cameraY"
],
"FaceLib": { //Configuration name
"from": "file source", //File type value, indicating the service from which the file comes, for
example, OBS.
"path": "file path" //File type value, indicating the file path.
}
}
],
}

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 147


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-6 Skill runtime parameters


Parameter Description

Name Configuration name. This field can be used to obtain the


configuration value in the logic code. A runtime
configuration refers to the content configured by users
when a skill is running. For example, facial recognition
skills require users to upload facial image libraries. Note
that the runtime configuration is optional. If a
configuration is added, the configuration Name and
Description are mandatory.

Value Type Type of the value of a configuration item.


The value can be int, float, enum, string, or file.

Constrain Value range of the configuration. This parameter is related


to the value type.
● Numeral type (int and float): The value range is an
open or closed interval. For example, [1, 100) indicates
that the value is greater than or equal to 1 and less
than 100.
● string and file: You do not need to set this parameter.
● enum: The value range is a set, for example, {a, b}.

Explanation Describes the function of the configuration item and how


to configure it. This field is important. Users can set a
configuration based on the description here. Therefore,
if a skill has a runtime configuration, developers must
explain it clearly.

Object A HiLens Kit device can connect to multiple external


cameras (the number of cameras cannot be greater than
the total number of channels supported by the skills
installed on the device). Therefore, you can develop skills
that support multiple video channels.
● If you select Video, the configuration takes effect for
videos of each camera on the device. For example,
camera 1 and camera 2 use different facial image
libraries.
● If you select Global, all cameras on the device use the
same configuration value.

4. Confirming the Information and Entering HiLens Studio


Confirm the information and click OK to enter the HiLens Studio startup page.
After setting the required parameters, you can view the parameter values on the
right pane. If a parameter is incorrectly set, a red cross is displayed on the right.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 148


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

NOTE

● After confirming the information, you must access the HiLens Studio page to view the
created skill project. Otherwise, an empty project will be created, and the skill project
file cannot be opened on the HiLens Studio page.
● If the HiLens Studio page cannot be opened, check whether the browser is configured to
block pop-up windows. If the browser is configured to block pop-up windows, add the
HiLens Studio website to the address whitelist of the browser.

9.5 Managing Models

9.5.1 Developing Models

Prerequisites
Currently, the HiLens Kit AI chip supports only .om models, which can be
converted from TensorFlow or Caffe models. However, .om models do not support
all operators of the TensorFlow and Caffe models. Therefore, you need to use
operators supported by .om models during TensorFlow/Caffe model development.
In this case, the TensorFlow and Caffe models can be converted into .om models.
For details about the TensorFlow and Caffe operator boundaries supported by .om
models, see Caffe Operator Boundaries and TensorFlow Operator Boundaries.

NOTE

.om models are not fully compatible with the built-in Keras APIs of TensorFlow.
.om models do not support Caffe2.

Developing Models Using ModelArts


ModelArts is a one-stop development platform for AI developers. You can use
ModelArts to develop algorithm models used on the Huawei HiLens platform.

After a model is developed or trained using ModelArts, it is stored in the model list
of ModelArts. For details, see the ModelArts User Guide. Currently, Huawei
HiLens supports only the algorithm models developed using TensorFlow and Caffe
engines. Therefore, you are advised to select a correct engine type and model
storage format when using ModelArts for development.

Models generated by ExeML of ModelArts cannot be used on the Huawei HiLens


platform.

Developing Models Offline


You can use a familiar algorithm model development tool to develop an algorithm
model locally.

Currently, only the algorithm models developed by TensorFlow or Caffe engines


are supported, and the models you developed must be saved in .pb
or .caffemodel format. Then, use the model import/conversion function of
Huawei HiLens to convert the models to the .om format supported by Ascend 310
chips.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 149


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Follow-up Operations
After developing models, you need to import them to HiLens Studio either from a
local path or an OBS bucket. For details, see Importing/Converting a Locally
Developed Model.

9.5.2 Importing/Converting a Locally Developed Model


A skill consists of an algorithm model and logic code. The algorithm model
handles AI inference, and the logic code handles inference result processing.
Before developing a skill, you need to import models into HiLens Studio.

This section describes how to import locally developed models to HiLens Studio
and how to convert non-om models in HiLens Studio.

Model Requirements
The models to be imported can be in .om, .pb, or .caffemodel format. Only .om
models can run on HiLens Kit devices. .pb and .caffemodel models must be
converted to .om after they are imported.

Not all models can be successfully converted. Before importing and converting a
model, check whether it uses the TensorFlow and Caffe operator boundaries
supported by models in .om format. For details, see Caffe Operator Boundaries
and TensorFlow Operator Boundaries.

Prerequisites
A model has been developed on your local PC. For a locally developed Caffe
model, uploaded files include .caffemodel, .prototxt, and the configuration
file .cfg. For a TensorFlow model, uploaded files include TensorFlow model file .pb
and configuration file .cfg.

Importing/Converting a Model
For a locally developed model, you need to import it to HiLens Studio first. For a
non-om model, you also need to convert it in HiLens Studio.

Figure 9-9 shows the process of importing and converting a model. Table 9-7
provides the operation guide.

Figure 9-9 Importing and converting a locally developed model

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 150


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-7 Importing/Converting a model

Operation Method Operation Guide

Step 1: Import a Model to Method 1: Importing a Importing a Locally


HiLens Studio model from the local Developed Model to
PC HiLens Studio

Method 2: Importing a Importing a Model


model from OBS from OBS to HiLens
Studio

Step 2: Convert the Model Method 1: Converting Converting a Model


in HiLens Studio the model using Using Commands
commands

Method 2: Converting Converting a Model on


the model on the the HiLens Studio Page
HiLens Studio page

Importing a Locally Developed Model to HiLens Studio


1. Click in the upper left corner of the HiLens Studio page. The file directory
of the development project is displayed on the left.
2. In the file directory area of the development project, right-click a folder or a
blank area and choose Upload Files... from the shortcut menu. Then, select a
developed model file on the local PC and import it to HiLens Studio.
– Caffe models: Upload the .caffemodel and .prototxt files. Upload
the .cfg configuration file based on service requirements.
– TensorFlow models: Upload the .pb file. Upload the .cfg configuration
file based on service requirements.

Importing a Model from OBS to HiLens Studio


Before importing a model from OBS to HiLens Studio, you need to first upload the
model to OBS. For details, see Uploading a Model to OBS. Then, you can import
the model to HiLens Studio using either Importing a Model to HiLens Studio or
Dragging a Model to HiLens Studio:

● Uploading a Model to OBS


Upload a custom model to OBS. For a Caffe model, uploaded files
include .caffemodel, .prototxt, and the configuration file .cfg. For a
TensorFlow model, uploaded files include .pb and configuration file .cfg. For
details about the upload operation, see Object Storage Service Getting
Started. The OBS folder to which a model file is uploaded must meet
specified requirements. For details, see Model Input Directory Specifications.
Uploading files to OBS is charged. For details about the OBS pricing, see
Product Pricing Details. When uploading files to OBS, ensure that the OBS
bucket and Huawei HiLens are in the same region and the OBS folder name
meets the following requirements:
– The folder name cannot contain the following special characters: \:*?"<>|

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 151


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

– The folder name cannot start or end with a period (.) or slash (/).
– The absolute path of the folder can contain a maximum of 1,023
characters.
– The folder name cannot contain two or more adjacent slashes (/).
● Importing a Model to HiLens Studio
a. On the HiLens Studio page, click and click folder model in the file
directory.
b. Select the folder to which the model is imported.
c. Choose File > Import File(s) from OBS.
The Import File(s) from OBS dialog box is displayed.
d. Select the OBS bucket for storing the model from the Bucket drop-down
list, and select the model path.
e. Click Import.
The model file is imported to HiLens Studio.

NOTE

In addition to model files, you can choose File > Import Files from OBS on the HiLens
Studio page to import other files from OBS based on service requirements.
● Dragging a Model to HiLens Studio
a. On the HiLens Studio page, choose View > OBS.
The OBS bucket and folder list are displayed on the right of the HiLens
Studio page.
b. Select the OBS bucket for storing the model from the Bucket drop-down
list, and drag the model file to the model folder of the skill project on the
left to quickly import the model file from OBS.
NOTE

In addition to model files, you can also quickly import other files from OBS by
dragging them.

Converting a Model Using Commands


1. After importing the model to HiLens Studio, choose Terminal > New
Terminal in the upper part of the HiLens Studio page.
A terminal is created.
2. On the terminal, run the following command to convert the model:
– tensorflow
omg --model=./yolo3_resnet18.pb --input_shape='images:1,288,512,3'
--framework=3 --output=./yolo3_resnet18 --insert_op_conf=./aipp.cfg
– caffe
omg --model=./mobilenet_yolov3_deploy.prototxt --weight=./
mobilenet_yolov3.caffemodel --insert_op_conf=./aipp_yolo.cfg --
framework=0 --output=./mobilent_yolo
For details about the parameters, see "Converting Caffe/TensorFlow Models".

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 152


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Converting a Model on the HiLens Studio Page


1. Import a model to HiLens Studio and open a skill project on the HiLens Studio
page.
2. Click on the left of the HiLens Studio page.
The file directory of the development project is displayed on the left. For
details, see Project File Description.
3. Right-click the model folder and choose Convert Model from the shortcut
menu.
The Convert Model dialog box is displayed.
4. Set model conversion information based on Table 9-8 and click OK.

Table 9-8 Convert Model parameters


Parameter Description

Model Path Path of the model file to be converted in the skill project
folder. Generally, models are imported to the model folder.

Configuration Path of the configuration file of the model to be converted


in the skill project folder. For example, model/
aipp_rgb.cfg.

Output Path Output path after model conversion.

Type Model conversion type. The value can be TF-FrozenGraph-


To-Ascend-HiLens or Caffe to Ascend.
● TF-FrozenGraph-To-Ascend-HiLens
TensorFlow frozen graph models can be converted into
models that can run on Ascend chips.
● Caffe to Ascend
Caffe models can be converted into models that can run
on Ascend chips.

Advanced Advanced options. You can set the values when the model
Options conversion type is set to TF-FrozenGraph-To-Ascend-
HiLens, including tensor shape and output node. For
details, see Table 9-9.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 153


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-9 Advanced Options


Parameter Description

Input Tensor Shape Input Tensor Shape. If you select a model (non-OM
model) whose format needs to be converted for
Model Source and the conversion type is TF-
FrozenGraph-To-Ascend-HiLens or TF-SavedModel-
To-Ascend-HiLens, you must enter the tensor shape.
Input Tensor Shape: Enter the shape of the input
data of the model. The input data format is NHWC,
for example, input_name:1,224,224,3. This
parameter is mandatory. input_name must be the
node name in the network model before model
conversion. This parameter is mandatory when the
model has dynamic shape input. For example, in
input_name1:? ,h,w,c, the question mark (?)
indicates the batch size, that is, the number of
images processed at a time. It is used to convert the
original model with a dynamic shape into an offline
model with a fixed shape.
Use commas to separate multiple inputs.

out_nodes out_nodes: specifies the output node, for example,


node_name1:0;node_name1:1;node_name2:0.
node_name must be the node name in the network
model before model conversion. The digit after each
colon (:) indicates the sequence number of the
output. For example, node_name1:0 indicates the
0th output of node_name1.

input_format input_format: The default data input format is


NHWC. To use the NCHW format, you need to set
this parameter to NCHW.

net_format net_format: specifies the preferred data format for


network operators. The value can be ND (N=4) or
5D. This parameter only takes effect if the input data
of operators on the network supports both ND and
5D formats. ND indicates that operators in the model
are converted into NCHW format. 5D indicates that
operators in the model are converted into Huawei-
developed 5D format. 5D is the default value.

fp16_high_precsion fp16_high_prec: specifies whether to generate a


high-precision FP16 Davinci model.
● The default value is 0, indicating that a common
FP16 Davinci model with better inference
performance is generated.
● The value 1 indicates that a high-precision FP16
Davinci model with better inference precision is
generated.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 154


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Parameter Description

output_type output_type: The default value is FP32. It is


recommended for classification and object detection
networks. For image super-resolution networks,
UINT8 is recommended for better inference
performance.

9.5.3 Importing/Converting Models Developed on ModelArts


A skill consists of an algorithm model and logic code. The algorithm model
handles AI inference, and the logic code handles inference result processing.
Before developing a skill, you need to import models into HiLens Studio.
This section describes how to import models developed on ModelArts to HiLens
Studio and how to convert non-om models in HiLens Studio.

Prerequisites
You have trained models on ModelArts. For details, see ModelArts
Documentation. Huawei HiLens can convert only the following built-in algorithms
of ModelArts:
● yolov3_resnet18 (object detection and locating)
● ResNet_v1_50 (image classification)
NOTE

● Models developed by ExeML of ModelArts cannot be imported to Huawei HiLens.


● Huawei HiLens can import only the model files instead of models trained on ModelArts.

Importing (Converting) a Model


1. On the left of the HiLens Studio page, click .
The list of models trained on ModelArts is displayed on the left of the page.
2. Select the model you want to import or convert and click Apply in the
Operation column.
– If the model is in om format, the message Model imported successfully
is displayed in the lower right corner of HiLens Studio after the model is
imported successfully. The newly imported model file is displayed in the
model folder.
– If the model is not in om format, the Convert Model dialog box is
displayed.
Set model conversion information based on Table 9-10 and click OK.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 155


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-10 Convert Model parameters


Parameter Description

Model Path Path of the model file to be converted in the skill project
folder. Generally, model files are imported to the
save_model folder.

Configurati Path of the configuration file of the model to be


on converted in the skill project folder. For example,
save_model/aipp_rgb.cfg.

Output Output path after model conversion.


Path

Type Model conversion type. The value can be TF-


FrozenGraph-To-Ascend-HiLens or Caffe to Ascend.
● TF-FrozenGraph-To-Ascend-HiLens
TensorFlow frozen graph models can be converted
into models that can run on Ascend chips.
● Caffe to Ascend
Caffe models can be converted into models that can
run on Ascend chips.

Advanced Advanced options. You can set the values when the
Options model conversion type is set to TF-FrozenGraph-To-
Ascend-HiLens, including tensor shape and output node.
For details, see Table 9-11.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 156


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-11 Advanced Options


Parameter Description

Input Tensor Input Tensor Shape. If you select a model (non-


Shape OM model) whose format needs to be converted
for Model Source and the conversion type is TF-
FrozenGraph-To-Ascend-HiLens or TF-
SavedModel-To-Ascend-HiLens, you must enter
the tensor shape.
Input Tensor Shape: Enter the shape of the input
data of the model. The input data format is
NHWC, for example, input_name:1,224,224,3.
This parameter is mandatory. input_name must
be the node name in the network model before
model conversion. This parameter is mandatory
when the model has dynamic shape input. For
example, in input_name1:? ,h,w,c, the question
mark (?) indicates the batch size, that is, the
number of images processed at a time. It is used
to convert the original model with a dynamic
shape into an offline model with a fixed shape.
Use commas to separate multiple inputs.

out_nodes out_nodes: specifies the output node, for


example,
node_name1:0;node_name1:1;node_name2:0.
node_name must be the node name in the
network model before model conversion. The digit
after each colon (:) indicates the sequence
number of the output. For example,
node_name1:0 indicates the 0th output of
node_name1.

input_format input_format: The default data input format is


NHWC. To use the NCHW format, you need to
set this parameter to NCHW.

net_format net_format: specifies the preferred data format


for network operators. The value can be ND
(N=4) or 5D. This parameter only takes effect if
the input data of operators on the network
supports both ND and 5D formats. ND indicates
that operators in the model are converted into
NCHW format. 5D indicates that operators in the
model are converted into Huawei-developed 5D
format. 5D is the default value.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 157


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Parameter Description

fp16_high_precsio fp16_high_prec: specifies whether to generate a


n high-precision FP16 Davinci model.
● The default value is 0, indicating that a
common FP16 Davinci model with better
inference performance is generated.
● The value 1 indicates that a high-precision
FP16 Davinci model with better inference
precision is generated.

output_type output_type: The default value is FP32. It is


recommended for classification and object
detection networks. For image super-resolution
networks, UINT8 is recommended for better
inference performance.

9.6 Compiling/Debugging Code Using Real-Time Video


Streams on a Mobile Phone
After creating a skill development project or opening an existing project, you can
edit and debug the skill logic code in HiLens Studio to develop your own skills.
The skill project provides a skill template, based on which you can develop your
own skill code. For details, see Compiling the Logic Code.
After editing the skill code, you can debug the code using real-time video streams
on a mobile phone. You can use real-time video streams of the mobile phone
camera as the skill input and view the skill output. For details, see Debugging
Code Using Real-Time Video Streams on a Mobile Phone.
In addition, you can use the preset video streams to debug code. For details, see
Debugging Code Using Preset Video Streams.

Prerequisites
Open a skill development project in HiLens Studio:
● Creating a Skill Project
● Opening an Existing Skill Project

Project File Description


Click in the upper left corner of the HiLens Studio page. The file directory of
the development project is displayed on the left. Open the project's source code
file src. The detailed code is displayed in the editing area of HiLens Studio. You can
directly edit the code.
The file directory is detailed as follows:
Development project name/
|── .hilens

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 158


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

├── rtmp_source Generated UUID, which is used to form the temporary address of the skill RTMP
stream-pushing by mobile phones.
├── rtmp.txt Generated UUID, which is used to form the temporary address of the skill RTMP stream-
pushing.
├── skill_info.json Metadata of the project.
|── .theia
├── launch.json Project startup configuration.
├── tasks.json Task configuration.
├── setting.json C/C++ configuration. Currently, the cpp compilation path is configured, which is an
important part of C++ code redirection.
|── build
├── CMakeLists.txt File
├── kit_package_install.sh Script used to package skills to be deployed to the HiLens Kit devices. This
script can be customized to specify the skills to be deployed.
├── build.sh Project compilation script.
├── clean.sh Project cleaning script.
├── prebuild.sh Pre-processing script for project startup.
├── postbuild.sh Post-processing script after project execution.
├── output Compilation product.
├── kit Compilation product of HiLens Kit.
├── studio Compilation product of HiLens Studio.
├── lib Third-party library of the C++ project.
├── data Data required by the project.
├── model Model file.
├── src Source code of the project.
├── test Test data.
├── cameras0.mp4 Default video file read by Video Capture in HiLens Studio.

Project File Operations


You can right-click a project file and perform operations on the file based on your
service requirements. For details, see Table 9-12.

Table 9-12 Project file operations


Operation Description

New File Create a skill.

New Folder Create a folder.

Open Open the current file.

Open in Terminal Open the terminal panel. You can


install third-party libraries. For details,
see Installing Third-Party Libraries.

Find in Folder Search for or replace a keyword in the


current file.

Copy Download Link Copy the link for downloading the


current file.

Upload Files Upload a local file to the current


folder.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 159


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Operation Description

Ultra Download Download the current file or folder to


a local PC. It can also back up skill
projects. For details, see Backing Up
Skill Projects.
NOTE
● To ensure service performance, the size
of the file downloaded from HiLens
Studio is within 100 MB.
● To download a large file, use OBS to
back up the project and download the
project file whose size exceeds the
upper limit.

Delete Delete the current file or folder.

Duplicate Copy the current file or folder.

Rename Rename the current file or folder.

Backing Up Skill Projects


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
The HiLens Studio page is displayed.
2. Click File in the upper left corner and select Backup Project(s) to OBS from
the drop-down list.
3. In the dialog box that is displayed, select Back up all projects to OBS and
click OK.
After the projects are backed up, the message Tasks are finished...... is
displayed in the lower right corner.
If any project fails to be backed up, you can right-click the project and choose
Download from the shortcut menu to download the project to the local PC.

Compiling the Logic Code


Open the project's source code file src. Then, you can directly edit the skill's logic
code in the editing area of HiLens Studio.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 160


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Figure 9-10 Editing area

Huawei HiLens provides a HiLens Framework, which encapsulates bottom-layer


APIs to implement common management functions, enabling you to easily
develop skills and the AI ecosystem. For details about the guide and APIs, see the
Huawei HiLens Developer Guide.

Debugging Code Using Real-Time Video Streams on a Mobile Phone


The HiLens Studio debugger allows you to use breakpoint and single-step
debugging to work with the editor. During code debugging, you can log in to
HiLens Studio using a mobile phone and use the real-time video streams of the
mobile phone camera as the skill input and view the skill output.

● Step 1: Bind a Mobile Phone to a HiLens Studio Account


a. In the upper right corner of the HiLens Studio page, click the username
and choose Connect to Mobile Phone Camera (Beta).
The Connect to Mobile Phone Camera (Beta) dialog box is displayed.

Figure 9-11 Logging in to HiLens Studio using a mobile phone

b. Follow the instructions in the Connect to Mobile Phone Camera (Beta)


dialog box to scan the QR code.
The EI Experience Space mini program is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 161


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Figure 9-12 Scanning the QR code

c. In the EI Experience Space mini program, choose HiLens Studio.


The HiLens Studio mini program page is displayed.
d. On the HiLens Studio console page, click Next in the Connect to Mobile
Phone Camera (Beta) dialog box.
The QR code of the camera is displayed in the dialog box.

Figure 9-13 Camera stream pushing QR code

e. On the HiLens Studio mini program page, select the user agreement and
click Scan to scan the QR code in step 4.
The mobile phone debugging page is displayed. Table 9-13 describes the
functions of the mobile phone debugging page. In this case, the mobile
phone is bound to the HiLens Studio account, and you can use the real-
time streams of the mobile phone camera to debug skills online.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 162


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Table 9-13 Mobile phone debugging functions


No. Description

1 Name of the skill to be debugged on the mobile phone and


real-time input video streams.
Click the skill name to switch the skill. On the page that is
displayed, select a new skill and click OK.

2 Output video stream of the skill that is being debugged.

3 In the Operation column, you can perform the following


operations:
● Front Camera: Switch the phone camera to the front
camera.
● Rear Camera: Switch the phone camera to the rear camera.
● Pause: Pause the debugging or running of the current skill.
● Back: Exit the current mobile phone debugging page and
return to the HiLens Studio mini program page.

● Step 2: Debug and Run Skill Code


a. Click the left of the code in the HiLens Studio editing area. A breakpoint
is displayed.

Figure 9-14 Setting the breakpoint

b. Debug the code.


Click in the navigation bar on the top of the HiLens Studio page and
choose Read Stream from Mobile Phone.

Figure 9-15 Read Stream from Mobile Phone

View the code debugging information in Debug Console in the lower


part of the HiLens Studio page.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 163


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Figure 9-16 Debug Console

c. Run the code.


After the code is debugged, you can run the code to view the skill output.
Click in the navigation bar on the top of the HiLens Studio page.
After the HDMI skill code is executed, you can view the skill output on
the HiLens Studio mini program page.
You can also click on the right of the HiLens Studio console page to
view the skill output in the Video Output area.

Figure 9-17 Skill output

Debugging Code Using Preset Video Streams


The HiLens Studio debugger allows you to use breakpoint and single-step
debugging to work with the editor.
1. Click the left of the code in the HiLens Studio editing area. A breakpoint is
displayed.

Figure 9-18 Setting the breakpoint

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 164


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

2. Debug the code.


Method 1: Click in the navigation bar on the top of the HiLens Studio
page and choose Read Stream from File.

Figure 9-19 Read Stream from File

Method 2: Click on the left of the HiLens Studio page. In the Debug area
that is displayed, click to debug the code.

Figure 9-20 Debugging area

Method 3: Press shortcut Key F5 to debug the code.


View the code debugging information in Debug Console in the lower part of
the HiLens Studio page.

Figure 9-21 Debug Console

3. Run the code.


After the code is debugged, you can run the code to view the skill output.
Click in the navigation bar on the top of the HiLens Studio page.
After running the code of an HDMI skill, click on the right of the HiLens
Studio page and view the skill output in the Video Output area.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 165


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

If video streams fail to be obtained, click in the upper right corner of the
Video Output area to obtain the video streams again.

Figure 9-22 Skill output

Follow-up Operations
After the skill code is edited and debugged, you can install the debugged skill on
the device. For details, see Installing a Skill.

9.7 Adapting to HiLens Studio of the Latest Version

9.7.1 Adapting Models to HiLens Studio


Only models of the C7X version are supported in HiLens Studio, whose
development kit has been upgraded to C7X, while models of the C3X version are
supported on HiLens Kit devices. In addition, OpenCV has been upgraded from
3.4.2 to 4.2.0 accordingly. Skills developed using the development kit of an earlier
version cannot run properly on HiLens Studio of the latest version. Therefore, you
need to adapt the skills. Table 9-14 lists the adaptation operations.

Table 9-14 Adaptation operations

Programming Adaptation Operation


Language

C++ ● Modifying Skill Files


● Modifying the Model Configuration File
● Loading Models
● Post-Processing Models
● Upgrading OpenCV

Python ● Loading Models


● Post-Processing Models

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 166


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Preparations
The device firmware needs to be upgraded to 1.3.0, so that the model
configuration file used by the new version of HiLens Studio can be compatible
with models of different versions. For details about how to upgrade the firmware,
see Upgrading HiLens_Device_Agent Firmware.
If the device firmware version is earlier than 1.3.0, skills may fail to run properly.

Modifying Skill Files


Modify the CMakeLists.txt, prebuild.sh, build.sh and clean.sh files.
● CMakeLists.txt
Modify the following content:
project(main)

# Use the C++11 standard.


set(CMAKE_CXX_STANDARD 11)

# Header files
include_directories(${CMAKE_SOURCE_DIR}/../src/main/cpp/include)
include_directories(/home/hilens/hilens_studio_sdk/include)

# Framework library
link_directories(/home/hilens/hilens_studio_sdk/lib)

# Source files
file(GLOB_RECURSE SRC_LIST "${CMAKE_SOURCE_DIR}/../src/main/cpp/*.cpp")
set(lib_srcs ${SRC_LIST})

# Debugging settings
if(STUDIO)
# Debug versions
message("Debug settings")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
else()
# Release version settings
message("Release settings")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
endif()

set(LIBS hilens_m opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs


opencv_calib3d opencv_videoio opencv_features2d opencv_flann opencv_photo opencv_video
jsoncpp_noabi)# libm-2.24.so)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Executable programs (without the SO field)


if(STUDIO)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output/kit/bin)
endif()

add_executable(main ${lib_srcs} ${CMAKE_SOURCE_DIR}/../src/main/cpp/main.cpp)

target_link_libraries(main ${LIBS})
● prebuild.sh
Modify the following content:
current_workspace=`pwd`
echo "cmake..."

bash build/build.sh

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 167


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

cd $current_workspace

filename=.hilens
if [ ! -d $filename ];then
mkdir $filename
fi

uuid=`cat /proc/sys/kernel/random/uuid`
echo -n $uuid > ./$filename/rtmp.txt
vid_src=`cat ./.hilens/rtmp_source`

current_workspace=`pwd`

echo "cd $current_workspace" > ~/.gdbinit


echo "set environment RTMP_PATH rtmp://127.0.0.1/live/$uuid" >> ~/.gdbinit
echo "set environment VID_SRC $vid_src" >> ~/.gdbinit
echo "handle SIG32 nostop noprint pass" >> ~/.gdbinit

● build.sh
Modify the following content:
#!/bin/sh

echo "cmake..."
cd build
# Delete a build.

if [ ! -d output ]; then
mkdir output
fi
cd output

if [ ! -d studio ]; then
mkdir studio
fi
cd studio

echo "studio build..."


export LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH
cmake ../../ -DCMAKE_BUILD_TYPE=Debug -DSTUDIO=ON && make -j
cp compile_commands.json ../../../

echo "kit cmake... "


cd ..
if [ ! -d kit ]; then
mkdir kit
fi
cd kit
cmake ../../ -DCMAKE_BUILD_TYPE=Release -DSTUDIO=OFF && make -j

● clean.sh
Modify the following content:
cd build/output
export LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH

# Delete a kit.
BUILD_DIR="kit"
if [ -d ${BUILD_DIR} ];then
echo " clean and remove build..."
cd $BUILD_DIR
make clean
cd ..
rm -rf ${BUILD_DIR}
fi

# Delete a studio.
BUILD_DIR="studio"
if [ -d ${BUILD_DIR} ];then

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 168


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

echo "clean and remove build..."


cd $BUILD_DIR
make clean
cd ..
rm -rf ${BUILD_DIR}
fi

Modifying the Model Configuration File


Models are loaded automatically with the input preprocessed based on the model
configuration file in JSON format. You are advised to save the file in the model
folder. The model path is the relative path of the current model configuration file.

Modify the model configuration file as follows (see Model Configuration Files for
details about the parameters):
{
"ModelCfgs" :
[
{
"DeviceType" : "D310_C3X",
"ModelPath": "./mask_det_c3x.om",
"FrameWorkInput": "BGR",
"ModelInput": "BGR",
"NetworkWidth": 512,
"NetworkHeight": 288,
"NetworkChannel": 2,
"ScaleMeanEnable": false
},
{
"DeviceType" : "D310_C7X",
"ModelPath": "./mask_det_c7x.om",
"FrameWorkInput": "BGR",
"ModelInput": "BGR",
"NetworkWidth": 512,
"NetworkHeight": 288,
"NetworkChannel": 2,
"ScaleMeanEnable": false
}
]
}

Loading Models
If C++ is used for development, modify the following content:
model = Model::Create(modelConfigPath);// Path passed to the model configuration file during model
creation

If Python is used for development, modify the following content:


model = hilens.Model(model_config_path) # Path passed to the model configuration file during model
creation

Post-Processing Models
If the original model is TensorFlow, the model conversion tool of the C7X version
converts the output of the TensorFlow and Caffe models into the NHWC format,
while the tool of the C3X version converts the TensorFlow model into the om type
with the output format being NCHW. Therefore, you need to perform different
post-processing operations on the HiLens Studio and HiLens Kit models and create
two code branches.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 169


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

● C++
Use # if STUDIO and # else for differentiation.
# if STUDIO // C7X version
// Perform post-processing on the model output in NHWC format.
#else // C3X version
// Perform post-processing on the model output in NCHW format.
#endif

● Python
Use the following code for differentiation:
import os
if os.getenv("SKILL_NAME"):
# Studio C7X
# Perform post-processing on the model output in NHWC format.
else:
# Kit C3X
# Perform post-processing on the model output in NCHW format.

Upgrading OpenCV
Once OpenCV in HiLens Studio C7X is upgraded from version 3.4.2 to 4.2.0, some
constants defined in OpenCV need to be modified. For details about the
modification, visit the official website of OpenCV 4.2.0.

9.7.2 Model Configuration Files


Models are loaded automatically with the input preprocessed based on the model
configuration file in JSON format. This section describes the structure of the JSON
file.

Table 9-15 Parameter description


Parameter Type Mand Description
atory

ModelCfgs ArrayList<ModelCfg> Yes Model configurations. For details about ModelCfg


descriptions, see Table 9-16.

Table 9-16 ModelCfg description


Parameter Type Mand Description
atory

DeviceType String Yes Device type, which can be D310_C32,


D310_C30, D310_B902, D310_C75,
D310_C76, D310_C77, NNIE, GPU_NVIDIA,
D310_C3X, or D310_C7X. In the preceding
types, D310_C3X can be D310_C32,
D310_C30, or D310_B902; D310_C7X can
be D310_C75, D310_C76, or D310_C77.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 170


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Parameter Type Mand Description


atory

ModelPath String Yes Model path. The path can be either


absolute or relative, the latter one being
relative to the path of the current model
configuration file.

FrameWorkInpu String Yes Framework input format, which can be


t NV21 or JPEG. The JPEG format supports
only D310 devices.

ModelInput String Yes Model input format. Currently, only NV21 is


supported. More formats may come in the
future.

NetworkWidth Integer Yes Model input width.

NetworkHeight Integer Yes Model input height.

NetworkChanne Integer Yes Number of model input channels.


l

ScaleMeanEnab Boolea No Whether to perform mean subtraction and


le n then scaling on the input. The value can be
true or false. This parameter is mandatory
when FrameWorkInput is set to JPEG.

Scale Float No Scaling value. This parameter is mandatory


when ScaleMeanEnable is set to true.

MeanR_Y Float No Average value of the R channel. This


channel is used when only one model input
channel is available. This parameter is
mandatory when ScaleMeanEnable is set
to true.

MeanG Float No Mean value of the G channel. This


parameter is mandatory when
ScaleMeanEnable is set to true.

MeanB Float No Mean value of the B channel. This


parameter is mandatory when
ScaleMeanEnable is set to true.

9.8 Remotely Connecting to HiLens Kit Devices


In HiLens Studio, you can remotely connect to HiLens Kit devices to view logs and
instance processes.

Prerequisites
At least one device exists on the Device Management > Devices page and the
device status is Online.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 171


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Procedure
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
The HiLens Studio page is displayed.
2. Click in the upper right corner. In the Skill Installation area on the right,
select the device where the skill is to be installed in the Device Name column,
and click Terminal in the Operation column.
On the Terminal window of the corresponding device, you can run Linux
commands to access the HiLens Kit system to view logs.
During skill editing, if the terminal connected to the HiLens Kit device is
opened for 10 minutes or more and no command is entered, the terminal is
automatically disconnected from the device.
3. View logs. Currently, you can view skill logs only for firmware 1.2.0 or later.
tail -f /home/log/alog/hilens/skills/developer.skill name.skill ID/
developer.skill name.skill ID.log

Figure 9-23 Terminal window

9.9 Installing Third-Party Libraries


HiLens Studio supports third-party libraries.

Prerequisites
Open a skill development project in HiLens Studio:
● Creating a Skill Project
● Opening an Existing Skill Project

Procedure
1. On the HiLens Studio page, choose Terminal > New Terminal. The terminal
window of the skill is displayed.
Alternatively, right-click and choose Open in Terminal from the shortcut
menu to open the terminal window of the skill.

Figure 9-24 Opening the Terminal window

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 172


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

2. Run the following command to install a third-party library:


pip3 install <package> --user
After the installation is complete, you can view the installation result in the /
home/huser/.local/lib/python3.7/site-packages/ directory.

9.10 Installing a Skill


After the code of a skill is successfully debugged and run in HiLens Studio, you can
install the skill on your device directly from HiLens Studio to view the skill running
effect and determine whether the skill meets your service requirements.

Prerequisites
● Register a HiLens Kit device with the console. For details, see Registering
HiLens Kit Devices.
● You have purchased the HiLens Device-Edge-Cloud Synergy Platform Service
and activated the device. For details, see Subscribing to HiLens Device-Edge-
Cloud Synergy Platform Service and Activating Devices (Purchasing
HiLens Device-Edge-Cloud Synergy Platform Service).
● On the Device Management > Devices page, the HiLens Kit device where the
skill is to be installed is Online. That is, the device is powered on and its
network connection is normal. For details about how to power on the device,
see Power-On Procedure.
NOTE

If you use a wireless network, ensure that the router is enabled to ensure network
connectivity.
If you use a wired network, ensure that the device is connected to a router using a
network cable to ensure network connectivity.
● A skill has been developed and debugged, and the debugging result meets
service requirements.
When customizing skills to be installed on HiLens Kit devices, to avoid
occupying too much storage space and wasting resources, you can customize
the skill packaging script kit_package_install.sh shown in Figure 9-25, so
that only the specified skill project files will be delivered to HiLens Kit devices.
For details about skill project files, see Project File Description.

Figure 9-25 Installing the skill packaging script

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 173


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Procedure
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio to start HiLens Studio.
2. Select the skill to be installed and click the skill name in the skill project list.
NOTE

If you open an empty skill project, that is, the skill project file is not displayed on the
left when you click in the upper left corner, create a skill project again.

3. Click on the right of the HiLens Studio page.


4. In the Skill Installation area on the right, select the device where the skill is
to be installed in the Device Name column and click Install in the Operation
column.
The Install Skill dialog box is displayed.

Figure 9-26 Installing a skill

5. In the Install Skill dialog box, click Yes.


If Install Successfully is displayed in the lower right corner, the skill is
successfully installed.
In the Skill Installation area on the right of HiLens Studio, you can click on
the left of the device in the Device Name column to view the skills installed
on the device.

Follow-up Operations
After a skill is successfully installed on a device, you can start the skill on the
HiLens Studio page.

9.11 Starting or Stopping a Skill


For skills that have been installed on devices, you can start or stop them on the
Huawei HiLens console or directly in HiLens Studio based on your service
requirements. After a skill is started successfully on a device, its status becomes
Running.

Prerequisites
● A skill has been developed and installed on a device. After installing a skill,
you need to start the skill so that it can run on the device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 174


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

● You can start skills only for devices in the Online status. You cannot start
skills for devices in the Offline status. For details about how to interconnect
the device side with the cloud side, see Registering HiLens Kit Devices.
● Skills in the Stopped status can be started.
● You can stop Running skills and uninstall (Uninstalling a Skill) Running or
Stopped skills.

Entering HiLens Studio


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio to start HiLens Studio.
2. Select the skill to be released and click the skill name in the skill project list.
The HiLens Studio page is displayed.

Starting a Skill
1. Click on the right of the HiLens Studio page.
2. In the Skill Installation area on the right, select the device where the skill is
to be installed in the Device Name column and click next to the device
name to view skills installed on the device.
3. Move your cursor to the Operation column of the target skill and click Start.
The Start Skill dialog box is displayed.
4. In the Start Skill dialog box, click Yes.
The message Starting the skill is displayed in the lower right corner.
The skill is being started. Skill startup involves a command delivery process, so
you need to wait for a period of time before you can view that Success to
start the skill is displayed in the lower right corner and the skill Status is
updated to Running.

Stopping a Skill
1. Click on the right of the HiLens Studio page.
2. In the Skill Installation area on the right, select the device where the skill is
to be installed in the Device name column and click next to the device
name to view skills installed on the device.
3. Move your cursor to the Operation column of the target skill and click Stop.
The Stop Skill dialog box is displayed.
4. In the Stop Skill dialog box, click Yes.
The message Start to stop skill is displayed in the lower right corner.
The skill is being stopped. Skill stop involves a command delivery process, so
you need to wait for a period of time before you can view that Success to
stop the skill is displayed in the lower right corner and the skill Status is
updated to Stopped.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 175


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

9.12 Releasing a Skill


After developing, debugging, and running the code of a skill in HiLens Studio, you
can release the skill to the skill market of Huawei HiLens. After the skill is
approved by the platform, it can be purchased and used by other users.

Prerequisites
● Ensure that the HUAWEI CLOUD account is not in arrears. Releasing skills on
the Huawei HiLens console may occupy OBS resources and incur fees. For
details about the OBS pricing, see Product Pricing Details.
● A skill has been developed and debugged, and the debugging result meets
service requirements.

Context
● Skills released to the Huawei HiLens skill market will be reviewed within three
working days. After being approved, the skills are displayed in the skill market
list.
● The name of the skill to be released cannot be the same as that of any other
skill in the skill market of Huawei HiLens.

Releasing a Skill to the Skill Market


1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio to start HiLens Studio.
2. On the HiLens Studio console, select the skill to be released and click Release
in the Operation column.

Alternatively, click the project name to go to the skill project page, click
on the right of HiLens Studio, and click Release in the HiLens Widget area.
The Release Skill dialog box is displayed.
3. Set the release information according to Table 9-17, and then click OK.

Table 9-17 Parameters for releasing a skill to the skill market

Parameter Description

Billing Policy Billing policy for releasing the skill to the skill
market. The value can be Free or Charged.

Specification Maximum number of video channels that the skill


Limitation can process on a device or the maximum number
of concurrent video channels.

Measurement Unit Specifications that can be used on the device. The


value can be Number of channels or QPS. If you
select Number of channels, one channel of video
can be used on a device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 176


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

Parameter Description

Cloud Service Type For Charged skills, developers need to contact


Huawei HiLens personnel to record the skill
Resource Type product information. The Huawei HiLens
Resource Specification personnel will return a resource code. Enter the
Code code in the Cloud Service Type, Resource Type,
and Resource Specification Code fields.

Privacy Policy User privacy policies involved in this skill

After the skill is successfully released, a message indicating the release


success is displayed. You can choose Subscription > All Skills to view the
released skill.

9.13 Uninstalling a Skill


If a skill that has been installed on a device is no longer required, you can
uninstall it on the HiLens Studio page.

Before You Start


● You can uninstall skills only from devices in the Online status. You cannot
uninstall skills from devices in the Offline status. For details about how to
interconnect the device side with the cloud side, see Registering HiLens Kit
Devices.
● Uninstalling a skill will delete the skill and skill data on the device. Exercise
caution when performing this operation.

Procedure
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio to start HiLens Studio.
2. Select the skill to be released and click the skill name in the skill project list.
The HiLens Studio page is displayed.
3. Click on the right of the HiLens Studio page.
4. In the Skill Installation area on the right, select the device where the skill is
installed in the Device Name column and click Uninstall in the Operation
column.
The Uninstall Skill dialog box is displayed.

Figure 9-27 Uninstalling a skill

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 177


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

5. In the Uninstall Skill dialog box, click Yes.


Skill uninstallation involves a command delivery process, so you need to wait
for a period of time before you can view Success to uninstall the skill in the
lower right corner of the HiLens Studio page.

9.14 Stopping a Skill Instance


Before exiting HiLens Studio, you can stop the skill instances that are running on
HiLens Studio to prevent HiLens Studio from using inference resources.
1. Log in to the Huawei HiLens console. In the navigation pane, choose Skill
Development > HiLens Studio.
The HiLens Studio page is displayed.
2. Click File in the upper left corner and select Shutdown HiLens Studio from
the drop-down list.
The Shutdown HiLens Studio dialog box is displayed.
3. Click Yes to stop the skill instance.

9.15 Managing Skill Projects


You can choose Skill Development > HiLens Studioon the Huawei HiLens console
to manage the skills developed in HiLens Studio, including viewing skill attributes,
and installing, releasing, and deleting the skills.

Skill Project Management Description


On the HiLens Studio Startup or Getting Started page, you can manage the
skills developed in HiLens Studio and oriented to Ascend chips. Skills purchased
from the skill market or created on the Skill Development page of the
management console are not supported here.

Supported Operations and Descriptions


Enter the HiLens Studio Getting Started page: On the left menu bar of the
management console, choose Skill Development > HiLens Studio. Click the skill
name in the skill project list and choose Help > Getting Started to switch to the
Getting Started page of HiLens Studio, which displays the list of skill projects
developed in HiLens Studio, including their Information (skill project information),
Details (skill details), Release Status (release status), Time (creation/
modification time), and Operations. You can perform the following operations:
● Opening a Skill Project
On the Getting Started page of HiLens Studio, you can click a skill name in
the skill project list to open and edit it.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 178


Huawei HiLens
User Guide 9 Development Environment HiLens Studio

NOTE

● If you open an empty skill project, that is, the skill project file is not displayed on
the left after you click in the upper right corner, create a skill project again.
● If the HiLens Studio page cannot be opened, check whether the browser is
configured to block pop-up windows. If the browser is configured to block pop-up
windows, add the HiLens Studio website to the address whitelist of the browser.
● Installing a Skill
● Releasing a Skill
● Viewing the Attributes of a Skill
On the Getting Started page of HiLens Studio, you can click Attributes in the
Operation column of a skill project to go to the basic information page of the
skill and view and edit its basic information. For details, see Filling In Basic
Information.
● Deleting a Skill Project
On the Getting Started page of HiLens Studio, you can click Delete in the
Operation column of a skill project in the skill project list and click Yes in the
displayed Delete Project dialog box to delete a skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 179


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10 Developing Skills Using Trainable


Skill Templates

10.1 Skill Overview


A skill can be abstractly understood as "algorithm model + logic code". The
algorithm model handles AI inference, and the logic code handles inference result
processing. For details about the skills, see Skill.
This section describes how to use trainable skill templates to develop skills on the
ModelArts Pro console. You can use trainable skill templates to develop skills
without coding. You only need to upload training data, quickly train high-precision
algorithm models, and deploy the models to devices with one click.

Skill Development Overview


As shown in Figure 10-1, skills are classified into two types based on the chip
types: skills used on HiLens Kit devices and skills used on devices that run HiSilicon
Hi35xx series chips. The Huawei HiLens platform supports quick, convenient, and
efficient skill development with skill templates, and also allows you to develop
models and logic code to meet your specific requirements in more scenarios. You
can use trainable skill templates to develop skills that meet industry scenarios. In
this way, you can upload training data without coding to improve model precision.
For details, see Process for Creating Skills Using Trainable Skill Templates.
Skills that run on HiSilicon Hi35xx series chips have high requirements on chip
memory and performance. You need to optimize the skill models. If you want to
develop skills of this type, contact Huawei HiLens platform personnel for support.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 180


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

Figure 10-1 Skill development scenarios

Process for Creating Skills Using Trainable Skill Templates


The ModelArts Pro console provides a trainable skill workflow. You can upload
data to the workflow on the ModelArts Pro console for model training. In this way,
you can quickly improve the model precision, create skills, and deploy the skills to
devices with one click without coding.

NOTE

● Using trainable skill templates to create skills means to improve the model precision
through training. The logic code of the skills cannot be modified. If you want to modify
the logic code of a skill, you can develop the skill on the Huawei HiLens console. For
details, see Developing Skills on the Console.
● Developing trainable skills occupies OBS resources and incurs charges. For details about
the OBS pricing, see Product Pricing Details.
● Developing skills using trainable skill templates occupies ModelArts training resources
and incurs charges. For details about the ModelArts pricing, see Product Pricing
Details.

Figure 10-2 shows the process of creating skills based on trainable skill templates.

Figure 10-2 Creating skills based on trainable skill templates

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 181


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

Table 10-1 Procedure for creating skills using trainable skill templates
Step Description Quick Link

Connect the device to the Connect to the Registering a HiLens Kit


cloud. HiLens Kit devices Device
you purchase and Registering a Device
register them with Using the Intelligent
the Huawei HiLens Edge System
platform to
interconnect the Registering a Device
devices with the Using SSH
cloud.

Create a skill using a Create a skill based Creating a Skill Using a


trainable skill template. on a preset trainable Trainable Skill Template
skill template.

Develop a safety helmet Develop the safety Safety Helmet Detection


detection skill. helmet detection skill Skill
based on the
workflow, generate
the safety helmet
detection model
through training
based on the
uploaded training
data, update and
adjust the model
precision to
implement the high-
precision safety
helmet detection
function, and install
the skill to the HiLens
Kit device with just
one click.

Start a skill. After a skill is Starting or Stopping


installed on a device, Skills
you can directly start
the skill in HiLens
Studio and view the
skill running effect.

10.2 Creating a Skill Using a Trainable Skill Template


This section describes how to create a skill using a trainable skill template. When
using a trainable skill template to create a skill, you can upload data to train a
model, quickly create a skill, and deploy the skill to a device with one click.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 182


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

NOTE

Using trainable skill templates to create skills means to improve the model precision
through training. The logic code of the skills cannot be modified. If you want to modify the
logic code of skills, you can use basic templates to create skills. For details, see Developing
Skills on the Console.

Prerequisites
Ensure that the HUAWEI CLOUD account is not in arrears. When developing skills
on the Huawei HiLens console, you may need to use OBS resources from HUAWEI
CLOUD, which may incur fees. For details about the OBS pricing, see OBS Pricing
Details. Developing skills using trainable skill templates may occupy ModelArts
training resources and incur fees. For details about the ModelArts pricing, see
Product Pricing Details.

Procedure
1. In the left navigation pane of the Huawei HiLens console, choose Skill
Development > Skill Templates.
The All tab page is displayed by default.
2. Click the Trainable Templates (Beta) tab.
3. Click Create Skill on the desired skill template card to create a skill.
4. If you use trainable skill templates for the first time, you need to authorize
ModelArts.
Carefully read the ModelArts service statement, select I have read and agree
to the ModelArts Service Statement, and click Agree.
If it is not your first time to use trainable skill templates, skip this step and
proceed with the next step.
5. In the Create Skill dialog box, enter the skill name, skill owner, and skill
description, select the industry, and read and agree to the OBT Trial Use
Agreement.
6. Confirm the information and click OK.
Develop the skill on the page that is displayed. For details, see Safety Helmet
Detection Skill.
You can also perform the following operations to access the page for
developing skills:
a. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Skill Development > Skills.
b. Click the Trainable Skills tab.
c. Locate the target skill and click View in the Operation column. The page
for developing skills is displayed.

10.3 Safety Helmet Detection Skill

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 183


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10.3.1 Skill Development Process


After creating a skill using the safety helmet detection skill template on the
Huawei HiLens console, you can upload data to train a model, develop a safety
helmet detection skill, and deploy the skill to a device with one click.

Figure 10-3 Process for creating a safety helmet detection skill

Table 10-2 Safety helmet detection skill


Step Description Detailed Instructions

Preparing data Before using the safety Preparing Data


helmet detection skill
template to develop
skills, you need to
prepare data for model
training and upload the
data to OBS.

Selecting data Select data and create a Selecting Data


training dataset for
subsequent model
training.

Training a model Select a pre-trained Training a Model


model and configure
parameters based on the
labeled training data to
train a safety helmet
detection model.

Evaluating a model Evaluate the model after Evaluating a Model


training.
Some common metrics,
such as precision, recall,
and F1 score, help you
effectively evaluate and
obtain a satisfactory
model.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 184


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

Step Description Detailed Instructions

Deploying an application After the model is Deploying an


prepared, you can Application
quickly create a skill and
install the skill on a
device with one click.
You can also access
HiLens Studio to
automatically create and
debug the skill.

10.3.2 Preparing Data


Before using the safety helmet detection skill template to develop skills, prepare
data for model training and upload the data to OBS.

Requirements on Datasets
● The name of files in a dataset cannot contain Chinese characters, plus signs
(+), spaces, or tabs.
● Ensure that no damaged image exists. The supported image formats include
JPG, JPEG, BMP, and PNG.
● To ensure the prediction accuracy of models, the training samples must be
similar to the actual application scenarios.
● To ensure the generalization capability of models, datasets should cover
images of all possible labels.
● Images of unlabeled data must be stored in one directory, as shown in the
following example:
├─dataset-import-example
│ IMG_20180919_114732.jpg
│ IMG_20180919_114745.jpg
│ IMG_20180919_114945.jpg
– If data is imported from an OBS path, you must have the permission to
read the OBS path.
– Images in JPG, JPEG, PNG, and BMP formats are supported.
● Labeled objects and their labeling files (in one-to-one relationship with the
labeled objects) must be in the same directory. For example, if the file name
of a labeled object is IMG_20180919_114745.jpg, that of its labeling file
must be IMG_20180919_114745.xml.
The labeling files must be in PASCAL VOC format. For details about the
format, see Table 10-3.
Example:
├─dataset-import-example
│ IMG_20180919_114732.jpg
│ IMG_20180919_114732.xml
│ IMG_20180919_114745.jpg
│ IMG_20180919_114745.xml
│ IMG_20180919_114945.jpg
│ IMG_20180919_114945.xml
A labeling file example is as follows:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 185


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<annotation>
<folder>NA</folder>
<filename>bike_1_1593531469339.png</filename>
<source>
<database>Unknown</database>
</source>
<size>
<width>554</width>
<height>606</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>Dog</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<occluded>0</occluded>
<bndbox>
<xmin>279</xmin>
<ymin>52</ymin>
<xmax>474</xmax>
<ymax>278</ymax>
</bndbox>
</object>
<object>
<name>Cat</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<occluded>0</occluded>
<bndbox>
<xmin>279</xmin>
<ymin>198</ymin>
<xmax>456</xmax>
<ymax>421</ymax>
</bndbox>
</object>
</annotation>

– Images in JPG, JPEG, PNG, and BMP formats are supported. The size of a
single image cannot exceed 5 MB, and the total size of all images
uploaded in one attempt cannot exceed 8 MB.

Table 10-3 PASCAL VOC format description

Parameter Mand Description


atory

folder Yes Directory where the data source is located

filename Yes Name of the file to be labeled

size Yes Image pixel


● width: image width. This parameter is
mandatory.
● height: image height. This parameter is
mandatory.
● depth: number of image channels. This
parameter is mandatory.

segmented Yes Segmented or not

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 186


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

Parameter Mand Description


atory

object Yes Object detection information. Multiple object{}


functions are generated for multiple objects.
● name: class of the labeled object. This
parameter is mandatory.
● pose: shooting angle of the labeled object.
This parameter is mandatory.
● truncated: whether the labeled object is
truncated (0 indicates that the object is not
truncated). This parameter is mandatory.
● occluded: whether the labeled object is
occluded (0 indicates that the object is not
occluded). This parameter is mandatory.
● difficult: whether the labeled object is
difficult to identify (0 indicates that the
object is easy to identify). This parameter is
mandatory.
● confidence: confidence score of the labeled
object. The value range is 0 to 1. This
parameter is optional.
● bndbox: bounding box type. This parameter
is mandatory. For details about the possible
values, see Table 10-4.

Table 10-4 Description of bounding box types


type Shape Labeling Information

point Point Coordinates of a point


<x>100<x>
<y>100<y>

line Line Coordinates of points


<x1>100<x1>
<y1>100<y1>
<x2>200<x2>
<y2>200<y2>

bndbox Rectangle Coordinates of the upper left and


lower right points
<xmin>100<xmin>
<ymin>100<ymin>
<xmax>200<xmax>
<ymax>200<ymax>

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 187


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

type Shape Labeling Information

polygon Polygon Coordinates of points


<x1>100<x1>
<y1>100<y1>
<x2>200<x2>
<y2>100<y2>
<x3>250<x3>
<y3>150<y3>
<x4>200<x4>
<y4>200<y4>
<x5>100<x5>
<y5>200<y5>
<x6>50<x6>
<y6>150<y6>

circle Circle Center coordinates and radius


<cx>100<cx>
<cy>100<cy>
<r>50<r>

Uploading Data to OBS


Before using ModelArts Pro to develop applications, upload data to an OBS
bucket.
1. Obtain permissions to access OBS. This function is unavailable if you have no
permission to access OBS. For details about how to obtain OBS permissions,
see Configuring Access Authorization.
2. Create an OBS bucket and folder for storing data. The OBS bucket should be
in the same region as ModelArts Pro (Currently, only CN North-Beijing4 is
supported). For details, see Creating a Bucket.
3. Upload data to OBS. For details about how to upload data to OBS, see Object
Storage Service Quick Start.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 188


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

NOTE

● When creating an OBS bucket, ensure that your OBS bucket and ModelArts Pro are
in the same region.
● You are advised to use OBS based on your service requirements and habits.
● If your data volume is small (less than 100 MB) or the number of data files is
small (less than 100), you are advised to upload data using the console. You
do not need to download tools or perform unnecessary configurations when
uploading data using the console, which is more convenient and efficient
when you upload a small amount of data.
● If your data volume is large or the number of data files is large, you are
advised to upload the files using OBS Browser+ or obsutil. OBS Browser+ is a
graphical tool that provides complete functions for managing your buckets
and objects in OBS. You are advised to use this tool to create buckets or
upload objects. obsutil is a command line tool for accessing and managing
OBS resources. If you are familiar with the command line interface (CLI),
obsutil is recommended as a good choice for batch processing and automated
tasks.
● If you need to use APIs or SDKs to upload data, or you are accustomed to
using APIs and SDKs, you are advised to use OBS APIs or SDKs to create
buckets and upload objects.
The preceding describes only the common usage methods and tools of OBS. For
details about more OBS tools, see the Object Storage Service Tools Guide.

10.3.3 Selecting Data


When using the safety helmet detection skill template to train a model, you need
to create a training dataset for subsequent model training.

Prerequisites
● You have created a skill using the trainable safety helmet detection skill
template on the Huawei HiLens console. For details, see Creating a Skill
Using a Trainable Skill Template.
● You have uploaded required data to OBS. For details, see Preparing Data.

Accessing the Skill Development Page


● Method 1: Accessing the page for the first time
You can directly access the Application Development page after creating a
skill using a trainable skill template.
● Method 2: Creating a skill and then accessing it
a. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Skill Development > Skills.
b. Click the Trainable Skills tab.
c. Locate the target skill and click View in the Operation column. The
Application Development page is displayed.

Creating Training Datasets


Choose Application Development > Select Data. On the page that is displayed,
click Create Dataset. On the Create Dataset page that is displayed on the right,
set basic information about a dataset based on its storage location and labeling
information and click OK. For details, see Table 10-5.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 189


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

Table 10-5 Parameters required for creating a dataset


Parameter Description

Name Name of a dataset to be created

Description Dataset description

Dataset Status Whether the dataset is labeled. The


options are Labeled and Unlabeled.
For details about data formats, see
Requirements on Datasets.

Upload From Mode for uploading training data.


Currently, data can only be uploaded
to OBS. Therefore the default value is
OBS.

Input Dataset Path Location where training data is stored


in OBS
Click the text box on the right of Input
Dataset Path. In the displayed dialog
box, select an OBS bucket and folder,
and click OK.

Output Dataset Path Location where the dataset to be


created is stored in OBS
There is a default path for storing a
dataset to be created. To modify it,
click Modify on the right of Output
Dataset Path. In the displayed dialog
box, select an OBS bucket and folder,
and click OK.

After creating training datasets, select the training dataset required for application
development.

Labeling Data
Labeled data is required during model training. For uploaded datasets, you can
add or modify labels. Each label should have at least five data records.
● Viewing labeling examples: Click Labeling Example on the right of Create
Dataset to view the labeling example.
● Accessing the labeling page: Click Label in the Operation column of the
dataset. On the Dashboard page that is displayed, click Label in the upper
right corner. On the displayed page, manually label data. For details, see
Labeling Data > Object Detection.

Viewing Label Parsing


After creating and selecting a training dataset, you can view the statistical data of
label samples in the Label Parsing area. The horizontal axis indicates the labels,

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 190


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

and the vertical axis indicates the number of valid samples corresponding to the
label.

Follow-up Operations
On the Application Development > Select Data page, select a training dataset,
label the data that is not labeled, and click Next to go to step Train Model. For
details, see Training a Model.

10.3.4 Training a Model


Select a pre-trained model and configure parameters based on the labeled
training data to train a safety helmet detection model.

Prerequisites
● You have created an OBS bucket and folder for storing data. The OBS bucket
and ModelArts Pro are in the same region. For details, see Creating a Bucket.
● You have created a skill based on the safety helmet detection skill template
on the Huawei HiLens console and selected a dataset. For details, see
Selecting Data.

Training a Model
Choose Application Development > Train Model and specify parameters.
● Export To
OBS path for storing the output model and data after model training. Click
the text box, select the OBS bucket and folder, and click OK.
● Pre-trained Model
Select the pre-trained safety helmet detection model saved_model.pb.
Confirm the information and click Train.
Model training takes time. After training is complete, the training details are
displayed in the lower part of the Application Development > Train Model page.

Viewing Training Details


After model training is complete, view the training details on the Application
Development > Train Model page.

Figure 10-4 Training details

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 191


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10.3.5 Evaluating a Model


The entire development process is not completed even though you have obtained
a model because the model needs to be evaluated. Typically, you cannot obtain a
satisfactory model after the first evaluation, and may need to repeatedly adjust
algorithm parameters and data to further optimize the model.

Some common metrics, such as precision, recall, and F1 score, help you effectively
evaluate and obtain a satisfactory model.

Prerequisites
You have created a skill based on the safety helmet detection skill template on the
Huawei HiLens console and trained the model. For details, see Training a Model.

Evaluating a Model
You can use the test data to evaluate the model. You can view the evaluation
result on the Application Development > Evaluate Model page.

● Evaluate Model
The model version, number of labels and test sets of the trained model are
displayed. Click Download to download the evaluation result to the local PC.
● Parameter Comparison
The left pane displays the precision, recall, and F1 score of each label. When
you select a label, the parameter comparison bar charts of the label data
evaluated by the preset model and incremental model are displayed on the
right.
● Detailed evaluation

Figure 10-5 Detailed evaluation

You can filter the label and confidence range in the upper right corner to view
detailed test data.

Follow-up Operations
After the model evaluation, if the model needs to be further optimized based on
service requirements, click Previous to return to the model training step. For
details, see Training a Model.

If the model meets service requirements, click Deploy to go to step Deploy


Service. For details, see Deploying an Application.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 192


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10.3.6 Deploying an Application


After the model is prepared, you can quickly create a skill in step Deploy Service
and install the skill on a device with one click. You can also access HiLens Studio
to automatically create and debug the skill.

Prerequisites
● You have created a skill based on the safety helmet detection skill template
on the Huawei HiLens console and evaluated the model. For details, see
Evaluating a Model.
● Ensure that the account is not in arrears. Resources are consumed during
application deployment.
● To install the skill on a device, you need to register a HiLens Kit device with
Huawei HiLens in advance. For details, see Registering HiLens Kit.
NOTE

Skills automatically created on the Huawei HiLens console can be installed only on
HiLens Kit devices that are registered using the same account in the same region.

Directly Deploying an Application


On the Application Development > Deploy Service page, the workflow
automatically creates a skill based on the trained model. You can install the skill
on the HiLens Kit device with one click.

● Skill Name: default name of the skill which is automatically created by the
workflow
● Device Type: HiLens Kit device, which is the only device allowed for a skill to
install on. Before installing skills, register a HiLens Kit device on the Huawei
HiLens console using the same account in the same region. For details, see
Registering HiLens Kit.
● Device Name: devices registered with the Huawei HiLens console under the
same account in the same region

Select an online device and click Install on the right of the skill name to install
the skill.

The skill installation progress is displayed in the Progress column of the device
list. After the installation is complete, Installed is displayed in the column.

Commissioning/Deployment
This function is not yet available.

Follow-up Operations
After skills are installed on a device, you can view skill details (see Viewing Skill
Details) and manage their skills on the Huawei HiLens console, including
installing new skills, adding runtime configurations, and starting, stopping, and
uninstalling skills.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 193


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10.4 Viewing Skill Details


After creating a skill using a trainable skill template, you can view the skill details,
including the skill development configuration information, historical versions,
application assets, and application monitoring.

Prerequisites
You have created a skill using a trainable skill template on the Huawei HiLens
console. For details, see Creating a Skill Using a Trainable Skill Template.

Viewing Skill Details


1. Log in to the Huawei HiLens console. In the navigation pane on the left,
choose Skill Development > Skills.
The Basic Skills tab page is displayed by default.
2. Click the Trainable Skills tab.
3. Locate the target skill and click View in the Operation column.
By default, the Application Development tab page is displayed.
You can switch to any tab page to view the application development
configurations, application assets (datasets), and application monitoring.

Viewing the Application Development Configurations


On the Application Development tab page, you can view the configuration
information of each step during application development, including Select Data,
Train Model, Evaluate Model, and Deploy Service.
In the upper left corner of the Application Development tab page, click Update
on the right of the version number to update the application version and edit the
configuration.

Viewing Application Assets


On the Assets tab page of the application details page, you can view the asset
information of the current application. For example, the asset information using
the general text classification workflow is information about a training dataset.
You can view the dataset name, description, number of data records, labeling
progress, total number of labels, creation time, and operation. You can perform
View and Delete operations in the Operation column.
View: Click View to go to the datasets details page. Click Label to manually label
data. For details, see Labeling Data > Object Detection.
Delete: Click Delete. The Delete Dataset dialog box is displayed. Click OK to
delete the current dataset.

Viewing Application Monitoring


On the Monitoring tab page, you can view the basic information, historical
versions, and API user guide of the current application version, and test it online.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 194


Huawei HiLens
User Guide 10 Developing Skills Using Trainable Skill Templates

10.5 Deleting a Skill


If a skill is no longer used, you can delete it to release resources.

Procedure
1. Log in to the Huawei HiLens console. In the left navigation pane, choose Skill
Development > Skills.
The Basic Skills page is displayed by default.
2. Click the Trainable Skills tab.
3. Click Delete in the Operation column of the skill to be deleted, and click OK.
NOTE

Deleted skills cannot be recovered.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 195


Huawei HiLens
User Guide 11 Using the Skill Market

11 Using the Skill Market

11.1 Skill Market Overview


After you register a device, you can purchase skills from the skill market of
Huawei HiLens and install them to your device to enable AI capabilities. For
example, if you install a facial recognition skill on your device, your device can
recognize faces.

● You can search for and filter skills in the Skill Market to find the skills you
need.
● If the Skill Market has the skills you need, you can directly purchase the
skills. For details, see Purchasing Skills.
● If the Skill Market does not have the skills you need, you can customize skills
on Huawei HiLens by referring to Customizing Skills.
● You can manage the skills you purchased, customized or released to the
market on the Subscription > All Skills page. For details, see Managing
Orders.
NOTE

The skills purchased in the skill market cannot be opened in HiLens Studio. You can
select a skill template in HiLens Studio to create a skill project. For details, see
Creating a Skill Project.

Skill
A skill is an AI application ready to run on a camera or another computing device.
It consists of a model and logic code. The logic code is the skill's framework, and is
responsible for controlling skill running, including data reading, model import,
model inference, and result output. The model is trained by AI algorithms based
on big data and is responsible for inference in key scenarios during skill running.

The Skill Market of Huawei HiLens provides extensive skills for users.

● The application scenarios for Huawei HiLens skills include smart campus,
smart home, smart vehicle-mounted terminals, smart shopping mall, and
more.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 196


Huawei HiLens
User Guide 11 Using the Skill Market

● Skills are classified into two types by device: skills for Ascend chips and skills
for HiSilicon Hi35xx series chips.

Figure 11-1 Chip

Skill Classification
As shown in the following figure, Huawei HiLens skills are classified into two types
based on the chip types: skills used on HiLens Kit devices and skills used on
devices that run HiSilicon Hi35xx series chips. The Huawei HiLens platform
supports quick, convenient, and efficient skill development with skill templates,
and also allows you to develop models and logic code to meet your specific
requirements in more scenarios.
HiSilicon Hi35xx series chips have low memory and performance. Therefore, you
need to optimize models of skills oriented to this type of chips. If you want to
develop skills of this type, contact Huawei HiLens platform personnel for support.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 197


Huawei HiLens
User Guide 11 Using the Skill Market

Figure 11-2 Classification of skill development scenarios

11.2 Searching for Skills in the Skill Market


The skill market is an open market that has preset skills, skills you released, and
skills shared by other developers. You can search for skills in the following ways.
By default, skills in the skill market are sorted by a combination of various factors.

Searching for a Skill


In the upper left corner of the Skill Market page, you can enter a keyword of the
skill name in the Custom Filtering text box to search for a skill.

Figure 11-3 Search

Filtering Skills
In the Selected Criteria area, you can select Billing Policy, Released By, Chip,
and OS options to filter skills. Released By can be Huawei and Third party.
Huawei refers to official skills released by Huawei HiLens, and Third party refer
to skills developed by users on the Huawei HiLens console and released to the skill
market.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 198


Huawei HiLens
User Guide 11 Using the Skill Market

Figure 11-4 Filtering skills

11.3 Preset Commercial Skills

11.3.1 The List of Preset Commercial Skills


In addition to the skills shared by developers, the Huawei HiLens skill market also
provides preset skills for you to purchase. This section provides brief descriptions,
basic information, runtime configuration parameters, and skill result upload
interfaces of these preset commercial skills available in the skill market.

● Face Detection Skill: face detection skill for smart shopping malls and
supermarkets
● Multi-Region Customer Foot Traffic Analysis Skill: customer foot traffic
analysis skill for smart shopping malls and supermarkets
● License Plate Recognition Skill: license plate recognition skill for smart
shopping malls and supermarkets
● Safety Helmet Detection Skill: safety helmet detection skill for smart
campuses
● Face Capturing and Customer Foot Traffic Detection Skill: skill used to
capture faces and collect customer foot flow statistics for smart stores
● Vehicle Type and Logo Recognition Skill: vehicle type and brand recognition
skill for smart stores.

11.3.2 Face Detection Skill

Introduction
This is a face detection skill for smart shopping malls and supermarkets. It uses
several deep learning algorithms to analyze real-time video streams, automatically
capture clear face images, and upload the captured faces to your backend system
for later use.

This skill can:

● Filter out faces that cannot be recognized, such as faces of small sizes, low
definitions, and large angles.
● Detect multiple faces at the same time.
● Track a face. Deduplicate the captured faces of the same person to avoid
repeated reporting.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 199


Huawei HiLens
User Guide 11 Using the Skill Market

● Specify a region based on service requirements and capture only faces in the
specified region.

To use this skill, you need to provide your service RESTful API and RTSP video
address. A maximum of 10 network cameras can be connected and you are
charged based on the number of connected channels.

For details about how to deploy cameras, see Camera Deployment.

For details about skill configuration items, see Skill Runtime Parameters.

For details about the skill API design, see API for Uploading Skill Results.

Basic Information
Table 11-1 provides basic information about the face detection skill.

Table 11-1 Skill parameters

Parameter Description

Name Face Detection

Skill Version 1.0.9

Chip Ascend 310

OS Platform Linux

Applicable Scenario Smart Mall and Supermarket

Supported Firmware Version HiLens Framework 1.0.0 or later,


DDK887/DDK893

Maximum Channels 10

Video Stream Transmission Protocol RTSP

Input Mode External IP cameras (IPCs)

Output Mode POST

Camera Deployment
The ways cameras are deployed affects the accuracy of the face detection model.
Deploy your cameras in ways that ensure that the captured images are clear, with
the right amount of light and the right angle, and that it is less unlikely for people
to block each other's faces. In the case of video surveillance, make sure that your
cameras can capture more frontal face images.

Camera settings

Cameras of different brands have their basic video settings, such as the resolution,
frame rate, and bit rate. For details, see Table 11-2.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 200


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-2 Camera settings requirements


Parameter Requirement

Resolution The resolution cannot be lower than


720p. If facial recognition and
deduplication are required, the
resolution cannot be lower than 1080p
and cannot be higher than 4K (3840 x
2160).

Frame rate The frame rate must be between 15


FPS and 25 FPS. The recommended
rate is 20 FPS.

Bit rate It is recommended that the bit rate be


set to 4096 kbit/s to 6144 kbit/s for
720p video and to 6144 kbit/s to 8192
kbit/s for 1080p video. For higher
resolution, set a higher bit rate.

Video codec If H.265 is supported, set this


configuration item to H.265.

Day/Night switchover Disable automatic switching to the


infrared mode at night. A camera
cannot capture faces in infrared mode.

Wide dynamic range (WDR) Disable this function. The WDR of a


common camera is not comparable to
that of a professional camera. If a
person moves at a high speed, the
captured images will be blurry.
Therefore, it is better to disable WDR.

Face angle requirements


The face angle is defined based on three dimensions: head-up and head-down
angle (pitch), frontal face rotating angle (roll), and front-to-rear head rotating
angle (yaw). The face detection algorithm has restrictions on all these three
spatial dimensions. After evaluating postures based on the three dimensions, the
detection model sends the detected facial images. If the camera angle is
inappropriate, some frontal faces in the captured images may be incorrectly
recognized as side faces. After installing a camera, walk into its shooting scope to
observe and make sure that the captured facial images do not have steep angles.
Otherwise, the algorithm may fail to recognize the face images.
Ensure that the yaw angle of a face captured in the video does not exceed 45°
(that is, the camera does not shoot obliquely), the pitch angle does not exceed
30° (the camera's pitch angle is reasonable), and the roll angle does not exceed
20° (the two sides of the camera are horizontal and do not tilt).
Face size requirements

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 201


Huawei HiLens
User Guide 11 Using the Skill Market

For a camera whose focal length cannot be adjusted, the camera must be installed
near the capture position so that the resolution of the face images is at least 30
px x 30 px. The suggestions for installing a camera are as follows:
Deployment height: 2 m-2.5 m
Shooting distance: 5 m-6 m
Shooting width: 2 m-3 m
High angle: around 15°
For a camera with adjustable focal length, adjust the focal length to ensure that
the face image resolution is greater than 30 px x 30 px.
If the captured facial images need to be sent to Face Recognition, ensure that the
image resolution is greater than 80 px x 80 px, and set parameter cropSizeMin in
Runtime Configuration Parameters to 80.
Illumination requirements
The illumination must meet the following requirements:
● The amount of light on a passerby's frontal face is appropriate, not too high,
and not too low either.
If this requirement is not met (for example, at night or in the daytime with
insufficient light), the collected facial images will be underexposed and the
captured faces will be too dark and with too much noise. As a result, the
images sent to FRS will have a low recognition success rate.
● The difference between the amounts of light on the two sides of a passerby's
face cannot be too large.
Otherwise, the captured face image will be half bright and half dark.
● Illumination on the back of a passerby < twice the illumination on the front
If the illumination on the back of a passerby exceeds twice the illumination
on the front, the phenomenon of backlighting occurs. As a result, the
captured facial images are underexposed, causing loss of facial feature details.
● A camera installed outdoors should not directly face the sun. Otherwise, the
light on captured faces will be uneven,
If this requirement is not met, the light will be too weak, and the facial
feature details will be lost.
● Do not install an outdoor camera in a place with a heavy shade or where light
is blocked by obstacles.
If this requirement is not met, the light will be too weak, and the facial
feature details will be lost.
If the onsite illumination does not meet the requirements above, you can use HLC
or light compensation to improve the illumination. HLC can help avoid uneven
illumination on faces and the backlighting phenomenon. With HLC, the
illumination condition is improved by shading the object from strong light on one
side. Light compensation can improve the illumination condition by adding extra
light sources, improving the quality of captured facial images. Common spotlights
and incandescent lamps can be used to improve the illumination on people's faces
without affecting the decoration or customer experience.
Environment requirements

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 202


Huawei HiLens
User Guide 11 Using the Skill Market

● Make sure that there are no obstacles in front of the lens.


● Do not install a camera under the shade of a house. Otherwise, the light may
be too dim and the face images may be blurry.
● When installing a camera indoors, pay attention to the lighting. The lighting
in the corridor changes rapidly, and so the images captured by a camera
installed in the corridor may be dark. The Face Recognition Service (FRS) will
have difficulty recognizing such images. For example, when the corridor is
long, the light in the corridor is dark, and the person is far away from the
camera, the detected face is blurry.
● When installing a camera outdoors, do not install it in an open area.
Otherwise, the camera lens may be covered by rain or snow, resulting in
blurred images.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.
● Configuration parameters
Table 11-3 describes the skill runtime parameters.

Table 11-3 Skill runtime parameters


Parameter Manda Type Description
tory

logLevel Yes Enum Log level, which can be


INFO, DEBUG, WARNING,
and ERROR. The
recommended value is INFO.

keep_running Yes Int Whether to automatically


restart a skill and keep it
running when the skill breaks
down. This setting is
available in 1.1.0 and later
versions.

multi_camera Yes List Multi-camera configuration


of a device. For details, see
Table 11-4.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 203


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-4 Video parameters


Parameter Ma Type Description
nda
tory

camera_names Yes List Camera name. Multiple names can


be configured, indicating that
multiple cameras use the same skill
configuration.

sendOriImgFlag Yes Int Whether to send the original facial


image. The default value is 0.
0: Not send
1: Send

sendRepeatFaceFla Yes Int Whether to send facial images of


g better resolutions repeatedly. The
later sent images of the same person
will be of better resolutions. The
default value is 0.
0: Not send
1: Send

sendOriImgCompre No Int Compression ratio of the original


ssionRatio image in JPEG format. The default
value is 90, indicating that the image
compression ratio is 90%. The value
range is [1, 100].

cropSizeMax No Int Maximum width/height (in pixels) of


the facial image to be sent. The
default value is 400.

cropSizeMin No Int Minimum width/height (in pixels) of


the facial image to be sent. The
default value is 80.

roi No String Detection area configuration. The


area setting starts with Polygon,
followed by x and y coordinates
(clockwise) of the area. The default
value is Polygon 0 0 0 0, indicating
that the entire area is covered.

sendUrl Yes String URL for sending POST requests on


behalf of the skill.

faceQualityThres- Yes Float Face definition threshold. Faces


hold whose definition is greater than the
value of this parameter are sent. The
value range is [0.0, 1.0] adn the
default value is 0.38.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 204


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Ma Type Description


nda
tory

centerMode No Int Whether to detect only the largest


face in an ROI. The default value is 0.
0: All faces are returned.
1: Only the largest face in the ROI is
returned.

● Example
You can connect multiple external cameras to a HiLens Kit device. Whether
you want to set different skill configurations for different cameras or have
multiple cameras share the same skill configuration, provide the configuration
in a list similar to the examples below:
//Set different parameters for cameras pos1 and pos2 of Store001.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store001_pos1"],
"sendOriImgFlag": 0,
"sendRepeatFaceFlag": 0,
"sendOriImgCompressionRatio": 90,
"cropSizeMax": 400,
"cropSizeMin": 120,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/face",
"faceQualityThreshold": 0.45,
"centerMode": 0
},
{
"camera_names": ["store001_pos2"],
"sendOriImgFlag": 1,
"sendRepeatFaceFlag": 1,
"sendOriImgCompressionRatio": 100,
"cropSizeMax": 300,
"cropSizeMin": 80,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/face",
"faceQualityThreshold": 0.55,
"centerMode": 0
}]
}
//Set the same parameters for cameras pos1 and pos2 of Store002.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store002_pos1","store002_pos2"],
"sendOriImgFlag": 0,
"sendRepeatFaceFlag": 0,
"sendOriImgCompressionRatio": 90,
"cropSizeMax": 400,
"cropSizeMin": 120,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/face"
"faceQualityThreshold": 0.55,
"centerMode": 0

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 205


Huawei HiLens
User Guide 11 Using the Skill Market

}]
}

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}
The sendUrl parameter is part of the skill runtime configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json. Table 11-5 describes the
request header parameters.

Table 11-5 Request header parameters

Parameter Description Mandatory Example

Content- Message body Yes application/json


Type type (or format)

– Public message body


Table 11-6 describes the public message body of Huawei HiLens.

Table 11-6 Public message body parameters

Parameter Type Description

msg_type String Skill type. The value is


face_detection_result.

cam_name String Camera name.

skill_id String Skill ID.

– Skill message body


Table 11-7 describes the JSON message body of the face detection skill.

Table 11-7 Skill message body parameters

Parameter Type Description

face_id String UUID of a facial image.

track_id Uint64 ID for tracking faces. The same track_id


indicates the same face.

ori_img_id String UUID of original image in which the


face is detected.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 206


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Type Description

time Uint64 Time when an image was decoded, in


seconds.

bbox Object Location of the face in the original


image. For the position parameters, see
Table 11-8.

clarity Float Face definition. The value range is [0,


1].

face_image String Base64 encoding result of the facial


image.

ori_image String Base64 encoding result of the original


image. If the original image is not sent,
this field is not involved.

Table 11-8 bbox position parameters


Parameter Type Description

x Int X coordinate of the upper left corner of


the facial image.

y Int Y coordinate of the upper left corner of


the facial image.

h Int Facial image height.

w Int Facial image width.

The following is an example of the JSON message body of the face


detection skill.
{
"msg_type": "face_detection_result",
"cam_name": "store001_pos2",
"skill_id": "f5c526eb6c51440c8a0ee5e3cc65f23c",
"face_id": "0DD1BEA6-634B-11E8-8B0B-407D0FAD9218",
"track_id": 1,
"ori_img_id": "0DD1BF0A-634B-11E8-8B0B-407D0FAD9218",
"time": 1527603463,
"bbox ": {
"x": 32,
"y": 379,
"w": 49,
"h": 65
},
"clarity": 0.55,
"face_image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
"ori_image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
}

● Response message

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 207


Huawei HiLens
User Guide 11 Using the Skill Market

– Response header
The response header is returned by the server (application system) after
the server receives the request.
A response header contains the following two parts:

▪ HTTP status code, which consists of three digits (2xx to 5xx). 2xx
indicates a success response. 4xx or 5xx indicates a failure response;
Or, a status code defined by the service may be returned.

▪ Additional header fields to support the request's response, such as


Content-type. Such fields are optional.
Table 11-9 details the parameters of public response headers.

Table 11-9 Parameters of public response headers

Parameter Description Example

Date Standard HTTP header, which Mon, 12 Nov 2007


indicates the date and time 15:55:01 GMT
when a message is sent, using
the format defined in RFC822.

Server Standard HTTP header, which Apache


contains information about
the software that the server
uses to process requests.

Content- Standard HTTP header, which xxx


Length specifies the length of the
entity body in decimal
number of bytes.

Content-Type Standard HTTP header, application/json


indicating the media type of
the entity body sent to the
recipient.

– (Optional) Response body


A response body is generally returned in a structured format (for
example, JSON or XML). It corresponds to Content-type in the response
header and is used to transfer content other than the response header.

11.3.3 Multi-Region Customer Foot Traffic Analysis Skill

Introduction
This is a customer foot traffic analysis skill for smart shopping malls and
supermarkets. This skill uses deep learning algorithms to analyze real-time video
streams and automatically collect statistics on customer foot traffic at a fixed
interval.

This skill can:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 208


Huawei HiLens
User Guide 11 Using the Skill Market

● Specify a region, collect only the customer foot traffic statistics in the
specified region, and return the statistics and customer location coordinates in
the region.
● Draw a store-crossing line to collect statistics on the number of people
crossing the line and return the customer foot traffic statistics.
● Generate a heat map for regional customer foot traffic statistics based on the
customer coordinates.
To use this skill, you need to provide your service RESTful API and RTSP video
address. A maximum of 8 network cameras can be connected and you are charged
based on the number of connected channels.
For details about how to deploy cameras, see Camera Deployment.
For details about skill configuration items, see Skill Runtime Parameters.
For details about the skill API design, see API for Uploading Skill Results.

Basic Information

Table 11-10 Skill parameters


Parameter Description

Name Multi-Region Customer Foot Traffic


Analysis

Skill Version 1.0.2

Chip Ascend 310

OS Platform Linux

Applicable Scenario Smart Mall and Supermarket

Supported Firmware Version HiLens Framework 1.0.0 or later,


DDK887/DDK893

Maximum Channels 8

Video Stream Transmission Protocol RTSP

Input Mode External IP cameras (IPCs)

Output Mode POST

Camera Deployment
The customer foot traffic statistics algorithm collects statistics on customer foot
traffic based on head-shoulder detection, and the ways cameras are deployed
affects the accuracy of the head-shoulder detection model. Deploy your cameras
in ways that ensure that the captured human images are clear and upright, with
the right amount of light and the right angle, and that it is less unlikely for people
to block each other's faces. In the case of video surveillance, ensure that the
cameras can capture more human figures.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 209


Huawei HiLens
User Guide 11 Using the Skill Market

Camera settings

Cameras of different brands have their basic video settings, such as the resolution,
frame rate, and bit rate. The specific requirements are as follows:

● Resolution: The range is 720p to 4K (3840 x 2160). 1080p is recommended.


● Frame rate: The frame rate must be between 15 FPS and 25 FPS. The
recommended rate is 20 FPS.
● Bit rate: It is recommended that the bit rate be set to 4096 kbit/s to 6144
kbit/s for 720p video and to 6144 kbit/s to 8192 kbit/s for 1080p video. For
higher resolution, set a higher bit rate.
● Video encoding: If H.265 is supported, set this configuration item to H.265.
● Day/Night switchover: Disable the function of automatically switching to the
infrared mode at night. Faces cannot be captured in infrared mode.
● WDR: Disabled The WDR of a common camera is not comparable to that of a
professional camera. If a person moves at a high speed, the captured images
will be blurry. Therefore, it is better to disable WDR.

Shooting direction of the camera

The camera shooting direction must be forward to the front and back of the
customers, with a tilt angle of view. The specific requirements are as follows:

● Ensure that the upper part of a customer is clear.


● Deployment height: about 4 m
● Surveillance distance: 5-10 m
● Surveillance width: 2-5 m
● Tilt angle: The left and right deviation angles are less than 8°. The pitch angle
ranges from 10° to 20°.

Illumination requirements

The illumination must meet the following requirements:

● The illumination on the front of the customer area must be at least 100 lux to
avoid overdarkness or noise.
● The illumination on one side of a customer must be within twice the
illumination on the other side to avoid casting shadows on faces.
● The illumination on the back of a customer cannot exceed twice that on the
front. This prevents the loss of facial details due to insufficient face exposure.

If the onsite illumination does not meet the requirements above, you can use HLC
or light compensation to improve the illumination. HLC can help avoid uneven
illumination on faces and the backlighting phenomenon. With HLC, the
illumination condition is improved by shading the object from strong light on one
side. Light compensation can improve the illumination condition by adding extra
light sources, improving the quality of captured facial images. Common spotlights
and incandescent lamps can be used to improve the illumination on people's faces
without affecting the decoration or customer experience.

Observer the following precautions during the illuminator installation:

● Avoid uneven light compensation.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 210


Huawei HiLens
User Guide 11 Using the Skill Market

● Set the illumination based on the time segment.


● Flexibly adjust the illumination as required.
● Avoid direct and strong light.

Environment requirements

● Ensure that there is no obstacle in front of the lens to avoid missing detection.
● Do not install a camera under the shade of a house. Otherwise, the light may
be too dark and the human figure may be blurry.
● When installing a camera outdoors, do not install it in an open area.
Otherwise, the camera lens may be covered by rain or snow, resulting in
blurred images.
● When installing a camera indoors, pay attention to the lighting. The lighting
in the corridor changes rapidly, and the images captured by the camera may
be dark.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.

Table 11-11 describes the skill runtime parameters.

Table 11-11 Skill runtime parameters

Parameter Mandat Type Description


ory

multi_camera Yes List Multi-channel video skill


parameter on a device. For
details, see Table 11-12.

Table 11-12 mul_input_parameter description

Parameter Man Type Description


dato
ry

camera_names Yes List Camera name. The camera name is the


same as that configured in the RTSP
stream of the device. Multiple names can
be configured, indicating that multiple
cameras use the same skill configuration.

lineCountCycle Yes Int Statistical period of the number of


people crossing the line. The unit is
second. The value range is (0, +∞), and
the default value is 10.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 211


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Man Type Description


dato
ry

regionCountCycle Yes Int Statistical period of the number of


people entering the region. The unit is
second. The value range is (0, +∞), and
the default value is 10.

enableLine Yes Bool Whether to enable line-crossing


customer foot traffic statistics. The
default value is 1.
0: The function is disabled.
1: The function is enabled.

enableRegion Yes Bool Whether to enable region-entering


customer foot traffic statistics (support
statistics in rectangular regions). The
default value is 1.
0: The function is disabled.
1: The function is enabled.

countSetting No String Customized line and region list. Use


vertical bars (|) to separate line or closed
regions, for example, Polygon 0 0 0
1000 1000 1000 1000 0|Line 500 0 500
1000 side1 side2.
● Closed region: A closed region starts
with Polygon and is followed by the
coordinates of the endpoints of the
region. The endpoint coordinates
consist of the values of the x-
coordinate and y-coordinate.
● Line region: The line region starts
with Line, is followed by four integers
(coordinates of the two sides of the
line), and ends with side1 and side2.
side1 and side2 are marked on both
sides of a straight line. For non-
horizontal lines, side1 is on the left
and side2 is on the right. For
horizontal lines, side1 is on the upper
side and side2 is on the lower side.
The names can be customized.

sendUrl Yes String URL for sending POST requests on behalf


of the skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 212


Huawei HiLens
User Guide 11 Using the Skill Market

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}/
In the preceding information, sendUrl indicates the upload address of the
inference result configured for each device during setting of skill runtime
configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json.

Table 11-13 Request header parameters

Parameter Mand Description Example


atory

Content-Type Yes Message body type application/json


(or format)

– Public message body


Table 11-14 describes the public message body of Huawei HiLens.

Table 11-14 Public message body parameters

Parameter Type Description

msg_type Enum Skill type, for example,


flow_count_result.

cam_name String Camera name.

skill_id String Skill ID.

– Skill message body


Table 11-15 describes the JSON message body of line-crossing statistics.

Table 11-15 Skill message body parameters

Parameter Type Description

event_type Int Event type. For line-crossing statistics,


the value is 0. For region-entering
statistics, the value is 1.

start_time Uint64 The start time of line-crossing statistics.

end_time Uint64 The end time of line-crossing statistics.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 213


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Type Description

counter List Output result list. Each group of data


corresponds to a customized straight
line, including:
● X and Y: X and Y coordinates of two
points in the line.
● id: ID of the line.
● side1_name and side2_name:
Identifier names on both sides of the
line.
● side1 and side2: The numbers of
customers crossing the line to the
side1_name and side2_name.

The following is an example of the message body of line-crossing


statistics.
{
"msg_type": "flow_count_result",
"cam_name": "store001_pos2",
"skill_id": "f5c526eb6c51440c8a0ee5e3cc65f23c",
"event_type": 0,
"start_time": 1535546730,
"end_time": 1535546732,
"counter": [{
"x": [480, 1440],
"y": [540, 540],
"id": 0,
"side1": 0,
"side2": 0,
"side1_name": "side1",
"side2_name": "side2"
},
{
"x": [490, 1500],
"y": [640, 340],
"id": 0,
"side1": 7,
"side2": 3,
"side1_name": "in",
"side2_name": "out"
}]
}

Table 11-16 describes the JSON message body of region-entering


statistics.

Table 11-16 Skill message body parameters


Parameter Type Description

event_type Int Event type. For line-crossing statistics,


the value is 0. For region-entering
statistics, the value is 1.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 214


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Type Description

time Uint64 The start time of region-entering


statistics.

occupy List Output result list. Each group of data


corresponds to a customized closed
region, including:
● X and Y: X and Y coordinates of all
points in a closed region.
● person_list: customer position
information. For details about the
position information, see Table
11-17.
● counter: customer head count of a
region at the current time.

Table 11-17 person_list parameter description


Parameter Type Description

x Int X coordinate of the center point of the


head and shoulder region.

y Int Y coordinate of the center point of the


head and shoulder region.

The following is an example of the message body of region-entering


statistics.
{
'time': 1588927220,
'msg_type': 'flow_count_result',
'event_type': 1,
'cam_name': 'store001_pos2',
'skill_id': 'ff8080826dd4b10d016e20fbb8ae0405',
'device_id': '8366e510ed8b4f94bb9a567e9cc21d23',
'occupy': [{
'x': [0, 1920, 1920, 0],
'y': [0, 0, 1080, 1080],
'person_list':
{
'x': [1155],
'y': [217]
},
'counter': 1
}]
}

● Response message
– Response header
The response header is returned by the server (application system) after
the server receives the request.
A response header contains the following two parts:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 215


Huawei HiLens
User Guide 11 Using the Skill Market

▪ HTTP status code, which consists of three digits (2xx to 5xx). 2xx
indicates a success response. 4xx or 5xx indicates a failure response;
Or, a status code defined by the service may be returned.

▪ Additional header fields to support the request's response, such as


Content-type. Such fields are optional.
Table 11-18 details the parameters of public response headers.

Table 11-18 Parameters of public response headers

Parameter Description Example

Date Standard HTTP header, which Mon, 12 Nov 2007


indicates the date and time 15:55:01 GMT
when a message is sent, using
the format defined in RFC822.

Server Standard HTTP header, which Apache


contains information about
the software that the server
uses to process requests.

Content- Standard HTTP header, which xxx


Length specifies the length of the
entity body in decimal
number of bytes.

Content-Type Standard HTTP header, application/json


indicating the media type of
the entity body sent to the
recipient.

– (Optional) Response body


A response body is generally returned in a structured format (for
example, JSON or XML). It corresponds to Content-type in the response
header and is used to transfer content other than the response header.

11.3.4 License Plate Recognition Skill

Introduction
This is a license plate recognition skill for smart shopping malls and supermarkets.
It uses several deep learning algorithms to analyze video streams in real time,
automatically capture and recognize license plates in images, and upload the
captured license plates to your backend system for later use.

This skill can:

● Recognize license plates that appear in the images captured by external IPCs.
● If multiple license plates are displayed, recognize only one license plate and
upload the recognition result.
● Return the license plate colors.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 216


Huawei HiLens
User Guide 11 Using the Skill Market

● Automatically filter out duplicate license plates in video streams.

For details about how to deploy cameras, see Camera Deployment.

For details about the skill API design, see API for Uploading Skill Results.

Basic Information
Table 11-19 describes the basic parameters used in the license plate recognition
skill.

Table 11-19 Skill parameters

Parameter Description

Name License plate recognition

Skill Version 1.0.2

Chip Ascend 310

OS Platform Linux

Applicable Scenario Smart Mall and Supermarket

Supported Firmware Version HiLens Framework 1.0.0 or later,


DDK887/DDK893

Maximum Channels 10

Video Stream Transmission Protocol RTSP

Input Mode External IP cameras (IPCs)

Output Mode POST

Camera Deployment
Camera deployment requirements are as follows:

● The camera can be installed in side-mounted mode.


● To ensure effective license plate recognition, it is recommended that the
vehicle speed be less than or equal to 5 km/h and the camera be 2 to 4
meters away from the license plate to be recognized.
● During camera installation, ensure that the shooting angle is less than 30
degrees and the license plate to be recognized is horizontal in the image.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 217


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-20 Skill runtime parameters


Parameter Mandat Type Description
ory

confidence_thresh Yes Float Minimum score of the license


old plate recognition result

province Yes String Information about the province


where the HiLens Kit is deployed

multi_camera Yes Array Multi-channel video skill


parameter on a device. For details
about skill parameters, see Table
11-21.

Table 11-21 multi_camera parameters


Paramete Mandatory Type Description
r

camera_n Yes Array Camera name. The camera


ames name is the same as that
configured in the RTSP stream
of the device. Multiple names
can be configured, indicating
that multiple cameras use the
same skill configuration.

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}
The sendUrl parameter is part of the skill runtime configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json. Other parts of the
request header can be set based on service requirements, for example,
authentication.

Table 11-22 Request parameters


Paramet Description Mandat Example
er ory

Content- Message body Yes application/json


Type type (or format)

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 218


Huawei HiLens
User Guide 11 Using the Skill Market

● Response message

Table 11-23 Response parameter description


Parameter Type Description

msg_from String Camera configuration information


returned after the calling is successful.

plate_number String License plate number.

color String Background color of the license plate. The


options are blue, green, black, white,
and yellow.

location Array of List of location information about a


objects license plate, including the 2D
coordinates (x, y) of four vertexes in the
text area, where the coordinate origin is
the upper-left corner of the image, the x-
axis is horizontal, and the y-axis is
vertical.

confidence Float Confidence of a related field. Greater


confidence indicates higher reliability of a
result. In a statistical sense, greater
confidence indicates higher accuracy.
NOTE
The confidence is provided by the algorithm
and is not directly equivalent to the accuracy
of the corresponding field.

processed_time String Result sending timestamp

Return result of a successful response:


{
"plate_number": "Beijing XXXXX",
"location": [
[370,881],
[2591,881],
[2591,2281],
[370,2281]
],
"confidence": 0.9225,
"color": "blue",
"processed_time": Sat Jun 13 18:24:09 2020,
"msg_from": "/tmp/test.mp4"
}

11.3.5 Safety Helmet Detection Skill


Introduction
This is a safety helmet detection skill for smart campuses. This skill uses deep
learning algorithms to analyze real-time video streams and automatically detect
workers who are not wearing their safety helmets.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 219


Huawei HiLens
User Guide 11 Using the Skill Market

This skill can be used in a specified area and returns the safety helmet detection
statistics and coordinate information in the area.

To use this skill, you need to provide your service RESTful API and RTSP video
address. A maximum of 8 network cameras can be connected and you are charged
based on the number of connected channels.

Basic Information

Table 11-24 Skill parameters

Parameter Description

Name Safety Helmet Detection

Skill Version 1.0.0

Chip Ascend 310

OS Platform Linux

Applicable Scenario Smart Campus

Supported Firmware Version HiLens Framework 1.0.0 or later,


DDK887

Maximum Channels 8

Video Stream Transmission Protocol RTSP

Input Mode External IP cameras (IPCs)

Output Mode POST

Camera Deployment
The way cameras are deployed affects the accuracy of the safety helmet detection
model. Deploy your cameras in ways that ensure that the captured human images
are clear and upright, with the right amount of light and the right angle, and that
it is less unlikely for people to block each other's faces. In the case of video
surveillance, ensure that the cameras can capture more human figures.

The training scenario of the safety helmet detection model is mainly for the
construction site entrance. Specifically, the camera is about three to four meters
above the ground. In the area for safety helmets, the human figure is not severely
blocked. To ensure the accuracy of the detection algorithm, ensure that the safety
helmet in the image is clear. In addition, the scene in the camera image must be
as simple and open as possible to avoid false positives caused by complex
scenarios.

Camera settings

Cameras of different brands have their basic video settings, such as the resolution,
frame rate, and bit rate.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 220


Huawei HiLens
User Guide 11 Using the Skill Market

● Resolution: 1080p is recommended. The resolution ranges from 720p to


1080p.
● Frame rate: The frame rate must be between 15 FPS and 25 FPS. The
recommended rate is 20 FPS.
● Bit rate: 4,096 kbit/s to 6,144 kbit/s for 720p and 6,144 kbit/s to 8,192 kbit/s
for 1080p are recommended.
● Video encoding: If H.265 is supported, set this configuration item to H.265.
● Day/Night switchover: Disable the function of automatically switching to the
infrared mode at night.
● WDR: Disabled The WDR of a common camera is not comparable to that of a
professional camera. If a person moves at a high speed, the captured images
will be blurry. Therefore, it is better to disable WDR.
Shooting direction of the camera
Ensure that the camera is facing the front or back of people passing by and
slightly overlook them. Ensure that the upper parts of captured images are clear.
Deployment height: about 4 m
Surveillance distance: 2-10 m
Surveillance width: 2-5 m
Tilt angle: The left and right deviation angles are less than 8°. The pitch angle
ranges from 10° to 20°.
Illumination requirements
The illumination must meet the following requirements:
● The illumination on the front of the customer area must be at least 100 lux to
avoid overdarkness or noise.
● The illumination on one side of a customer must be within twice the
illumination on the other side to avoid casting shadows on faces.
If the onsite illumination does not meet the requirements above, you can use HLC
or light compensation to improve the illumination. HLC can help avoid backlight
phenomenons. With HLC, the illumination condition is improved by shading the
object from strong light on one side. Illuminants can be added to improve the
light conditions and improve the image collection effect.
Environment requirements
● Ensure that there is no obstacle in front of the lens to avoid missing detection.
● Do not install a camera under the shade of a house. Otherwise, the light may
be too dark and the human figure and safety helmet may be blurry.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.
● Configuration parameters
Table 11-25 describes the skill runtime parameters.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 221


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-25 Skill runtime parameters


Parameter Manda Type Description
tory

heartbeat_interval Yes Int Interval for sending skill


heartbeat messages. The unit
is second. The value 0
indicates that the message is
not sent. Skill heartbeat
messages are used to
determine whether a skill is
offline.

post_url Yes String URL for sending POST


requests of skill messages.
The heartbeat and skill
output is sent to the specified
URL.

multi_camera Yes Array Multi-channel video skill


parameter on a device. For
details about skill
parameters, see Table 11-26.

Table 11-26 multi_camera parameters


Parameter Man Type Description
dato
ry

camera_names Yes Array Camera name. The camera name is


the same as that configured in the
RTSP stream of the device. Multiple
names can be configured, indicating
that multiple cameras use the same
skill configuration.

send_image Yes Int Whether to send the original image.


The default value is 0.
0: Not send
1: Send

image_compressio Yes Int Compression ratio of the original


n_ratio image in JPEG format. The default
value is 90, indicating that the image
compression ratio is 90%. The value
range is [1, 100].

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 222


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Man Type Description


dato
ry

use_tracking Yes Int Whether to enable tracking and


deduplication
0: disabled
1: enabled

draw_rectangle No Int Whether to draw boxes for


pedestrians who do not wear a safety
helmet. The default value is 0,
indicating that no box is drawn.
0: Do not draw boxes.
1: Draw boxes.

roi No String Detection area configuration. The


area setting starts with Polygon,
followed by x and y coordinates
(clockwise) of the area. The default
value is Polygon 0 0 0 0, indicating
that the entire area is covered.

● Example
You can connect multiple external cameras to a HiLens Kit device. Whether
you want to set different skill configurations for different cameras or have
multiple cameras share the same skill configuration, provide the configuration
in a list similar to the examples below:
//Set different parameters for cameras pos1 and pos2 of constructionsite01.
{
"heartbeat_interval": 30,
"post_url": "https://abc.company.com/webhook",
"multi_camera":
[{
"camera_names": ["constructionsite01_pos01"],
"send_image": 1,
"image_compression_ratio": 90,
"use_tracking": 1,
"roi": "Polygon 0 0 0 0"
},
{
"camera_names": ["constructionsite01_pos02"],
"send_image": 1,
"image_compression_ratio": 80,
"use_tracking": 0,
"roi": "Polygon 0 0 1920 0 1920 1080 0 1080"
}]
}
//Set the same parameters for cameras pos1 and pos2 of constructionsite02.
{
"heartbeat_interval": 60,
"post_url": "https://abc.company.com/standard",
"multi_camera":
[{
"camera_names": ["constructionsite02_pos01"," constructionsite02_pos02"],
"send_image": 1,
"image_compression_ratio": 90,
"use_tracking": 1,

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 223


Huawei HiLens
User Guide 11 Using the Skill Market

"roi": "Polygon 0 0 0 0"


}]
}

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}
The sendUrl parameter is part of the skill runtime configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json. Other parts of the
request header can be set based on service requirements, for example,
authentication.

Table 11-27 Request header parameters

Parameter Description Mandatory Example

Content- Message body Yes application/json


Type type (or format)

– Public message body


The public message body of Huawei HiLens contains the public messages
of a skill, as shown in Table 11-28.

Table 11-28 Public message body parameters

Parameter Type Description

msg_type Enum Message type. The value can be


no_helmet_alert and heatbeat.

skill_id String Skill ID

– Skill heartbeat message body


The JSON message body of the skill heartbeat contains the following
timestamp:

Table 11-29 Skill heartbeat message body parameters

Parameter Type Description

time Uint64 Heartbeat timestamp

– Common message body example


{
"msg_type": "heartbeat",
"skill_id": "f5c526eb6c51440c8a0ee5e3cc65f23c",

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 224


Huawei HiLens
User Guide 11 Using the Skill Market

"time": 1527603463
}

– Skill message body


Table 11-30 describes the JSON message body for safety helmet
detection.

Table 11-30 Skill message body parameters


Parameter Type Description

camera_name String Camera name

image_id String UUID of the original image of a camera

time Uint64 Timestamp when a pedestrian not


wearing a safety helmet is detected

bounding_box Array Coordinates of a head not wearing a


safety helmet in the background image.
For details, see Table 11-31.

image String Base64 encoding result of the original


image. If the original image is not sent,
this field is an empty string.

Table 11-31 bounding_box parameters


Parameter Type Description

x Int X coordinate of the upper left corner of


the head image

y Int Y coordinate of the upper left corner of


the head image

h Int Height of the head image

w Int Width of the head image

The following is an example of the safety helmet detection message


body:
{
"msg_type": "no_helmet_alert",
"camera_name": "constructsite01_pos02",
"skill_id": "f5c526eb6c51440c8a0ee5e3cc65f23c",
"image_id": "0DD1BF0A-634B-11E8-8B0B-407D0FAD9218",
"time": 1527603463,
"bounding_box ": [{
"x": 32,
"y": 379,
"w": 49,
"h": 65
},
{
"x": 54,

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 225


Huawei HiLens
User Guide 11 Using the Skill Market

"y": 632,
"w": 36,
"h": 95
}
],
"image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
}

● Response message
– Response header
The response header is returned by the server (application system) after
the server receives the request.
A response header contains the following two parts:

▪ HTTP status code, which consists of three digits (2xx to 5xx). 2xx
indicates a success response. 4xx or 5xx indicates a failure response;
Or, a status code defined by the service may be returned.

▪ Additional header fields to support the request's response, such as


Content-type. Such fields are optional.
Table 11-32 describes the fields in a common response header.

Table 11-32 Parameters of public response headers


Parameter Description Example

Date Standard HTTP header, Mon, 12 Nov 2007


which indicates the date 15:55:01 GMT
and time when a message
is sent, using the format
defined in RFC822.

Server Standard HTTP header, Apache


which contains information
about the software that the
server uses to process
requests.

Content- Standard HTTP header, xxx


Length which specifies the length
of the entity body in
decimal number of bytes.

Content-Type Standard HTTP header, application/json


indicating the media type of
the entity body sent to the
recipient.

– Response body
A response body is generally returned in a structured format (for
example, JSON or XML). It corresponds to Content-type in the response
header and is used to transfer content other than the response header.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 226


Huawei HiLens
User Guide 11 Using the Skill Market

11.3.6 Face Capturing and Customer Foot Traffic Detection


Skill

Introduction
This skill is used to capture faces and collect customer foot traffic statistics for
smart stores. It uses several deep learning algorithms to analyze real-time video
streams; capture the faces of people entering a store; automatically select facial
images of the right sizes, resolutions, and angles; and upload them to a backend
system.

Using this skill with the Face Recognition Service (FRS) on the cloud, you can
further develop applications to collect statistics on VIP customers and regular
customers. To use this skill, you need to provide the RESTful interface and RTSP
video address for your application. Currently, this skill can use a maximum of two
channels of video data.

NOTE

When the crowd is dense, where people block each other's faces, the faces of customers
may fail to be captured.

For details about how to deploy cameras, see Camera Deployment.

For details about skill configuration items, see Skill Runtime Parameters.

For details about the skill API design, see API for Uploading Skill Results.

Basic Information
Table 11-33 describes the basic parameters of this skill.

Table 11-33 Skill parameters

Parameter Description

Skill name Face capturing and customer foot


traffic detection

Applicable scenario Smart stores

Supported firmware version HiLens Framework 1.1.2 or later. For


details about the upgrade, see
Upgrading HiLens_Device_Agent
Firmware.
The system firmware version must be
2.2.200.011 (TR6). For details about
the upgrade, see Upgrading the
HiLens Kit System Firmware Version.

Maximum channels of video data 2


supported

Video stream transmission protocol RTSP

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 227


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Description

Input mode External IP cameras (IPCs)

Output mode POST

Camera Deployment
The way cameras are deployed affects the accuracy of the customer foot traffic
detection model. Deploy your cameras in ways that ensure that the captured
images are clear, with the right amount of light and the right angle, and that it is
less unlikely for people to block each other's faces. In the case of video
surveillance, make sure that your cameras can capture more frontal face images.
Camera settings
Cameras of different brands have their basic video settings, such as the resolution,
frame rate, and bit rate. For details, see Table 11-34.

Table 11-34 Camera settings requirements


Parameter Requirement

Resolution The resolution cannot be lower than


720p. If facial recognition and
deduplication are required, the
resolution cannot be lower than 1080p
and cannot be higher than 4K (3840 x
2160).

Frame rate The frame rate must be between 15


FPS and 25 FPS. The recommended
rate is 20 FPS.

Bit rate It is recommended that the bit rate be


set to 4096 kbit/s to 6144 kbit/s for
720p video and to 6144 kbit/s to 8192
kbit/s for 1080p video. For higher
resolution, set a higher bit rate.

Video codec If H.265 is supported, set this


configuration item to H.265.

Day/Night switchover Disable automatic switching to the


infrared mode at night. A camera
cannot capture faces in infrared mode.

Wide dynamic range (WDR) Disable this function. The WDR of a


common camera is not comparable to
that of a professional camera. If a
person moves at a high speed, the
captured images will be blurry.
Therefore, it is better to disable WDR.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 228


Huawei HiLens
User Guide 11 Using the Skill Market

Face angle requirements


The face angle is defined based on three dimensions: head-up and head-down
angle (pitch), frontal face rotating angle (roll), and front-to-rear head rotating
angle (yaw). The face detection algorithm has restrictions on all these three
spatial dimensions. After evaluating postures based on the three dimensions, the
detection model sends the detected facial images. If the camera angle is
inappropriate, some frontal faces in the captured images may be incorrectly
recognized as side faces. After installing a camera, walk into its shooting scope to
observe and make sure that the captured facial images do not have steep angles.
Otherwise, the algorithm may fail to recognize the face images.
Ensure that the yaw angle of a face captured in the video does not exceed 45°
(that is, the camera does not shoot obliquely), the pitch angle does not exceed
30° (the camera's pitch angle is reasonable), and the roll angle does not exceed
20° (the two sides of the camera are horizontal and do not tilt).
Face size requirements
For a camera whose focal length cannot be adjusted, the camera must be installed
near the capture position so that the resolution of the face images is at least 30
px x 30 px. The suggestions for installing a camera are as follows:
Deployment height: 2 m-2.5 m
Shooting distance: 5 m-6 m
Shooting width: 2 m-3 m
High angle: around 15°
For a camera with adjustable focal length, adjust the focal length to ensure that
the face image resolution is greater than 30 px x 30 px.
If the captured facial images need to be sent to FRS, ensure that the image
resolution is greater than 80 px x 80 px, and set cropSizeMin in Skill Runtime
Parameters to 80.
Illumination requirements
The illumination must meet the following requirements:
● The amount of light on a passerby's frontal face is appropriate, not too high,
and not too low either.
If this requirement is not met (for example, at night or in the daytime with
insufficient light), the collected facial images will be underexposed and the
captured faces will be too dark and with too much noise. As a result, the
images sent to FRS will have a low recognition success rate.
● The difference between the amounts of light on the two sides of a passerby's
face cannot be too large.
Otherwise, the captured face image will be half bright and half dark.
● Illumination on the back of a passerby < twice the illumination on the front.
If the illumination on the back of a passerby exceeds twice the illumination
on the front, the phenomenon of backlighting occurs. As a result, the
captured facial images are underexposed, causing loss of facial feature details.
● A camera installed outdoors should not directly face the sun. Otherwise, the
light on captured faces will be uneven,

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 229


Huawei HiLens
User Guide 11 Using the Skill Market

and the facial feature details will be lost.


● Do not install an outdoor camera in a place with a heavy shade or where light
is blocked by obstacles.
If this requirement is not met, the light will be too weak, and the facial
feature details will be lost.

If the onsite illumination does not meet the requirements above, you can use HLC
or light compensation to improve the illumination. HLC can help avoid uneven
illumination on faces and the backlighting phenomenon. With HLC, the
illumination condition is improved by shading the object from strong light on one
side. Light compensation can improve the illumination condition by adding extra
light sources, improving the quality of captured facial images. Common spotlights
and incandescent lamps can be used to improve the illumination on people's faces
without affecting the decoration or customer experience.

Environment requirements

● Make sure that there are no obstacles in front of the lens.


● Do not install a camera under the shade of a house. Otherwise, the light may
be too dim and the face images may be blurry.
● When installing a camera indoors, pay attention to the lighting. The lighting
in the corridor changes rapidly, and so the images captured by a camera
installed in the corridor may be dark. The Face Recognition Service (FRS) will
have difficulty recognizing such images. For example, when the corridor is
long, the light in the corridor is dark, and the person is far away from the
camera, the detected face is blurry.
● When installing a camera outdoors, do not install it in an open area.
Otherwise, the camera lens may be covered by rain or snow, resulting in
blurred images.

In-store line drawing requirements

The skill determines whether a customer has entered the store based on whether
they have crossed a previously defined line (passLineThreshold; for details, see
Table 11-36). This line is closely related to the camera shooting range. The
recommended settings are as follows:

● Make sure that when a full-grown person stands on this line, the camera can
capture the full image of this person and the frontal face image is clear
(assume the other conditions are also met).
● The line should be defined so that 80% to 90% of the camera's coverage is
outside of the store, and 10% to 20% is inside.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.

● Configuration parameters
Table 11-35 describes the skill runtime parameters.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 230


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-35 Skill runtime parameters


Parameter Manda Type Description
tory

logLevel Yes Enum Log level, which can be


INFO, DEBUG, WARNING,
and ERROR. The
recommended value is INFO.

keep_running Yes Int Whether to automatically


restart a skill and keep it
running when the skill breaks
down. This setting is
available in 1.1.0 and later
versions.

multi_camera Yes List Multi-camera configuration


of a device. For details, see
Table 11-36.

Table 11-36 Video parameters


Parameter Ma Type Description
nda
tory

camera_names Yes List Camera name Multiple names can be


configured, indicating that multiple
cameras use the same skill
configuration.

sendOriImgFlag No Int Whether to send the original facial


image. The default value is 0.
0: Not send
1: Send

sendOriImgCompre No Int Compression ratio of the original


ssionRatio image in JPEG format. The default
value is 90, indicating that the image
compression ratio is 90%. The value
range is [1, 100].

cropSizeMax No Int Maximum width/height (in pixels) of


the facial image to be sent. The
default value is 400.

cropSizeMin No Int Minimum width/height (in pixels) of


the facial image to be sent. The
default value is 80.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 231


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Ma Type Description


nda
tory

faceQualityThres- No Float Face image quality score threshold.


hold The camera captures a face image
only when its quality score is higher
than this threshold. The default
value is 0.25.

facePoseThreshold No Float Face pose quality score threshold.


The camera captures a face image
only when its score is higher than
this threshold. The default value is
0.45.

faceBlurThreshold No Float Face blur threshold. The camera


captures a face image only when its
score is higher than this threshold.
The default value is 0.55.

faceMargin Yes Float Empty margin ratio of the face


image. The default value is 2.0.

passLineThreshold No Float Ratio of the Y coordinate of captured


images for determining whether
customers have entered a store. The
default value is 0.9. For example, if
the resolution is 1920 x 1080 and this
ratio is 0.75, the line should be at
810 px (1080 x 0.75 = 810) in the
vertical direction, towards the
bottom.

sendUrl Yes String URL for sending POST requests on


behalf of the skill.

● Example
You can connect multiple external cameras to a HiLens Kit device. Whether
you want to set different skill configurations for different cameras or have
multiple cameras share the same skill configuration, provide the configuration
in a list similar to the examples below:
//Set different parameters for cameras pos1 and pos2 of Store001.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store001_pos1"],
"sendOriImgFlag": 0,
"sendOriImgCompressionRatio": 90,
"cropSizeMax": 400,
"cropSizeMin": 100,
"faceQualityThreshold": 0.25,
"facePoseThreshold": 0.45,
"faceBlurThreshold": 0.55,
"faceMargin": 2.0,

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 232


Huawei HiLens
User Guide 11 Using the Skill Market

"passLineThreshold": 0.9,
"sendUrl": "https://abc.company.com/face",
},
{
"camera_names": ["store001_pos2"],
"sendOriImgFlag": 1,
"sendOriImgCompressionRatio": 100,
"cropSizeMax": 300,
"cropSizeMin": 80,
"faceQualityThreshold": 0.25,
"facePoseThreshold": 0.45,
"faceBlurThreshold": 0.55,
"faceMargin": 2.0,
"passLineThreshold": 0.9,
"sendUrl": "https://abc.company.com/face",
}]
}
//Set the same parameters for cameras pos1 and pos2 of Store002.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store002_pos1","store002_pos2"],
"sendOriImgFlag": 0,
"sendOriImgCompressionRatio": 90,
"cropSizeMax": 400,
"cropSizeMin": 120,
"faceQualityThreshold": 0.25,
"facePoseThreshold": 0.45,
"faceBlurThreshold": 0.55,
"faceMargin": 2.0,
"passLineThreshold": 0.9,
"sendUrl": "https://abc.company.com/face",
}]
}

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}
The sendUrl parameter is part of the skill runtime configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json. Table 11-37 describes
the request header parameters.

Table 11-37 Request header parameters

Parameter Description Mandatory Example

Content- Message body Yes application/json


Type type (or format)

– Public message body


Table 11-38 describes the public message body of Huawei HiLens.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 233


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-38 Public message body parameters


Parameter Type Description

msg_type String Skill type. The value is


face_detection_result.

cam_name String Camera name

skill_id String Skill ID

device_id String ID of the device that runs the skill. For


example, the ID of your HiLens Kit
device. To check this ID, log in to the
Huawei HiLens console, and choose
Device Management > Devices.

– Skill message body


Table 11-39 describes the parameters in the JSON message body of the
skill.

Table 11-39 Skill message body parameters


Parameter Type Description

time Uint64 Time when an image was decoded, in


seconds.

track_id Uint64 Track ID of the face image. The same


track_id indicates the same face. After
each initialization, the value of track_id
increases by 1, starting from 0.

person_id String Person UUID

person_image String Base64 encoding result of the original


image captured when a customer
enters the store for the first time

ori_img_id String UUID of the original face image

ori_image String Base64 encoding result of the original


image corresponding to the best image
captured while a customer enters the
store

face_image String Base64 encoding result of the best


image captured while a customer enters
the store

clarity Float Face image resolution. The value range


is [0,1]. A larger value indicates higher
resolution.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 234


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Type Description

quality_pose Float Face pose score. The value range is


[0,1]. A smaller value indicates a more
upright face pose.

quality_blur Float Face blur level. The value range is [0,1].


A smaller value indicates a clearer face.

bbox Object Location of the face in the original


image. For details, see Table 11-40.

Table 11-40 bbox parameter description

Parameter Type Description

x Int X coordinate of the vertex at the upper


left corner of the detection box

y Int Y coordinate of the vertex at the upper


left corner of the detection box

w Int Width of the detection frame

h Int Height of the detection frame

– Example
The following is an example of the JSON message body for face
capturing and customer foot traffic detection:
{
"msg_type": "face_detection_result",
"cam_name": "store001_pos2",
"skill_id": "f5c526eb6c51440c8a0ee5e3cc65f23c",
"time": 1527603463,
"track_id": 1,
"person_id": "0DD1BEA6-634B-11E8-8B0B-407D0FAD9218",
"person_image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
"ori_img_id": "0DD1BF0A-634B-11E8-8B0B-407D0FAD9218",
"ori_image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
"face_image": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
"clarity": 0.35,
"quality_pose": 0.45,
"quality_blur": 0.55,
"bbox ": {
"x": 32,
"y": 379,
"w": 49,
"h": 65
},
}

● Response
– Response header
The response header is returned by the server (application system) after
the server receives the request.
A response header contains the following two parts:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 235


Huawei HiLens
User Guide 11 Using the Skill Market

▪ HTTP status code, which consists of three digits (2xx to 5xx). 2xx
indicates a success response. 4xx or 5xx indicates a failure response.
Or, a status code defined by the service may be returned.

▪ Additional header fields to support the request's response, such as


Content-type. Such fields are optional.
Table 11-41 details the parameters of public response headers.

Table 11-41 Parameters of public response headers

Parameter Description Example

Date Standard HTTP header, which Mon, 12 Nov 2007


indicates the date and time 15:55:01 GMT
when a message is sent, using
the format defined in RFC822.

Server Standard HTTP header, which Apache


contains information about
the software that the server
uses to process requests.

Content- Standard HTTP header, which xxx


Length specifies the length of the
entity body in decimal
number of bytes.

Content-Type Standard HTTP header, application/json


indicating the media type of
the entity body sent to the
recipient.

– (Optional) Response body


A response body is generally returned in a structured format (for
example, JSON or XML). It corresponds to Content-type in the response
header and is used to transfer content other than the response header.

11.3.7 Vehicle Type and Logo Recognition Skill

Introduction
This skill is used to recognize vehicle types and brands for smart stores. This skill
uses several deep learning algorithms to analyze real-time video streams, take
snapshots of vehicles entering a shopping mall, recognize the brands and types
(sedan or SUV) of the vehicles, and upload the recognition results to your backend
system.

For details about how to deploy cameras, see Camera Deployment.

For details about skill configuration items, see Skill Runtime Parameters.

For details about the skill API design, see API for Uploading Skill Results.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 236


Huawei HiLens
User Guide 11 Using the Skill Market

Basic Information
Table 11-42 provides basic information about the vehicle type and logo
recognition skill.

Table 11-42 Skill parameters


Parameter Description

Skill name Vehicle type and logo recognition - 30-


day free trial

Applicable scenario Smart stores

Supported firmware version HiLens Framework 1.1.2 or later, DDK


887

Maximum channels of video data 2


supported

Video stream transmission protocol RTSP

Input mode External IP cameras (IPCs)

Output mode POST

Camera Deployment
The ways cameras are deployed affects the accuracy of the vehicle type and brand
detection model. Deploy your cameras in ways that ensure that the captured
images are clear, with the right amount of light and the right angle, and that it is
less unlikely for vehicles to block each other.
Camera settings
Cameras of different brands have their basic video settings, such as the resolution,
frame rate, and bit rate. For details, see Table 11-43.

Table 11-43 Camera settings requirements


Parameter Requirement

Resolution Not lower than 720p and not higher


than 4K (3840 x 2160). 1080p is
recommended.

Frame rate The frame rate must be between 15


FPS and 25 FPS. The recommended
rate is 20 FPS.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 237


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Requirement

Bit rate It is recommended that the bit rate be


set to 4096 kbit/s to 6144 kbit/s for
720p video and to 6144 kbit/s to 8192
kbit/s for 1080p video. For higher
resolution, set a higher bit rate.

Video codec If H.265 is supported, set this


configuration item to H.265.

Day/Night switchover Disable automatic switching to the


infrared mode at night.

Wide dynamic range (WDR) Disable this function. The WDR of a


common camera is not comparable to
that of a professional camera. If a
person moves at a high speed, the
captured images will be blurry.
Therefore, it is better to disable WDR.

Camera installation requirements

● Make sure that there are no obstacles in front of the lens.


● Do not install a camera under the shade of a house. Otherwise, the light may
be too dim.
● When installing a camera outdoors, do not install it in an open area.
Otherwise, the camera lens may be covered by rain or snow, resulting in
blurred images.
● Keep the tilt angle of the camera at approximately 15°.

Skill Runtime Parameters


Configure runtime parameters for the skill. For details, see Adding Runtime
Configurations. The added configurations will later be delivered from the Huawei
HiLens cloud service to end devices.

● Configuration parameters
Table 11-44 describes the skill runtime parameters.

Table 11-44 Skill runtime parameters

Parameter Mandato Type Description


ry

logLevel Yes String Log level. The default value is


INFO. A lower log level, for
example, DEBUG, allows more
information to be printed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 238


Huawei HiLens
User Guide 11 Using the Skill Market

Parameter Mandato Type Description


ry

keep_running Yes Int Whether to automatically restart


a skill and keep it running when
the skill breaks down. This
setting is available only for
HiLens Framework 1.1.0 or later.
For details about how to upgrade
the HiLens Framework, see
Upgrading
HiLens_Device_Agent
Firmware.

multi_camera Yes List Multi-camera configuration of a


device. For details, see Table
11-45.

Table 11-45 Video parameters


Parameter Ma Type Description
nda
tory

camera_names Yes List Name of the IP camera that runs the


skill. This parameter must be
configured in advance on the camera
management page. Multiple names
can be configured, indicating that
multiple cameras use the same skill
configuration.

sendCarImgFlag No Int Whether to send captured vehicle


images. The default value is 0.
● 0: Not send
● 1: Send

roi No String Detection area configuration. The


area setting starts with Polygon,
followed by x and y coordinates
(clockwise) of the area. The default
value is Polygon 0 0 0 0, indicating
that the entire area is covered.

sendUrl Yes String URL for sending POST requests on


behalf of the skill.

● Example
You can connect multiple external cameras to a HiLens Kit device. Whether
you want to set different skill configurations for different cameras or have

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 239


Huawei HiLens
User Guide 11 Using the Skill Market

multiple cameras share the same skill configuration, provide the configuration
in a list similar to the examples below:
//Set different parameters for cameras pos1 and pos2 of Store001.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store001_pos1"],
"sendCarImgFlag": 0,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/car"
},
{
"camera_names": ["store001_pos2"],
"sendCarImgFlag": 1,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/car"
}]
}
//Set the same parameters for cameras pos1 and pos2 of Store002.
{
"logLevel": "INFO",
"keep_running": 1,
"multi_camera":
[{
"camera_names": ["store002_pos1","store002_pos2"],
"sendCarImgFlag": 0,
"roi": "Polygon 0 0 0 0",
"sendUrl": "https://abc.company.com/car"
}]
}

API for Uploading Skill Results


● Request
The inference result is pushed to the specified URL of the application system
server using the HTTPS POST method.
POST {sendUrl}
The sendUrl parameter is part of the skill runtime configurations.
– Request header
The skill returns the inference result in JSON format. Therefore, Content-
Type in the request header is application/json. Table 11-46 describes
the request header parameters.

Table 11-46 Request header parameters


Parameter Description Mandatory Example

Content- Message body Yes application/json


Type type (or format)

– Public message body


Table 11-47 describes the public message body of Huawei HiLens.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 240


Huawei HiLens
User Guide 11 Using the Skill Market

Table 11-47 Public message body parameters


Parameter Type Description

msg_type String Skill type. The value is


car_recognition_result.

cam_name String Camera name

skill_id String Skill ID

device_id String ID of the device that runs the skill. For


example, the ID of your HiLens Kit
device. To check this ID, log in to the
Huawei HiLens console, and choose
Device Management > Devices.

– Skill message body


Table 11-48 describes the JSON message body for the vehicle type and
logo recognition skill.

Table 11-48 Skill message body parameters


Parameter Type Description

time Uint64 Time when an image was decoded, in


seconds

carType String Vehicle type

carBrand String Vehicle brand

carUUID String UUID of a captured vehicle.

carImage String Base64 encoding result of a vehicle


image.

– Example
{
"msg_type": "car_recognition_result",
"cam_name": "store001_pos1",
"time": 1527603463,
"carType": "MPV",
"carBrand": "Toyota_Verso",
"carUUID": "0DD1BF0A-634B-11E8-8B0B-407D0FAD9218",
"carImage": "4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE..."
}
● Response
– Response header
The response header is returned by the server (application system) after
the server receives the request.
A response header contains the following two parts:

▪ HTTP status code, which consists of three digits (2xx to 5xx). 2xx
indicates a success response. 4xx or 5xx indicates a failure response.
Or, a status code defined by the service may be returned.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 241


Huawei HiLens
User Guide 11 Using the Skill Market

▪ Additional header fields to support the request's response, such as


Content-type. Such fields are optional.
Table 11-49 details the parameters of public response headers.

Table 11-49 Parameters of public response headers


Parameter Description Example

Date Standard HTTP header, which Mon, 12 Nov 2007


indicates the date and time 15:55:01 GMT
when a message is sent, using
the format defined in RFC822.

Server Standard HTTP header, which Apache


contains information about
the software that the server
uses to process requests.

Content- Standard HTTP header, which xxx


Length specifies the length of the
entity body in decimal
number of bytes.

Content-Type Standard HTTP header, application/json


indicating the media type of
the entity body sent to the
recipient.

– (Optional) Response body


A response body is generally returned in a structured format (for
example, JSON or XML). It corresponds to Content-type in the response
header and is used to transfer content other than the response header.

11.4 Customizing Skills


If the Skill Market does not have the skill you want, you can submit a request for
skill customization to Huawei HiLens. Before sending such a request, confirm that
you have signed a contract with HUAWEI CLOUD and understand that the
acceptance standards of skill customization will be fulfilled according to the
contract.

Context
● You can customize skills intended to work with Ascend 310 chips or skills
intended to work with HiSilicon Hi35xx series chips.
● Skill customization incurs certain fees. After you submit a skill customization
request, our people will contact you to cover details and fees.

Customizing a Skill
1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 242


Huawei HiLens
User Guide 11 Using the Skill Market

2. On the My Skills page, click the Custom Skills tab. The page for customizing
skills is displayed.
3. Click Customize Skill in the upper right corner, enter required skill
parameters, and click OK.

Table 11-50 Custom skill parameters

Parameter Description

Name Name of the custom skill

Platform Platform where the skill runs. Linux, Android, iOS, LiteOS,
and Windows are supported.

Chip Chip for which the skill is used. ARM, 3516CV500,


3519AV100, 3519V101, 3516DV300, and Ascend310 are
supported. Skills of the Ascend310 chip can be used for
HiLens Kit devices.

Descriptio Detailed description of the skill, such as the application


n scenario and efficiency

4. After submitting the request, related personnel will contact you to discuss the
details of the skill. You can also view the status of the customized skill on the
Custom Skill tab page.
– Reviewing: indicates that the skill customization request is being
reviewed.
– Rejected: If you have not signed a contract with HUAWEI CLOUD, Huawei
HiLens will reject your skill customization request.
– Customizing: The skill is being customized.
– Completed: The skill has been customized. After customizing a skill, you
can purchase and use it. For details, see Purchasing & Customizing
Skills.

Purchasing & Customizing Skills


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management.
2. On the My Skills page, click the Custom Skills tab.
3. Click Purchase in the Operation column of the custom skill.
The Purchase Skill dialog box is displayed.
– If the skill is free, the Purchased Skill dialog box is displayed.
i. Specify Copies based on the Specifications, read the privacy policies,
and select I agree to the skill's privacy policies. Confirm the price
and click Buy Now.
The Specifications is Channel(s), indicating the number of video
channels that can be used by each license on the device. The
measurement unit can be the Number of channels or QPS. If you
select Number of channels, one license can be installed on a device
to use one channel of video.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 243


Huawei HiLens
User Guide 11 Using the Skill Market

For some skills, you do not need to select I agree to the skill's
privacy policies. In this case, directly click Buy Now.
ii. After the skill is purchased, a dialog box is displayed, indicating that
the purchase is complete. You can click Orders from Skill Market
and view the skill information. Alternatively, you can choose
Subscription > Order Management in the navigation pane to access
the Skill Orders tab page, and view the purchased skill.

Figure 11-5 Purchasing a skill

– If the skill is charged, the page for purchasing the skill is displayed.
i. Specify the Required Duration and Quantity, determine the Billed
By, Privacy Policy, and Agreement, and select I agree to the
Privacy Statement and the Agreement. Then, click Buy Now.
The Confirm page is displayed.
ii. Check the order details and click Submit.
The payment page is displayed.
iii. Select a payment method, check the order details, click Pay, and
enter the payment password to purchase the skill.
After a message is displayed indicating that the order is paid
successfully, you can click Back to Console to go back to the Huawei
HiLens console. In the navigation pane, choose Subscription > All
Skills, access the Skill Orders tab page, and view the purchased skill.

Follow-up Operations
After purchasing a custom skill, you can install it on a device of your choice. For
details, see Installing a Skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 244


Huawei HiLens
User Guide 11 Using the Skill Market

11.5 Purchasing Skills


Whether for device management or product management, you need to purchase
an available skill in the skill market or subscribe to a HiLens skill from the
ModelArts AI Gallery.

Context
● Skill purchase incurs certain fees. Before using Huawei HiLens, check your
account status, which cannot be in arrears or frozen.
● Skills are classified into those oriented to Ascend 310 chips and those
oriented to HiSilicon Hi35xx series chips. Check the skill types carefully and
purchase them based on site requirements.
● If the Skill Market does not have the skill you want, you can submit a
request for customizing the skill to Huawei HiLens. For details, see
Customizing Skills.
● The skills purchased in the skill market cannot be opened in HiLens Studio.
You can select a skill template in HiLens Studio to create a skill project. For
details, see Creating a Skill Project.

Purchasing Skills from the Huawei HiLens Skill Market


1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > All Skills. The All Skills page is displayed.
2. Filter and search for the skill you need and click the skill card to access the
skill details page.
3. On the skill details page, click Buy Now.
– If the skill is free, the Purchased Skill dialog box is displayed.
i. Specify Copies based on the Specifications, read the privacy policies,
and select I agree to the skill's privacy policies. Confirm the price
and click Buy Now.
The Specifications is Channel(s), indicating the number of video
channels that can be used by each license on the device. The
measurement unit can be the Number of channels or QPS. If you
select Number of channels, one license can be installed on a device
to use one channel of video.
For some skills, you do not need to select I agree to the skill's
privacy policies. In this case, directly click Buy Now.
ii. After the dialog displays a message indicating that the purchase is
complete, you can click Purchased to return to the Skill Market
page. Alternatively, you can choose Subscription > Order
Management in the navigation pane to access the Skill Orders tab
page, and view the purchased skill.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 245


Huawei HiLens
User Guide 11 Using the Skill Market

Figure 11-6 Purchasing a skill

– If the skill is charged, the page for purchasing skills is displayed.


i. Specify the Required Duration and Quantity, determine the Billed
By, Privacy Policy, and Agreement, and select I agree to the
Privacy Statement and the Agreement. Then, click Buy Now.
The Confirm page is displayed.
ii. Confirm the order details and click Submit to submit the order.
Fees charged on some skills already include that on the HiLens
device-cloud synergy operation service. You do not need to pay
additionally.
The payment page is displayed.
iii. Select a payment method, confirm the order, click Pay, and enter the
payment password to purchase the skill.
After a message is displayed indicating that the order is paid
successfully, you can click Back to Console to go back to the Huawei
HiLens console. In the navigation pane, choose Subscription > All
Skills to access the Skill Orders tab page and view the purchased
skill.

Subscribing to Skills from the ModelArts AI Gallery


You can also search for and subscribe to the skills you want in the ModelArts AI
Gallery.

Once you have subscribed to the skills, you can choose Subscription > Order
Management on the Huawei HiLens console, and click the AI Gallery tab page to
view details about these skills.

Click on the left of the skill name and click Install in the skill version
information area to install the skill onto your device. For details, see Installing
Skills.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 246


Huawei HiLens
User Guide 11 Using the Skill Market

Figure 11-7 Installing a skill

Follow-up Operations
● Common users or developers (skill users): You can install purchased skills on
your devices. For details, see Installing Skills.
● Manufacturers (product managers): You can distribute purchased skills to
your products. For details, see Distributing Skills.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 247


Huawei HiLens
User Guide 12 Managing Data

12 Managing Data

After a skill is delivered to a device, you can download the device data on the
Huawei HiLens console for analysis purposes, for example, to check how the skill
is performing on the device where it is currently deployed.

NOTE

● Only the data of HiLens Kit devices can be managed on the Data Management page.
The data of devices running HiSilicon Hi35xx series chips cannot be managed on the
Huawei HiLens console.
● You can only use the data management function to view data of skills that are exported
to OBS as files.

Prerequisites
● A common user successfully installs a purchased skill to a device. For details,
see Installing a Skill.
● A developer successfully installs a skill to a device. For details, see Installing
and Debugging Skills.
● Only when the output module of a skill defines the scenario that data is
output to OBS, you can view the skill data on the Data Management page.
– If you are a skill developer and need to view the running effect of your
skill on devices, you need to specify that the skill data is stored on OBS,
so that you can download the data from the Huawei HiLens console.
– If you are a skill user, you need to check whether the data of a skill is
stored on OBS on the skill details page in the skill market.

Configuring the Data Storage Location (OBS Storage Path)


1. Log in to the Huawei HiLens console. In the navigation pane, choose Device
Management > Devices. In the device list, click the name of the device to be
managed to enter the device details page.

2. Click on the right of Data Storage Location. In the dialog box that is
displayed, select an OBS directory to store the video data of the current
device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 248


Huawei HiLens
User Guide 12 Managing Data

NOTE

● Storing device data consumes storage resources of HUAWEI CLOUD. Using OBS for
storage will incur fees. For detailed operations and specifications, see the Object
Storage Service Console Operation Guide.
● When a URL is used to access a bucket, the bucket name is a part of the URL.
According to DNS standards, a URL does not support uppercase letters and cannot
be used to access a bucket whose name contains uppercase letters. Therefore, a
bucket name can contain only lowercase letters, digits, hyphens (-), and periods (.).
It cannot contain two consecutive periods (.) or contain a period (.) and a hyphen
(-) adjacent to each other. For details about the naming rule, see Creating a
Bucket.

Figure 12-1 Configuring the data storage location

Viewing Data
You can view the device data and skill running effect based on the data output
mode. For details about the skill output modes, see Table 12-1.

NOTE

● Video data of most skills is output to a display through the HDMI port of a device, and
little video data is output to a server for viewing. Go to the Skill Market and view the
output settings of a skill under Product Description on the skill details page. For
example, if the description of a celebrity recognition skill is "View via HDMI", you can
view the skill running effect on a display after the skill is deployed.
● Skills of other output modes (excluding HDMI) are stored on OBS. For details about
how to view data, see Configuring the Data Storage Location (OBS Storage Path).

Table 12-1 Skill output modes

Mode Data Viewing Description

HDMI The video data is directly output to a display through the HDMI
port of the device.

RTMP The video data is output to a server in real time for users to view.
For details about the server address, see the skill's Product
Description.

H264_FILE The video data is output to OBS as files for users to view.
For details about the OBS path, see Configuring the Data
Storage Location (OBS Storage Path).

Downloading Data
1. Log in to the Huawei HiLens console. In the navigation pane, click Data
Management (Beta). The Data Management page is displayed.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 249


Huawei HiLens
User Guide 12 Managing Data

2. Double-click the specified device name to access the device data folder to be
downloaded.
3. Select the data folder and click Download to download the data to your local
PC.

Deleting Data
1. Log in to the Huawei HiLens console. In the navigation pane, click Data
Management (Beta). The Data Management page is displayed.
2. Double-click the specified device name to access the device data folder to be
deleted.
3. Select the data folder and click Delete.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 250


Huawei HiLens
User Guide 13 Managing Products

13 Managing Products

13.1 Overview
As the manufacturers of cameras running HiSilicon Hi35xx series chips, you can
use Huawei HiLens to manage products in batches. You can also purchase skills
from the skill market, and distribute the skills to your products to enable your
products with AI capabilities.
● Managing Products
● Purchasing Skills (for Devices Running Hi35xx Series Chips)
● Distributing Skills
● Adding or Deleting Skills

13.2 Managing Products


After a manufacturer creates a product on the Huawei HiLens console, the
manufacturer can associate devices with the product. Once a user who purchases
a device registers the device, the manufacturer can manage the registered device
and its skills on the Huawei HiLens console.

Creating a Product
1. Log in to the Huawei HiLens console, and choose Device Management >
Products in the navigation pane. The Products page is displayed.
2. Click Create Product in the upper right corner and set product parameters, as
shown in Table 13-1.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 251


Huawei HiLens
User Guide 13 Managing Products

Table 13-1 Product parameters

Parameter Description

Name Product name.


Enter 3 to 60 characters, starting with a Chinese character or
letter and ending with a Chinese character, letter, or digit.
Only letters, digits, underscores (_), and hyphens (-) are
allowed.

Platform Device OS type.


Android, Linux, iOS, LiteOS, and Windows are supported.

Chip Device chip model:


HiSilicon Hi35xx series, including 3516CV500, 3519AV100,
3519V101, 3516DV300, 3516EV200, 3516EV300, 3518EV300,
and Arm.
When the chip model is 3518EV300, 3516EV200, or
3516EV300, you can select 3516CV500.

Description Product description.


The value can contain a maximum of 512 characters.

3. Confirm the product information and click OK.


After the product is created, the Products page is automatically displayed.

Downloading a License
After a product is created, you need to download the corresponding license and
save it to the specified path on the device.

1. Choose Device Management > Products in the navigation pane. The


Products page is displayed.
2. Select the target product and click Download License in the Operation
column to download the license file.
3. Place the license file in the specified directory on the device.
The location for storing the license varies according to the device
manufacturer. After the cooperation relationship is established between you
and the manufacturer, you can submit a service ticket and Huawei HiLens
personnel will provide guidance. You can also submit a service ticket to learn
more about the skills for HiSilicon Hi35xx series chips.

Editing a Product
1. Log in to the Huawei HiLens console, and choose Device Management >
Products in the navigation pane. The Products page is displayed.
2. Select the target product and click Edit in the Operation column.
The Update Product dialog box is displayed.
3. In the Update Product dialog box, edit the Name, Platform, Chip, and
Description based on Table 13-1.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 252


Huawei HiLens
User Guide 13 Managing Products

4. Confirm the product information and click OK.

Deleting a Product

NOTICE

Before deleting a product, ensure that the product is not in use. Exercise caution
when performing this operation. If the product is associated with devices, the
devices cannot be managed after the product is deleted. If users have registered
the devices, the manufacturer cannot distribute skills to the devices.

1. Log in to the Huawei HiLens console, and choose Device Management >
Products in the navigation pane. The Products page is displayed.
2. Select the target product and click Delete in the Operation column.
3. Confirm the product information and click OK.

13.3 Purchasing Skills (for Devices Running Hi35xx


Series Chips)
You can purchase required skills in the skill market of Huawei HiLens to develop
devices running HiSilicon Hi35xx series chips. The applicable chips include
3516CV500, 3519AV100, 3519V101, 3516DV300, 3516EV200, 3516EV300,
3518EV300, and Arm.

If the Skill Market has the skills you need, you can directly purchase the skills. If
the Skill Market does not have the skill you want, you can submit a request for
customizing the skill to Huawei HiLens.

● Purchasing skills: In the skill market, select the skills oriented to HiSilicon
Hi35xx series chips. For details, see Purchasing Skills.
● Customizing skills: For details, see Customizing Skills. When customizing
skills, you must fill in the applicable chips based on the actual situation.

13.4 Distributing Skills


Skills oriented to HiSilicon Hi35xx series chips can be used only after being
distributed to devices. For a device that runs HiSilicon Hi35xx series chips, a
maximum of five skills can be distributed to it due to performance restrictions.

Prerequisites
● Devices have been associated with a product. For details, see Managing
Products.
● Skills have been purchased. For details, see Purchasing Skills (for Devices
Running Hi35xx Series Chips).

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 253


Huawei HiLens
User Guide 13 Managing Products

Distributing a Skill
1. Log in to the Huawei HiLens console. In the navigation pane, choose
Subscription > Order Management. The Skill Orders tab page is displayed
by default.
2. Select the skill you need and distribute the skill license to a product.
In the skill information, only the skills whose Chip is not Ascend 310 can be
distributed to products.
a. Select the skill to be distributed and click Distribute in the Operation
column.
b. In the Distribute to Product dialog box, select the product to which the
license is to be distributed, select or not select Yes under Automatic
Upgrade as required, and click Distribute to Product.
If you select Automatic Upgrade, the skill in the product will be
automatically upgraded to the latest version if a new version is available
for the skill.
c. The skill distribution information is displayed in the dialog box. Confirm
that the installation status is successful and click OK.
3. Download the skill.
On the Skill Orders tab page, select the skill you want to use and click
Download in the Operation column. The browser automatically downloads
the SDK package of the skill.
4. Deploy the skill. Integrate the SDK package downloaded in 3 to a device.
The device location where the skill is integrated varies according to the device.
For details about the operation guide, contact Huawei technical engineers.

13.5 Adding or Deleting Skills


Distributing skills refers to distributing skills from the skill market to products.
Adding skills refers to adding skills for specified products on the Products page.
The final results of the two operations are the same.

You can delete skills that are no longer used from the current product.

Adding a Skill
1. Log in to the Huawei HiLens console, and choose Device Management >
Products in the navigation pane. The Products page is displayed.
2. Select a product and click Add Skill in the Operation column.
3. The Available Skills dialog box displays a list of purchased skills by default.
Select the skills to be added, select Automatic Upgrade as required, and click
OK.
If you select Automatic Upgrade, the skill will be automatically upgraded to
the latest version if a new version is available for the skill.

Deleting a Skill
Deleting a skill is to remove the skill from a device.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 254


Huawei HiLens
User Guide 13 Managing Products

NOTE

● After devices that support automatic skill update (devices running the 3516CV500 and
3519AV100 chips) detect that the skills on the cloud are deleted, the devices also delete
the device-side skills.
● For devices that do not support automatic skill update, after the skills are deleted from
the cloud, the devices are not affected and the device-side skills can still be used. If you
want to delete the device-side skills, submit service tickets.

1. Log in to the Huawei HiLens console, and choose Device Management >
Products in the navigation pane. The Products page is displayed.
2. Select a product and click the arrow on the left to view all skills under the
product.
3. Select the skill to be deleted and click Delete.
4. Confirm the information of the skill to be deleted and click OK.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 255


Huawei HiLens
User Guide A Caffe Operator Boundaries

A Caffe Operator Boundaries

For the Caffe framework, if the input dimension of each operator is not 4 and the
axis parameter exists, negative numbers cannot be used.
Table A-1 shows the boundaries of Caffe operators supported by .om models.

Table A-1 Caffe operator boundaries


No. Operator Definition Boundary

1 Absval Computes the [Input]


absolute value of One input
the input.
[Parameter]
engine: (optional) enum, default to
0, CAFFE = 1, CUDNN = 2
[Constraint]
None
[Quantitative tool support]
Yes

2 Argmax Returns the index [Input]


number One input
corresponding to
the maximum input [Parameter]
value. ● out_max_val: (optional) bool,
default to false
● top_k: (optional) unit32, default
to 1
● axis: (optional) int32
[Constraint]
None
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 256


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

3 BatchNor Normalizes the [Input]


m input: One input
variance of [(x – [Parameter]
avg(x))/x]
● use_global_stats: bool, must be
true
● moving_average_fraction:
(optional) float, default to 0.999
● eps: (optional) float, default to
1e-5
[Constraint]
Only the C dimension can be
normalized.
[Quantitative tool support]
Yes

4 Concat Concatenates the [Input]


input along the Multiple inputs
given dimension.
[Parameter]
● concat_dim: (optional) uint32,
default to 1, greater than 0
● axis: (optional) int32, default to 1,
exclusive with concat_dim. When
axis is –1, four input dimensions
are required. Otherwise, the result
may be incorrect.
[Constraint]
● For the input tensor, the sizes of
its dimensions must be the same
except the dimension for
concatenation.
● The range of the input tensor
count is [1, 1,000].
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 257


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

5 Depthwis Depthwise [Input]


eConvolu convolution One 4D input, with a constant filter
tion
[Parameter]
● num_output: (optional) uint32
● bias_term: (optional) bool,
default to true
● pad: uint32, default to 0, array
● kernel_size: uint32, array
● stride: uint32, default to 1, array
● dilation: uint32, default to 1,
array
● pad_h: (optional) uint32, default
to 0 (2D only)
● pad_w: (optional) uint32, default
to 0 (2D only)
● kernel_h: (optional) uint32 (2D
only)
● kernel_w: (optional) uint32 (2D
only)
● stride_h: (optional) uint32 (2D
only)
● stride_w: (optional) uint32 (2D
only)
● group: (optional) uint32, default
to 1
● weight_filler: (optional)
FillerParameter
● bias_filler: (optional)
FillerParameter
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
● force_nd_im2col: (optional) bool,
default to false
● axis: (optional) int32, default to 1
[Constraint]
filterN=inputC=group
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 258


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

6 Convoluti Convolution [Input]


on One 4D input, with a constant filter
[Parameter]
● num_output: (optional) uint32
● bias_term: (optional) bool,
default to true
● pad: uint32, default to 0, array
● kernel_size: uint32, array
● stride: uint32, default to 1, array
● dilation: uint32, default to 1,
array
● pad_h: (optional) uint32, default
to 0 (2D only)
● pad_w: (optional) uint32, default
to 0 (2D only)
● kernel_h: (optional) uint32 (2D
only)
● kernel_w: (optional) uint32 (2D
only)
● stride_h: (optional) uint32 (2D
only)
● stride_w: (optional) uint32 (2D
only)
● group: (optional) uint32, default
to 1
● weight_filler: (optional)
FillerParameter
● bias_filler: (optional)
FillerParameter
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
● force_nd_im2col: (optional) bool,
default to false
● axis: (optional) int32, default to 1
[Constraint]
● (inputW + padWHead + padWTail)
≥ (((FilterW-1) x dilationW) + 1)
● (inputW + padWHead +
padWTail)/StrideW + 1 ≤
2147483647
● (inputH + padHHead + padHTail)
≥ (((FilterH-1) x dilationH) + 1)

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 259


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

● (inputH + padHHead + padHTail)/


StrideH + 1 ≤ 2147483647
● 0 ≤ Pad < 256, 0 < FilterSize < 256,
0 < Stride < 64, 1 ≤ dilationsize <
256
[Quantitative tool support]
Yes

7 Crop Crops the input. [Input]


Two inputs
[Parameter]
● axis: (optional) int32, default to 2.
When axis is –1, four input
dimensions are required.
● offset: uint32, array
[Constraint]
None
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 260


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

8 Deconvol Deconvolution [Input]


ution One 4D input, with a constant filter
[Parameter]
● num_output: (optional) uint32
● bias_term: (optional) bool,
default to true
● pad: uint32, default to 0, array
● kernel_size: uint32, array
● stride: uint32, default to 1, array
● dilation: uint32, default to 1,
array
● pad_h: (optional) uint32, default
to 0 (2D only)
● pad_w: (optional) uint32, default
to 0 (2D only)
● kernel_h: (optional) uint32 (2D
only)
● kernel_w: (optional) uint32 (2D
only)
● stride_h: (optional) uint32 (2D
only)
● stride_w: (optional) uint32 (2D
only)
● group: (optional) uint32, default
to 1
● weight_filler: (optional)
FillerParameter
● bias_filler: (optional)
FillerParameter
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
● force_nd_im2col: (optional) bool,
default to false
● axis: (optional) int32, default to 1
[Constraint]
● group = 1
● dilation = 1
● filterH - padHHead - 1 ≥ 0
● filterW - padWHead - 1 ≥ 0
Restrictions involving intermediate
variables:

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 261


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

1. a = ALIGN(filter_num, 16) x
ALIGN(filter_c, 16) x filter_h x
filter_w x 2
2. If ALIGN(filter_c, 16)%32 = 0, a =
a/2
3. conv_input_width =
(deconvolution input W – 1) x
strideW + 1
4. b = (conv_input_width) x filter_h x
ALIGN(filter_num, 16) x 2 x 2
5. a + b ≤ 1024 x 1024
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 262


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

9 Detection Generates detection [Input]


Output results and outputs Three inputs
FSR.
[Parameter]
● num_classes: (mandatory) int32,
indicating the number of classes
to be predicted
● share_location: (optional) bool,
default to true, indicating that
classes share one bounding box
● background_label_id: (optional)
int32, default to 0
● nms_param: (optional) indicating
non-maximum suppression (NMS)
● save_output_param: (optional)
indicating whether to save the
detection result
● code_type: (optional) default to
CENTER_SIZE
● variance_encoded_in_target:
(optional) bool, default to true.
The value true indicates that the
variance is encoded in the target,
otherwise the prediction offset
needs to be adjusted accordingly.
● keep_top_k: (optional) int32,
indicating the total number of
BBoxes to be reserved for each
image after NMS
● confidence_threshold: (optional)
float, indicating that only the
detection whose confidence is
above the threshold is considered.
If this parameter is not set, all
boxes are considered.
● nms_threshold: (optional) float
● top_k: (optional) int32
● boxes: (optional) int32, default to
1
● relative: (optional) bool, default
to true
● objectness_threshold: (optional)
float, default to 0.5
● class_threshold: (optional) float,
default to 0.5
● biases: array

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 263


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

● general_nms_param: optional
[Constraint]
● Used for Faster R-CNN
● Non-maximum suppression (NMS)
ratio nmsThreshold is within (0, 1)
● Probability threshold
postConfThreshold is within (0, 1)
● Classes ≥ 2
● Input box count ≤ 1,024
● Output W dimension = 16
[Quantitative tool support]
Yes

10 Eltwise Computes element- [Input]


wise operations At least two inputs
(PROD, MAX, and
SUM). [Parameter]
● operation: (optional) enum,
PROD = 0, SUM = 1, MAX = 2;
default to SUM
● coeff: float array
● stable_prod_grad: (optional)
bool, default to true
[Constraint]
● Up to four inputs
● Compared with the native
operator, this operator does not
support the stable_prod_grad
parameter.
● PROD, MAX, and SUM operations
are supported.
[Quantitative tool support]
Yes

11 Elu Activation function [Input]


One input
[Parameter]
alpha: (optional) float, default to 1
[Constraint]
None
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 264


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

12 Exp Applies e as the [Input]


base and x as the One input
exponent.
[Parameter]
● base: (optional) float, default to –
1.0
● scale: (optional) float, default to
1.0
● shift: (optional) float, default to
0.0
[Constraint]
None
[Quantitative tool support]
No

13 Flatten Converts an input [Input]


of shape N * C * H * One input
W to a vector
output of shape N * (top_size ≠ bottom_size ≠ 1. When
(C * H * W). axis is –1, four input dimensions are
required.)
[Parameter]
● axis: (optional) int32, default to 1
● end_axis: (optional) int32, default
to -1
[Constraint]
axis < end axis
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 265


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

14 FullConn Computes an inner [Input]


ection product. One input
[Parameter]
● num_output: (optional) uint32
● bias_term: (optional) bool,
default to true
● weight_filler: (optional)
FillerParameter, 2D
● bias_filler: (optional)
FillerParameter, 1D
● axis: (optional) int32, default to 1
● transpose: (optional) bool, default
to false
[Constraint]
● transpose = false, axis = 1
● Bais_C ≤ 56832
● To quantify the model, the
following dimension restrictions
must be satisfied:
● − When N = 1, then 2 x CEIL(C,
16) x 16 x xH x xW ≤ 1024 x 1024
● − When N > 1, then 2 x 16 x
CEIL(C, 16) x 16 x xH x xW ≤ 1024
x 1024
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 266


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

15 Interp Interpolation layer [Input]


One input
[Parameter]
● height: (optional) int32, default
to 0
● width: (optional) int32, default to
0
● zoom_factor: (optional) int32,
default to 1
● shrink_factor: (optional) int32,
default to 1
● pad_beg: (optional) int32, default
to 0
● pad_end: (optional) int32, default
to 0
NOTE
l zoom_factor and shrink_factor are
exclusive.
l height and zoom_factor are exclusive.
l height and shrink_factor are exclusive.
[Constraint]
(outputH x outputW)/(inputH x
inputW) > 1/30
[Quantitative tool support]
No

16 Log Performs [Input]


logarithmic One input
operation on the
input. [Parameter]
● base: (optional) float, default to –
1.0
● scale: (optional) float, default to
1.0
● shift: (optional) float, default to
0.0
[Constraint]
None
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 267


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

17 LRN Normalizes the [Input]


input in a local One non-constant input
region.
[Parameter]
● local_size: (optional) uint32,
default to 5
● alpha: (optional) float, default to
1
● beta: (optional) float, default to
0.75
● norm_region: (optional) enum,
default to ACROSS_CHANNELS
(ACROSS_CHANNELS = 0,
WITHIN_CHANNEL = 1)
● lrnk: (optional) float, default to 1
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
[Constraint]
● local_size is an odd number
greater than 0.
● Inter-channel: If local_size is
within [1, 15]: lrnK > 0.00001 and
beta > 0.01; Otherwise, lrnK and
beta are any values. lrnK and
alpha are not 0 at the same time.
When the C dimension is greater
than 1,776, local_size < 1728.
● Intra-channel: lrnK = 1, local_size
is within [1, 15], beta > 0.01.
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 268


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

18 LSTM Long and short [Input]


term memory Two or three inputs
network (LSTM)
● X: time sequence data (T x B x Xt),
which is in the NCHW 4D format,
● where, N corresponds to the time
sequence length T, C corresponds
to the batch size B, H corresponds
to the input data Xt at timepoint
t, and W is fixed at 1.
● Cont: sequence continuity flag (T
x B)
● Xs: (optional) static data (B x Xt)
[Parameter]
● num_output: (optional) uint32,
default to 0
● weight_filler: (optional)
FillerParameter
● bias_filler: (optional)
FillerParameter
● debug_info: (optional) bool,
default to false
● expose_hidden: (optional) bool,
default to false
[Constraint]
Restrictions involving intermediate
variables:
a = (ALIGN(xt, 16) + ALIGN(output,
16)) x 16 x 2 x 2
b = (ALIGN(xt, 16) + ALIGN(output,
16)) x 16 x 4 x 2 x 2
c = use_projection ? ALIGN(ht, 16) x
ALIGN(output, 16) x 2):0
d = 16 x ALIGN(ht, 16) x 2
e = batchNum x 4
The constraints are as follows:
a + b + c ≤ 1024 x 1024
d ≤ 256 x 1024/8
e ≤ 256 x 1024/32
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 269


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

19 Normaliz Normalization layer [Input]


e One input
[Parameter]
● across_spatial: (optional) bool,
default to true
● scale_filler: (optional) default to
1.0
● channel_shared: (optional) bool,
default to true
● eps: (optional) float, default to
1e-10
[Constraint]
● 1e – 7 < eps ≤ 0.1 + (1e – 6)
● across_spatial can only be true
for Caffe, indicating normalization
by channel.
[Quantitative tool support]
Yes

20 Permute Permutes the input [Input]


dimensions One input
according to a
given mode. [Parameter]
order: uint32, array
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 270


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

21 Pooling Pools the input. [Input]


One input
[Parameter]
● pool: (optional) enum, indicating
the pooling method, MAX = 0,
AVE = 1, and STOCHASTIC = 2,
default to MAX
● pad: (optional) uint32, default to
0
● pad_h: (optional) uint32, default
to 0
● pad_w: (optional) uint32, default
to 0
● kernel_size: (optional) uint32,
exclusive with kernel_h/kernel_w
● kernel_h: (optional) uint32
● kernel_w: (optional) uint32, used
in pair with kernel_h
● stride: (optional) uint32, default
to 1
● stride_h: (optional) uint32
● stride_w: (optional) uint32
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
● global_pooling: (optional) bool,
default to false
● ceil_mode: (optional) bool,
default to true
● round_mode: (optional) enum,
CEIL = 0, FLOOR = 1, default to
CEIL
[Constraint]
● kernelH ≤ inputH + padTop +
padBottom
● kernelW ≤ inputW + padLeft +
padRight
● padTop < windowH
● padBottom < windowH
● padLeft < windowW
● padRight < windowW
In addition to common restrictions,
the following restrictions must be
satisfied.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 271


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

The global pool mode supports only


the following ranges:
1. outputH==1 && outputW==1 &&
kernelH>=inputH &&
kernelW>=inputW
2. inputH*inputW ≤ 10,000
[Quantitative tool support]
Yes

22 Power Computes the [Input]


output y as (scale * One input
x + shift)^power.
[Parameter]
● power: (optional) float, default to
1.0
● scale: (optional) float, default to
1.0
● shift: (optional) float, default to
0.0
[Constraint]
● power! = 1
● scale * x + shift > 0
[Quantitative tool support]
Yes

23 Prelu Activation function [Input]


One input
[Parameter]
● filler: optional
● channel_shared: (optional) bool,
indicating whether to share slope
parameters across channels,
default to false
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 272


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

24 PriorBox Obtains the real [Input]


location of the One input
target from the box
proposals. [Parameter]
● min_size: (mandatory) indicating
the minimum frame size (in
pixels)
● max_size: (mandatory) indicating
the maximum frame size (in
pixels)
● aspect_ratio: array, float. A
repeated ratio is ignored. If no
aspect ratio is provided, the
default ratio 1 is used.
● flip: (optional) bool, default to
true. The value true indicates that
each aspect ratio is reversed. For
example, for aspect ratio r, the
aspect ratio 1.0/r is generated.
● clip: (optional) bool, default to
false. The value true indicates
that the previous value is clipped
to the range [0, 1].
● variance: array, used to adjust the
variance of the BBoxes
● img_size: (optional) uint32,
exclusive with img_h or img_w
● img_h: (optional) uint32
● img_w: (optional) uint32
● step: (optional) float, exclusive
with step_h or step_w
● step_h: (optional) float
● step_w: (optional) float
● offset: float, default to 0.5
[Constraint]
Used for the SSD network only
Output dimensions: [n, 2, detected
boxes x 4, 1]
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 273


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

25 Proposal Sorts the box [Input]


proposals by Three inputs (scores, bbox_pred,
(proposal, score) im_info)
and obtains the top
N proposals by [Parameter]
using the NMS. ● feat_stride: (optional) float
● base_size: (optional) float
● min_size: (optional) float
● ratio: float array
● scale: float array
● pre_nms_topn: (optional) int32
● post_nms_topn: (optional) int32
● nms_thresh: (optional) float
[Constraint]
● Used only for Faster R-CNN
● ProposalParameter and
PythonParameter are exclusive.
● Value range of preTopK: 1-6,144
● Value range of postTopK: 1-1,024
● scaleCnt x ratioCnt ≤ 64
● nmsTresh: threshold for
Intersection-over-Union (IoU) box
filtering, 0 < nmsTresh ≤ 1
● minSize: minimum edge length of
a box. A value less than this
parameter is filtered out.
● featStride: H/W stride between
the two adjacent boxes used in
default box generation
● baseSize: default box size used in
default box generation
● ratio and scale: used in default
box generation
● imgH and imgW: height and
width of the image input to the
network. The values must be
greater than 0.
● Restrictions on the input
dimensions:
clsProb: C = 2 x scaleCnt x ratioCnt
bboxPred: C = 4 x scaleCnt x
ratioCnt
bboxPrior: N = clsProb.N, C = 4 x
scaleCnt x ratioCnt

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 274


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

imInfo: N = clsProb.N, C = 3
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 275


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

26 PSROIPo Position-sensitive [Input]


oling region-of-interest Two inputs
pooling
(PSROIPooling) [Parameter]
● spatial_scale: (mandatory) float
● output_dim: (mandatory) int32,
indicating the number of output
channels
● group_size: (mandatory) int32,
indicating the number of groups
to encode position-sensitive score
maps
[Constraint]
Used for the Region-based Fully
Convolutional Network (R-FCN)
● ROI coordinates [roiN, roiC, roiH,
roiW]: 1 ≤ roiN ≤ 65535, roiC == 5,
roiH == 1, roiW == 1
● Dimensions of the input feature
map: [xN, xC, xH, xW]
pooledH == pooledW ==
groupSize ≤ 128
pooledH and pooledW indicate
the length and width of the
pooled ROI.
● Output format: y [yN, yC, yH, yW]
● poolingMode == avg pooling,
pooledH == pooledW ==
groupSize, pooledH ≤ 128,
spatialScale > 0, groupSize > 0,
outputDim > 0
● 1 ≤ xN ≤ 65535, roisN % xN == 0
● HW_LIMIT defines the limits of
xH and xW.
xHW = xH * xW
pooledHW = pooledH * pooledW
HW_LIMIT = (64 x 1024 – 8 x
1024)/32
xH ≥ pooledH, xW ≥ pooledW
xHW ≥ pooledHW
xHW/pooledHW ≤ HW_LIMIT
● In multi-batch scenarios, the ROIs
are allocated equally to the
batches. In addition, the batch

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 276


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

sequence of the ROIs is the same


as the feature.
[Quantitative tool support]
Yes

27 Relu Activation function, [Input]


including common One input
ReLU and Leaky
ReLU, which can be [Parameter]
specified by ● negative_slope: (optional) float,
parameters default to 0
● engine: (optional) enum, default
to 0, CAFFE = 1, CUDNN = 2
[Constraint]
None
[Quantitative tool support]
Yes

28 Reshape Reshapes the input. [Input]


One input
[Parameter]
● shape: constant, int64 or int
● axis: (optional) int32, default to 0
● num_axes: (optional) int32,
default to -1
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 277


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

29 ROIAlign Aggregates features [Input]


using ROIs. At least two inputs
[Parameter]
● pooled_h: (optional) uint32,
default to 0
● pooled_w: (optional) uint32,
default to 0
● spatial_scale: (optional) float,
default to 1
● sampling_ratio: (optional) int32,
default to -1
[Constraint]
Mainly used for Mask R-CNN
● Restrictions on the feature map:
− H x W ≤ 5,248 (N > 1) or W x C <
40,960 (N = 1)
− C ≤ 1,280
− ((C - 1)/128 + 1) x pooledW ≤ 216
● Restrictions on the ROI:
− C = 5 (caffe), H = 1, W = 1
− samplingRatio x pooledW ≤ 128
and samplingRatio x pooledH ≤ 128
− H ≥ pooledH, W ≥ pooledW
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 278


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

30 ROIPooli Maps ROI proposals [Input]


ng to a feature map. At least two inputs
[Parameter]
● pooled_h: (mandatory) uint32,
default to 0
● pooled_w: (mandatory) uint32,
default to 0
● spatial_scale: (mandatory) float,
default to 1. The multiplication
spatial scale factor is used to
convert ROI coordinates from the
input scale to the pool scale.
[Constraint]
Mainly used for Faster R-CNN
● Input dimensions: H x W ≤ 8,160,
H ≤ 120, W ≤ 120
● Output dimensions: pooledH ≤ 20,
pooledW ≤ 20
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 279


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

31 Scale out = alpha x Input [Input]


+ beta Two inputs, each with four
dimensions
[Parameter]
● axis: (optional) int32, default to 1.
Only 1 or –3 is supported.
● num_axes: (optional) int32,
default to 1
● filler: (optional) ignored unless
only one bottom is given and
scale is a learned parameter
● bias_term: (optional) bool,
default to false, indicating
whether to learn a bias
(equivalent to ScaleLayer +
BiasLayer, but may be more
efficient). Initialized with
bias_filler.
● bias_filler: (optional) default to 0
[Constraint]
shape of scale and bias: (n, c, 1, 1),
with the C dimension equal to that of
the input
[Quantitative tool support]
Yes

32 ShuffleCh Shuffles [Input]


annel information across One input
the feature
channels. [Parameter]
group: (optional) uint32, default to 1
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 280


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

33 Sigmoid Activation function [Input]


One input
[Parameter]
engine: (optional) enum, default to
0, CAFFE = 1, CUDNN = 2
[Constraint]
None
[Quantitative tool support]
Yes

34 Slice Slices an input into [Input]


multiple outputs. One input
[Parameter]
● slice_dim: (optional) uint32,
default to 1, exclusive with axis
● slice_point: array, uint32
● axis: (optional) int32, default to 1,
indicating concatenation along the
channel dimension
[Constraint]
None
[Output]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 281


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

35 Softmax Normalized logic [Input]


function One input
[Parameter]
● engine: (optional) default to 0,
CAFFE = 1, CUDNN = 2
● axis: (optional) int32, default to 1,
indicating the axis along which
softmax is performed
[Constraint]
Softmax can be performed on each
of the four input dimensions.
According to axis:
● When axis = 1: C ≤ ((256 x
1024/4) – 8 x 1024 – 256)/2
● When axis = 0: n ≤ (56 x 1024 –
256)/2
● When axis = 2: W = 1, 0 < h <
(1024 x 1024/32)
● When axis = 3: 0 < W < (1024 x
1024/32)
If the input contains fewer than four
dimensions, softmax is performed
only on the last dimension, with the
last dimension ≤ 46,080.
[Quantitative tool support]
Yes

36 Tanh Activation function [Input]


One input
[Parameter]
engine: (optional) enum, default to
0, CAFFE = 1, CUDNN = 2
[Constraint]
The number of tensor elements
cannot exceed INT32_MAX.
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 282


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

37 Upsampl Backward [Input]


e propagation of max Two inputs
pooling
[Parameter]
scale: (optional) int32, default to 1
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 283


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

38 SSDDetec SSD network [Input]


tionOutp detection output Three inputs
ut
[Parameter]
● num_classes: (mandatory) int32,
indicating the number of classes
to be predicted
● share_location: (optional) bool,
default to true, indicating that
classes share one bounding box
● background_label_id: (optional)
int32, default to 0
● nms_param: (optional) indicating
non-maximum suppression (NMS)
● save_output_param: (optional)
indicating whether to save the
detection result
● code_type: (optional) default to
CENTER_SIZE
● variance_encoded_in_target:
(optional) bool, default to true.
The value true indicates that the
variance is encoded in the target,
otherwise the prediction offset
needs to be adjusted accordingly.
● keep_top_k: (optional) int32,
indicating the total number of
BBoxes to be reserved for each
image after NMS
● confidence_threshold: (optional)
float, indicating that only the
detection whose confidence is
above the threshold is considered.
If this parameter is not set, all
boxes are considered.
● nms_threshold: (optional) float
● top_k: (optional) int32
● boxes: (optional) int32, default to
1
● relative: (optional) bool, default
to true
● objectness_threshold: (optional)
float, default to 0.5
● class_threshold: (optional) float,
default to 0.5
● biases: array

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 284


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

● general_nms_param: optional
[Constraint]
● Used for the SSD network only
● Value range of preTopK and
postTopK: 1–1024
● shareLocation = true
● nmsEta = 1
● Value range of numClasses: 1–
2048
● code_type = CENTER_SIZE
● Value range of nms_threshold
and confidence_threshold: 0.0–
1.0
[Quantitative tool support]
Yes

39 Reorg Real-time object [Input]


detection One input
[Parameter]
● stride: (optional) uint32, default
to 2
● reverse: (optional) bool, default
to false
[Constraint]
sed only for YOLOv2
[Quantitative tool support]
No

40 Reverse Reversion [Input]


One input
[Parameter]
axis: (optional) int32, default to 1.
Controls the axis to be reversed. The
content layout will not be reversed.
[Constraint]
None
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 285


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

41 LeakyRel LeakyRelu [Input]


u activation function One input
[Parameter]
Same as ReLU
[Constraint]
None
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 286


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

42 YOLODet YOLO network [Input]


ectionOu detection output Four inputs
tput
[Parameter]
● num_classes: (mandatory) int32,
indicating the number of classes
to be predicted
● share_location: (optional) bool,
default to true, indicating that
classes share one bounding box
● background_label_id: (optional)
int32, default to 0
● nms_param: (optional) indicating
non-maximum suppression (NMS)
● save_output_param: (optional)
indicating whether to save the
detection result
● code_type: (optional) default to
CENTER_SIZE
● variance_encoded_in_target:
(optional) bool, default to true.
The value true indicates that the
variance is encoded in the target,
otherwise the prediction offset
needs to be adjusted accordingly.
● keep_top_k: (optional) int32,
indicating the total number of
BBoxes to be reserved for each
image after NMS
● confidence_threshold: (optional)
float, indicating that only the
detection whose confidence is
above the threshold is considered.
If this parameter is not set, all
boxes are considered.
● nms_threshold: (optional) float
● top_k: (optional) int32
● boxes: (optional) int32, default to
1
● relative: (optional) bool, default
to true
● objectness_threshold: (optional)
float, default to 0.5
● class_threshold: (optional) float,
default to 0.5
● biases: array

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 287


Huawei HiLens
User Guide A Caffe Operator Boundaries

No. Operator Definition Boundary

● general_nms_param: optional
[Constraint]
● sed only for YOLOv2
● classNUm < 10,240; anchorBox ≤ 8
● W ≤ 1,536
● The upper layer of
yolodetectionoutput must be the
yoloregion operator.
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 288


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

B TensorFlow Operator Boundaries

Table B-1 shows the boundaries of TensorFlow operators supported by .om


models.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 289


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

Table B-1 TensorFlow operator boundaries


No. Python API C++ API Boundary

1 tf.nn.avg_pool AvgPool [Parameter]


Type: Mean ● value: 4D tensor of type float32,
with shape [batch, height, width,
channels]
● ksize: list or tuple of four integers,
each value corresponding to the
window size for each dimension of
the input tensor.
● strides: list or tuple of four integers.
Each value corresponding to the
stride of the sliding window for
each dimension of the input tensor.
● padding: string, either VALID or
SAME
● data_format: string, either NHWC
(default) or NCHW
● name: (optional) string
[Constraint]
● kernelH ≤ inputH + padTop +
padBottom
● kernelW ≤ inputW + padLeft +
padRight
● padTop < windowH
● padBottom < windowH
● padLeft < windowW
● padRight < windowW
In addition to common restrictions, the
following restrictions must be satisfied.
The global pooling mode supports
only the following scenarios:
● outputH == 1 && outputW == 1 &&
kernelH ≥ inputH && kernelW ≥
inputW
● inputH*inputW ≤ 10,000
[Output]
Tensor of the identical data type as
value
[Quantitative tool support]
Yes

2 tf.nn.max_poo MaxPool Same as tf.nn.avg_pool


l

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 290


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

3 tf.nn.conv2d Conv2D [Parameter]


● value: 4D tensor, with shape [batch,
height, width, channels]
● Data type: float32
● filter: constant tensor, with same
data type and dimensions as value,
with shape [filter_height,
filter_width, in_channels,
out_channels]
● strides: non-null list or tuple of four
integers, each value corresponding
to the stride of the sliding window
for each dimension of the input
tensor
● padding: non-null string, either
VALID or SAME
● use_cudnn_on_gpu: bool, default
to True
● data_format: non-null string, either
NHWC (default) or NCHW
● dilations: (optional) list of four
integers, default to [1,1,1,1], each
value corresponding to a dimension.
If k > 1, k – 1 units are skipped at
the corresponding dimension in
filtering. The dimension sequence is
determined by data_format. The
values of batch and depth of
dilations must be 1.
● name: (optional) string
[Constraint]
● (inputW + padWHead + padWTail)
≥ (((FilterW-1) x dilationW) + 1)
● (inputW + padWHead + padWTail)/
StrideW + 1 ≤ INT32_MAX
● (inputH + padHHead + padHTail) ≥
(((FilterH-1) x dilationH) + 1)
● (inputH + padHHead + padHTail)/
StrideH + 1 ≤ INT32_MAX
● 0 ≤ Pad < 256, 0 < FilterSize < 256,
0 < Stride < 64, 1 ≤ dilationsize <
256
[Output]
Tensor of the identical data type as
value

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 291


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

[Quantitative tool support]


Yes

4 tf.concat Concat [Parameter]


● values: list of tensor objects or a
single tensor. The values of
dimensions must be the same
except the dimensions to be
concatenated.
● axis: 0D tensor of type int32,
specifying the dimension to be
concatenated. The value range is [–
rank(values), rank(values)]. As in
Python, indexing for axis is 0-based.
Positive axis in the range [0,
rank(values)) refers to axis-th
dimension, while negative axis
refers to [axis + rank(values)]-th
dimension.
[Constraint]
For the input tensor, the sizes of its
dimensions must be the same except
the dimension for concatenation.
The range of the input tensor count is
[1, 1000].
[Output]
Tensor, resulting from concatenation of
the input tensors
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 292


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

5 tf.matmul MatMul [Parameter]


● a: non-constant tensor of type
float32, rank ≥ 2
● b: constant tensor with the same
data type and rank as a
● transpose_a: The value true
indicates that a is transposed before
multiplication.
● transpose_b: The value true
indicates that b is transposed
before multiplication. If
transpose_a is false, transpose_b is
also false.
● adjoint_a: The value true indicates
that a is conjugated and transposed
before multiplication.
● adjoint_b: The value true indicates
that b is conjugated and transposed
before multiplication.
● a_is_sparse: The value true
indicates that a is treated as a
sparse matrix.
● b_is_sparse: The value true
indicates that b is treated as a
sparse matrix.
● name: optional
[Constraint]
● The transposing property of weight
is false.
● The multiplication of two tensors is
not supported. Only one tensor by
one constant is supported.
[Output]
Tensor of the identical data type as a
and b
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 293


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

6 tf.nn.fused_ba FusedBatchN [Parameter]


tch_norm orm ● x: 4D tensor of type float32
● scale: 1D tensor for scaling
● offset: 1D tensor for bias
● mean: 1D tensor for population
mean used for inference
● variance: 1D tensor for population
variance used for inference
● epsilon: small float number added
to the variance of x
● data_format: data format for x,
either NHWC (default) or NCHW
● is_training: bool, specifying
whether the operation is used for
training or inference
● name: (optional) operation name
[Constraint]
shape of scale, bias, mean, and var:
(1, C, 1, 1), with the C dimensions
equal to that of the input
[Output]
● y: 4D tensor for the normalized,
scaled, offset x
● batch_mean: 1D tensor for the
mean of x
● batch_var: 1D Tensor for the
variance of x
[Quantitative tool support]
No

7 tf.abs Abs [Parameter]


● x: tensor or sparse tensor of type
float32
● name: (optional) operation name
[Constraint]
None
[Output]
Returns the absolute value of x, tensor
or sparse tensor. The size and type are
the same as those of x.
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 294


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

8 tf.image.resize ResizeNearest [Parameter]


_nearest_neig Neighbor ● images: 4D tensor of type float32,
hbor with shape [batch, height, width,
channels] or 3D tensor of type
float32 with shape [height, width,
channels]
● size: 1D 2-element constant tensor,
indicating the new size for the
images
● method:
ResizeMethod.NEARESTNEIGHBO
R
● align_corners: bool, default to
False. The value True indicates that
the centers of the 4 corner pixels of
the input and output tensors are
aligned and the values at the
corner pixels are preserved.
[Constraint]
None
[Output]
Tensor of type float, with the identical
shape as the input
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 295


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

9 tf.image.resize ResizeBilinear [Parameter]


_bilinear ● images: 4D non-constant tensor of
type float32, with shape [batch,
height, width, channels]
● size: 1D 2-element constant tensor,
indicating the new size for the
images
● method: ResizeMethod.BILINEAR
● align_corners: bool, default to
False. The value True indicates that
the centers of the 4 corner pixels of
the input and output tensors are
aligned and the values at the
corner pixels are preserved.
[Constraint]
(outputH x outputW)/(inputH x
inputW) > 1/7
[Output]
Tensor of type float, with the identical
shape as the input
[Quantitative tool support]
No

10 tf.cast Cast [Input]


Type: float32, int32, bool, int64, int16,
int8, uint8, uint16, double
[Parameter]
● x: Tensor, SparseTensor, or
IndexedSlices
● dtype: destination type, same as
the data type of x
● name: optional
[Constraint]
None
[Output]
Tensor, SparseTensor, or IndexedSlices
with the same dtype and shape as the
input
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 296


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

11 tf.nn.depthwis DepthwiseCo [Parameter]


e_conv2d nv2dNative ● input: 4D
● filter: 4D constant, with shape
[filter_height, filter_width,
in_channels, channel_multiplier]
● strides: non-null list of four
integers, each value corresponding
to the stride of the sliding window
for each dimension of the input
tensor
● padding: string, either VALID or
SAME
● rate: 1D of size 2. The dilation rate
in which we sample input values
across the height and width
dimensions in atrous convolution. If
i\t is greater than 1, then all values
of strides must be 1.
● data_format: data format for input,
either NHWC (default) or NCHW
● name: optional
[Constraint]
filterN = inputC = group
[Output]
4D tensor, with shape according to
data_format. For example, for format
NHWC, shape = [batch, out_height,
out_width, in_channels *
channel_multiplier]
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 297


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

12 tf.reshape Reshape [Parameter]


● tensor: 1 tensor input
● shape: constant tensor of type
int64 or int, indicating the output
shape
● name: (optional) operation name
[Constraint]
None
[Output]
Tensor of the identical data type as
input
[Quantitative tool support]
Yes

13 tf.squeeze Squeeze [Parameter]


● input: non-constant tensor
● axis: list of ints, specifying the
dimensions to be squeezed, default
to []. It is an error to squeeze a
dimension that is not 1.
● name: (optional) operation name
● squeeze_dims: (deprecated)
exclusive with axis
[Constraint]
None
[Output]
Tensor, with the same data and type
as input, but has one or more
dimensions of size 1 removed.
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 298


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

14 tf.expand_dim ExpandDims [Parameter]


s ● inuput: 1 tensor input
● axis: 0D (scalar), specifying the
dimension index of the extended
input shape
● name: name of the output tensor
● dim: 0D (scalar), equivalent to axis
(deprecated)
[Constraint]
None
[Output]
Tensor with the same data as input,
but its shape has an additional
dimension of size 1 added
[Quantitative tool support]
Yes

15 tf.greater Greater [Parameter]


● x: 1 tensor input
● y: scalar
● name: (optional) operation name
[Constraint]
Broadcasting is supported, so the
shape of x and shape of y are
compared. For a right-aligned
dimension, if the values of xdim[i]
and ydim[i] are not the same, one of
them must be 1 or missing.
[Output]
Tensor of type bool
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 299


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

16 tf.nn.relu Relu [Parameter]


● features: non-constant tensor
● name: (optional) operation name
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
Yes

17 tf.nn.relu6 Relu6 [Parameter]


● features: non-constant tensor
● name: (optional) operation name
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
Yes

18 tf.nn.leaky_rel / [Parameter]
u ● features: non-constant tensor
representing pre-activation values
● alpha: slope of the activation
function at x < 0
● name: (optional) operation name
[Constraint]
None
[Output]
Activation value
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 300


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

19 tf.exp exp [Parameter]


● x: tensor of type float32 or double
● name: (optional) operation name
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 301


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

20 tf.nn.conv2d_t Conv2DBackp [Parameter]


ranspose ropInput ● value: 4D tensor with shape [batch,
height, width, in_channels] for
NHWC data format or [batch,
in_channel, height, width] for
NCHW data format
● filter: 4D constant tensor with
shape [height, width,
output_channels, in_channels]
● output_shape: 1D tensor, indicating
the output shape
● strides: non-null list of integers,
each value corresponding to the
stride of the sliding window for
each dimension of the input tensor
● padding: non-null string, either
VALID or SAME
● data_format: non-null string, either
NHWC or NCHW
● name: (optional) output name
[Constraint]
● group = 1
● dilation = 1
● filterH - padHHead - 1 ≥ 0
● filterW - padWHead - 1 ≥ 0
Restrictions involving intermediate
variables:
1. a = ALIGN(filter_num, 16) x
ALIGN(filter_c, 16) x filter_h x
filter_w x 2
2. If ALIGN(filter_c, 16)%32 = 0, a =
a/2
3. conv_input_width = (deconvolution
input W – 1) x strideW + 1
4. b = (conv_input_width) x filter_h x
ALIGN(filter_num, 16) x 2 x 2
5. a + b <= 1024*1024
[Output]
Tensor of the identical data type as
value
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 302


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

21 tf.sigmoid Sigmoid [Parameter]


● x: 1 tensor input
● name: (optional) operation name
[Constraint]
None
[Output]
Tensor of the identical data type as
value
[Quantitative tool support]
Yes

22 tf.add Add [Parameter]


● x: Tensor of type float32 or int32
● y: Tensor of the identical data type
as x. For two constant inputs, one
of them is a scalar.
● name: (optional) operation name
[Constraint]
If the two inputs have inconsistent
dimensions, broadcasting (that is,
dimension padding) is performed.
Broadcasting is supported in the
following scenarios:
● NHWC + NHWC, NHWC + scalar
● NHWC + 1 1 1 1
● NHWC + W, HWC + W, HW + W
(W-based broadcasting)
● NCHW + NH1C, HWC + H1C, HW +
H1
● HWC + 1 WC (H-based
broadcasting)
NOTE
The input sequence of the two tensors is
not fixed.
[Output]
Tensor of the identical data type as y
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 303


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

23 tf.multiply Multiply [Parameter]


Type: Mul ● x: Tensor of type float32 or int32
● y: Tensor of the identical data type
as x. If two constants are input,
their dimensions must be identical
(scalar or 1D tensor)
● name: (optional) operation name
[Constraint]
If the two inputs have inconsistent
dimensions, broadcasting (that is,
dimension padding) is performed.
Broadcasting is supported in the
following scenarios:
● NHWC + NHWC, NHWC + scalar
● NHWC + 1 1 1 1
● NHWC + W, HWC + W, HW + W
(W-based broadcasting)
● NCHW + NH1C, HWC + H1C, HW +
H1
● HWC + 1 WC (H-based
broadcasting)
NOTE
The input sequence of the two tensors is
not fixed.
[Output]
1 tensor
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 304


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

24 tf.subtract Subtract [Parameter]


Type: Sub ● x: 1 tensor input
● y: Tensor of the identical data type
as x, constant or non-constant
● name: (optional) operation name
[Constraint]
If the two inputs have inconsistent
dimensions, broadcasting (that is,
dimension padding) is performed.
Broadcasting is supported in the
following scenarios:
● NHWC + NHWC, NHWC + scalar
● NHWC + 1 1 1 1
● NHWC + W, HWC + W, HW + W
(W-based broadcasting)
● NCHW + NH1C, HWC + H1C, HW +
H1
● HWC + 1 WC (H-based
broadcasting)
NOTE
The input sequence of the two tensors is
not fixed.
[Output]
1 tensor
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 305


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

25 tf.nn.bias_add BiasAdd [Parameter]


● value: non-constant tensor
● bias: 1D constant tensor, with size
matching the last dimension of
value, of the same type as value
unless value is a quantized type
● data_format: string, either NHWC
or NCHW
● name: (optional) operation name
[Constraint]
● C < 10,000
● input and bias must have the same
data layout.
● When bias is added to the C
dimension, the C dimensions of
input and bias must of the same
size.
[Output]
Tensor of the identical data type as
value
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 306


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

26 tf.nn.lrn LRN [Parameter]


● input: 4D tensor of type float32
● depth_radius: 0D of type int,
default to 5, indicating the half-
width of the 1D normalization
window
● bias: (optional) float, default to 1,
indicating the offset (usually
positive to avoid dividing by 0)
● alpha: (optional) float, default to 1,
indicating the scale factor, usually
positive
● beta: (optional) float, default to
0.5, indicating an exponent
● name: (optional) operation name
[Constraint]
● depth_radius is an odd number
greater than 0.
● Inter-channel:
When depth_radius is within
[1,15], alpha > 0.00001 and beta >
0.01; Otherwise, alpha and beta
are of any values. When C > 1,776,
depth_radius < 1,728.
[Output]
Tensor of the identical data type as
input
[Quantitative tool support]
Yes

27 tf.nn.elu Elu [Parameter]


● features: non-constant tensor
● name: optional
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 307


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

28 tf.rsqrt Rsqrt [Parameter]


● x: tensor input
● name: optional
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
Yes

29 tf.log Log [Parameter]


● x: Tensor of type float32
● name: optional
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

30 tf.tanh Tanh [Parameter]


● x: non-constant tensor
● name: optional
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 308


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

31 tf.slice Slice [Parameter]


● input_: tensor input
● begin: tensor of type int32 or int64
● size: Tensor of type int32 or int64
● name: optional
[Constraint]
The number of tensor elements cannot
exceed INT32_MAX.
[Output]
Tensor of the identical data type as
input_
[Quantitative tool support]
Yes

32 tf.split Split [Parameter]


● value: tensor input
● num_or_size_splits: not supported
● axis: integer, specifying the
dimension along which to split
● name: (optional), string
[Constraint]
None
[Output]
List of tensor objects resulting from
splitting
[Quantitative tool support]
Yes

33 tf.nn.softplus Softplus [Parameter]


● features: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 309


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

34 tf.nn.softsign Softsign [Parameter]


● features: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
No

35 tf.pad Excessive CPU [Parameter]


usage usually ● tensor: 4D tensor of type float32
means and int32
insufficient
idle CPUs in ● paddings: constant tensor of type
the system. int32
● mode: string, CONSTANT,
REFLECT, or SYMMETRIC
● name: (optional), string
● constant_values: scalar pad value
to use, of the identical data type as
tensor.
[Constraint]
In CONSTANT mode: 0 ≤ PAD ≤ 128, 0
< W ≤ 3000
[Output]
Tensor of the identical data type as
tensor
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 310


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

36 tf.fake_quant_ FakeQuantWi [Parameter]


with_min_ma thMinMaxVar ● inputs: Tensor of type float32
x_vars s
● min: tensor of type float32
● max: tensor of type float32
● num_bits: scalar of type int, default
to 8
● narrow_range: (optional) bool,
default to False
● name: (optional), string
[Constraint]
-65,504 ≤ min ≤ 65,504, -65,504 ≤ max
≤ 65,504
[Output]
Tensor of type float32
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 311


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

37 tf.reduce_max Max [Parameter]


● input_tensor: Tensor, must be one
of the following types: float32,
int64, int32, uint8, uint16, int16,
int8
● axis: 1D list or scalar of type
integer
● keepdims: bool, indicating whether
to retain reduced dimensions with
length 1
● name: (optional), string
● reduction_indices: (deprecated)
equivalent to axis
● keep_dims: (deprecated) equivalent
to keepdims
[Constraint]
● When the input tensor has four
dimensions: input axis = {3,{1,2,3}},
keepDims = true, H * W * 16 * 2 ≤
16 * 1024
● When the input tensor has two
dimensions: input axis = {1,{1}},
keepDims = true, H * W * CEIL(C,
16) * 16 * 2 ≤ 16 * 1024
[Output]
Reduced Tensor of the identical data
type as input_tensor
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 312


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

38 tf.strided_slice StridedSlice [Parameter]


● input: 1 tensor
● begin: 1D tensor of type int32
● end: 1D tensor of type int32
● strides: 1D tensor of type int32
● begin_mask: scalar of type int32
● end_mask: scalar of type int32
● ellipsis_mask: scalar of type int32
● new_axis_mask: scalar of type
int32
● new_axis_mask: scalar of type
int32
● var: variable corresponding to
input_ or None
● name: (optional), string
[Constraint]
strides ≠ 0
[Output]
Tensor of the identical data type as
input_
[Quantitative tool support]
No

39 tf.reverse Reverse [Parameter]


● tensor: list of tensor objects
● axis: int32 or int64, indicating the
dimensions to reverse
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
tensor
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 313


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

40 tf.realdiv RealDiv [Parameter]


● x: Tensor of type float32
● y: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
Yes

41 tf.stack Stack [Parameter]


● values: list of tensor objects with
the same shape and type (float32
or int32)
● axis: (mandatory) integer,
indicating the axis to stack along,
default to the first dimension
● name: optional
[Constraint]
None
[Output]
Stacked tensor of the identical data
type as values
Mandatory attributes: T, N, and axis
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 314


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

42 tf.unstack Unpack [Parameter]


● value: tensor (rank > 0) to be
unstacked, of type float32 or int32
● num: integer, indicating the length
of the dimension axis, default to
None
● axis: (mandatory) integer,
indicating the axis to unstack along,
default to the first dimension
● name: optional
[Constraint]
None
[Output]
List of tensor objects unstacked from
value
[Quantitative tool support]
No

43 tf.transpose Transpose [Parameter]


● a: tensor input
● perm: permutation of the
dimensions of a
● name: optional
● conjugate: (optional) bool, default
to False. Setting it to True is
mathematically equivalent to
tf.conj(tf.transpose(input))
[Constraint]
None
[Output]
Resulting tensor after transposition
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 315


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

44 tf.space_to_ba SpaceToBatch [Parameter]


tch_nd ND ● input: ND tensor with shape
input_shape = [batch] +
spatial_shape + remaining_shape,
where spatial_shape has M
dimensions. The following data
types are supported: uint8, int8,
int16, uint16, int32, int64, and
float32
● block_shape: 1D Tensor of type
int32 or int64, with shape [M]. All
values must be ≥ 1.
● paddings: 2D tensor of type int32
or int64, with shape [M, 2]. All
values must be ≥ 0.
[Constraint]
When the tensor rank is 4:
The length of blockShape must be 2,
and the length of paddings must be 4.
● Element value of blockShape ≥ 1;
Element value of paddings ≥ 0
● The padded H dimension is a
multiple of blockShape[0], and the
padded W dimension is a multiple
of blockShape[1].
[Output]
Tensor of the identical data type as
input
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 316


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

45 tf.batch_to_sp BatchToSpace [Parameter]


ace_nd ND ● input: ND tensor with shape
input_shape = [batch] +
spatial_shape + remaining_shape,
where spatial_shape has M
dimensions. The following data
types are supported: uint8, int8,
int16, uint16, int32, int64, and
float32
● block_shape: 1D Tensor of type
int32 or int64, with shape [M]. All
values must be ≥ 1.
● crops: 2D tensor of type int32 or
int64, with shape [M, 2]. All values
must be ≥ 0.
[Constraint]
● The element data type of
blockShape and crops must be
int32. When the dimension count of
the tensor is 4, the length of
blockShape must be 2, and the
length of crops must be 4.
● Element value of blockShape ≥ 1;
Element value of crops ≥ 0; for the
crops array: crop_start[i] +
crop_end[i] < block_shape[i] *
input_shape[i+1]
[Output]
Tensor of the identical data type as
images
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 317


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

46 tf.extract_ima ExtractImageP [Parameter]


ge_patches atches ● images: 4D tensor with shape
[batch, in_rows, in_cols, depth],
must be one of the following types:
float32, int32, int64, uint8, int8,
uint16, and int16
● ksizes: list of ints with length ≥ 4
● strides: list of ints, must be [1,
stride_rows, stride_cols, 1]
● rate: list of ints, must be [1,
rate_rows, rate_cols, 1]
● padding: string, either VALID or
SAME. VALID indicates that the
selected patch area must be
completely included in the source
image. SAME indicates that the
part that exceeds the source image
is padded with 0.
● name: optional
[Constraint]
None
[Output]
Tensor of the identical data type as
images
[Quantitative tool support]
No

47 tf.floormod FloorMod [Parameter]


● x: Tensor of type float32 or int32
● y: Tensor of the identical data type
as x
● name: optional
[Constraint]
Broadcasting is supported, so the
shape of x and shape of y are
compared. For a right-aligned
dimension, if the values of xdim[i]
and ydim[i] are not the same, one of
them must be 1 or missing.
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 318


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

48 tf.nn.softmax Softmax [Parameter]


● logits: non-null Tensor of type
float32
● axis: dimension softmax to be
performed on, default to –1,
indicating the last dimension. The
value cannot be greater than the
rank of logits.
● name: optional
● dim: (deprecated) equivalent to
axis
[Constraint]
● Softmax can be performed on each
of the four input dimensions.
According to axis:
When axis = 1: C ≤ ((256 x 1024/4)
– 8 x 1024 – 256)/2
When axis = 0: n ≤ (56 x 1024 –
256)/2
When axis = 2: W = 1, 0 < h < (1024
x 1024/32)
When axis = 3: 0 < W < (1024 x
1024/32)
● If the input contains fewer than
four dimensions, softmax is
performed only on the last
dimension, with the last dimension
≤ 46,080.
[Output]
Tensor of the identical type and shape
as logits
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 319


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

49 tf.math.pow Power [Parameter]


● x: Tensor of type float32
● y: Tensor of type float32
● name: optional
[Constraint]
power! = 1
scale*x + shift > 0
[Output]
1 tensor
[Quantitative tool support]
Yes

50 tf.placeholder - [Parameter]
● dype: (mandatory) data type
● shape: (mandatory) shape of the
tensor to be fed
[Constraint]
None
[Output]
1 tensor
[Quantitative tool support]
No

51 tf.shape Shape [Parameter]


● input: Tensor or SparseTensor
● name: (optional), string
● out_type: data type for the output
tensor, either int32 (default) or
int64
[Constraint]
None
[Output]
Tensor of the data type specified by
out_type
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 320


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

52 tf.math.argma ArgMax [Parameter]


x ● input: Tensor, must be one of the
following types: int8, uint8, int16,
uint16, int32, int64, float32
● axis: 1 tensor of type: int32 or int64
● out_type: data type for the output
tensor, either int32 or int64
(default)
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the data type specified by
out_type
[Quantitative tool support]
No

53 tf.gather Gather [Parameter]


GatherV2 ● params: 1 tensor, must be at least
rank axis + 1
● indices: tensor of type int32 or
int64, must be in range [0,
params.shape[axis])
● axis: output tensor of type int32 or
int64, specifying the axis in params
to gather indices from, rank = 0
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
params
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 321


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

54 tf.gather_nd GatherNd [Parameter]


● params: 1 tensor, must be at least
rank axis + 1
● indices: 1 tensor of type: int32 or
int64
● name: (optional), string
[Constraint]
● indices: The last dimension of
indices can be at most the rank of
params.
● The elements in the last dimension
of indices correspond to the
coordinates along a dimension of
params. Therefore, the coordinate
rules must be met.
● The coordinates of the
corresponding dimension in the
indices cannot exceed the
dimension size.
[Output]
Tensor of the identical data type as
params
[Quantitative tool support]
Yes

55 tf.math.floord FloorDiv [Parameter]


iv ● x: Tensor of type float32 or int32
● y: Tensor, denominator of type
float32 or int32
● name: (optional), string
[Constraint]
Broadcasting is supported, so the
shape of x and shape of y are
compared. For a right-aligned
dimension, if the values of xdim[i]
and ydim[i] are not the same, one of
them must be 1 or missing.
[Output]
Tensor, floor (x/y)
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 322


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

56 tf.range Range [Parameter]


● start: start constant scalar of type
float32 or int32
● limit: end constant scalar of type
float32 or int32
● delta: stride constant scalar of type
float32 or int32
● dtype: data type of the resulting
tensor
● name: (optional), string
[Constraint]
None
[Output]
1 1D tensor
[Quantitative tool support]
No

57 tf.tile Tile [Parameter]


● input: Tensor, must be one of the
following types:
int8, uint8, int16, uint16, int32,
int64, float32
● multiples: 1D constant tensor of
type int32. The length must be the
same as that of input.
● name: (optional), string
[Constraint]
None
[Output]
1 tensor
[Quantitative tool support]
Yes

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 323


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

58 tf.size Size [Parameter]


● input: tensor of type float32
● name: (optional), string
● out_type: data type for the output
tensor, default to int32
[Constraint]
None
[Output]
Tensor of the data type specified by
out_type
[Quantitative tool support]
No

59 tf.fill Fill [Parameter]


● dims: 1D tensor of type int32
● value: variable of type int32 or
float32
● name: (optional), string
[Constraint]
The following padding modes are
supported: Constant, GivenTensor,
Range, Diagonal, Gaussian, MSRA,
Uniform, UniformInt, UniqueUniform,
and XavierFill. When the Uniform,
UniformInt, UniqueUniform, and xavier
padding modes are used, the value
range of the generated value is [min,
max).
[Output]
Tensor of the identical data type as
value
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 324


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

60 tf.concat Concat [Parameter]


● value: list of tensor objects of type
int32 or float32
● axis: int32, indicating the
dimensions to concatenate
● name: (optional), string
[Constraint]
For the input tensor, the sizes of its
dimensions must be the same except
the dimension for concatenation.
The range of the input tensor count is
[1, 1000].
[Output]
1 tensor
[Quantitative tool support]
Yes

61 tf.reverse Reverse [Parameter]


● tensor: list of tensor objects
● axis: int32, indicating the
dimensions to reverse
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
tensor
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 325


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

62 tf. sum [Parameter]


reduce_sum ● input_tensor: tensor input
● axis: int32, indicating the
dimensions to sum up
● keepdims: bool, indicating whether
to retain reduced dimensions
● name: (optional), string
● reduction_indices: (deprecated)
string, equivalent to axis
● keep_dims: deprecated alias for
keepdims
[Constraint]
None
[Output]
Tensor of the identical data type as
tensor
[Quantitative tool support]
No

63 tf. Maximum [Parameter]


math.maximu ● max: tensor, must be one of the
m following types: int32, int64, float32
● y: tensor of the identical data type
as x
● name: (optional), string
[Constraint]
Broadcasting is supported, so the
shape of x and shape of y are
compared. For a right-aligned
dimension, if the values of xdim[i]
and ydim[i] are not the same, one of
them must be 1 or missing.
[Output]
Tensor. Returns the max of x and y (x
< y ? x:y)
Identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 326


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

64 tf. Minimum [Parameter]


math.minimu ● max: tensor, must be one of the
m following types: int32, int64, float32
● y: tensor of the identical data type
as x
● name: optional
[Constraint]
Broadcasting is supported in the
following two scenarios:
NHWC + scaler, NHWC + NHWC
[Output]
Tensor. Returns the max of x and y (x
< y ? x:y)
Identical data type as x
[Quantitative tool support]
No

65 tf.clip_by_valu ClipByValue [Parameter]


e ● t: Tensor
● clip_value_min: minimum value to
clip by
● clip_value_max: maximum value to
clip by
● name: (optional), string
[Constraint]
The minimum value must be less than
or equal to the maximum value.
[Output]
Clipped tensor. The return value range
is [clip_value_min, clip_value_max].
[Quantitative tool support]
No

66 tf.math.logical LogicalNot [Parameter]


_not ● x: tensor of type bool
● name: (optional), string
[Constraint]
None
[Output]
Tensor of type bool
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 327


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

67 tf.math.logical LogicalAnd [Parameter]


_and ● x: tensor of type bool
● y: tensor of type bool
● name: (optional), string
[Constraint]
Broadcasting is supported in the
following dimension scenarios: NHWC
and [1,1,1,1], [N,H,W,C], [N,H,W,1],
[1,H,W,C], [N,1,1,C]
[Output]
Tensor of type bool
[Quantitative tool support]
No

68 tf.equal Equal [Parameter]


● x: Tensor
● y: tensor of the identical data type
as x
● name: (optional), string
[Constraint]
Broadcasting is supported, so shape of
x and shape of y are compared. For a
right-aligned dimension, the values of
xdim[i] and ydim[i] are the same. If
not, one of them must be 1 or missing.
[Output]
Tensor of type bool
[Quantitative tool support]
No

69 tf.square Square [Parameter]


● x: Tensor
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 328


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

70 tf.image.crop_ CropAndResiz [Parameter]


and_resize e ● image: 4D tensor, must be one of
the following types: float32, int8,
int32, int64, with shape
[num_boxes, 4]
● boxes: 2D tensor of type float32,
with shape [num_boxes]
● box_ind: 1D tensor of type int32
● crop_size: 1D 2-element tensor of
type int32
● method: string, indicating the
interpolation method, either
bilinear (default) or nearest
● name: (optional), string
[Constraint]
None
[Output]
Tensor of type float32
[Quantitative tool support]
No

71 tf.math.top_k TopKV2 [Parameter]


● input: 1D tensor or higher with the
last dimension at least k, of type
float32 (k: scalar of type int32, ≥ 1)
● sorted: bool
● name: (optional), string
[Constraint]
k must be a constant.
[Output]
● values: tensor, indicating k largest
elements along each last
dimensional slice
● indices: tensor, indicating the
indices of values of input
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 329


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

72 tf.invert_perm InvertPermuta [Parameter]


utation tion ● x: 1D tensor of type int32 or int64
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

73 tf.multinomial Multinomial [Parameter]


● logits: 2D tensor, with shape
[batch_size, num_classes]
● num_samples: scalar, indicating the
number of samples to draw
● seed: int32 or int64, used to create
a random seed
● name: (optional), string
● output_dtype: integer, data type
for the output tensor, default to
int64
[Constraint]
When seed is 0, the generated random
is dynamic.
Number of rows in the output data =
Number of rows in the output data;
Number of columns in the output data
= num_samples
[Output]
Tensor of the data type specified by
output_dtype
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 330


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

74 tf.reverse_seq ReverseSeque [Parameter]


uence nce ● input: tensor input
● seq_lengths: 1D tensor of type
int32 or int64
● seq_axis: scalar of type integer
● batch_axis: scalar of type integer
● name: (optional), string
[Constraint]
● The length of seq_lengths must be
equal to the number of elements of
input in batchAxis.
● The maximum element in
seq_lengths must be less than or
equal to the number of elements in
seq_dim.
● seqAxis, batchAxis, seqDim, and
batchDim must be of type int64.
● seqAxis and seqDim are exclusive.
batchAxis and batchDim are
exclusive.
● batchAxis and batchDim are
optional. The default values are 0.
[Output]
Tensor of the data type specified by
input
[Quantitative tool support]
No

75 tf.math.recipr Reciprocal [Parameter]


ocal ● x: Tensor of type float32
● name: (optional), string
[Constraint]
The input data cannot contain 0.
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 331


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

76 tf.nn.selu Selu [Parameter]


● features: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as
features
[Quantitative tool support]
No

77 tf.math.acosh Acosh [Parameter]


● x: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

78 tf.math.asinh Asinh [Parameter]


● x: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 332


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

79 tf.math.reduc Prod [Parameter]


e_prod ● input_tensor: tensor input
● axis: dimension to reduce
● keepdims: bool, indicating whether
to retain reduced dimensions
● name: (optional), string
● reduction_indices: (deprecated)
equivalent to axis
● keep_dims: (deprecated) equivalent
to keepdims
[Constraint]
None
[Output]
Tensor and reduced tensor
[Quantitative tool support]
No

80 tf.math.sqrt Sqrt [Parameter]


● x: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 333


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

81 tf.math.reduc All [Parameter]


e_all ● input_tensor: tensor of type bool
● axis: dimension to reduce
● keepdims: bool
● name: (optional), string
● reduction_indices: (deprecated)
equivalent to axis
● keep_dims: (deprecated) equivalent
to keepdims
[Constraint]
None
[Output]
Tensor of the identical data type as
input_tensor
[Quantitative tool support]
No

82 tf.nn.l2_norm L2Normalize [Parameter]


alize ● x: Tensor of type boolean
● axis: dimension along which to
normalize
– For format NCHW, axis must be
set to 1.
– For format NHWC, axis must be
set to 3.
● epsilon: lower bound value for the
norm. If norm < sqrt(epsilon),
sqrt(epsilon) is used as the divisor.
● name: (optional), string
● dim: (deprecated) equivalent to
axis
[Constraint]
H*W*2 < 256*1024/4
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 334


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

83 tf.keras.backe Hardsigmoid [Parameter]


nd.hard_sigm x: tensor input
oid
[Constraint]
None
[Output]
Output Tensor. If x < –2.5, 0 is
returned. If x > 2.5, 1 is returned.
If -2.5 ≤ x ≤ 2.5, 0.2 * x + 0.5 is
returned.
[Quantitative tool support]
No

84 tf.keras.layers. ThresholdedR [Parameter]


ThresholdedR eLU theta: scalar of type float32, ≥ 0
eLU
[Constraint]
None
[Output]
Tensor
[Quantitative tool support]
No

85 tf.math.acos Acos [Parameter]


x: Tensor of type float32, int32, or
int64
name: (optional), string
[Constraint]
The input data range is (–1 ≤ x ≤ 1),
and the output data range is (0 ≤ y ≤
π).
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 335


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

86 tf.math.atan Arctan [Parameter]


x: Tensor of type float32, int32, or
int64
name: (optional), string
[Constraint]
The input data range is (-65504 ≤ x ≤
65504), and the output data range is
(-π/2 ≤ y ≤ π/2).
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

87 tf.math.asin Asin [Parameter]


● x: Tensor of type float32, int32, or
int64
● name: (optional), string
[Constraint]
The input data range is (–1 ≤ x ≤ 1),
and the output data range is (-π/2 ≤ y
≤ π/2).
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

88 tf.math.atanh Atanh [Parameter]


● x: Tensor of type float32, int32, or
int64
● name: (optional), string
[Constraint]
Input data range: x within (-1, 1)
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 336


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

89 tf.math.tan Tan [Parameter]


● x: Tensor of type float32, int32, or
int64
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

90 tf.math.logical LogicalOr [Parameter]


_or ● x: Tensor of type bool
● y: Tensor of type bool
● name: (optional), string
[Constraint]
Broadcasting is supported, so shape of
x and shape of y are compared. For a
right-aligned dimension, the values of
xdim[i] and ydim[i] are the same. If
not, one of them must be 1 or missing.
[Output]
Tensor of type bool
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 337


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

91 tf.math.reduc ReduceMin [Parameter]


e_min ● input_tensor: Tensor, must be one
of the following types: float32,
int64, int32, uint8, uint16, int8,
int16
● axis: dimension to reduce
● keepdims: scalar of type bool
● name: (optional), string
● reduction_indices: (deprecated)
equivalent to axis
● keep_dims: (deprecated) equivalent
to keepdims
[Constraint]
● When the input tensor has four
dimensions: input axis = {3,{1,2,3}},
keepDims = true, H * W * 16 * 2 ≤
16 * 1024
● When the input tensor has two
dimensions: input axis = {1,{1}},
keepDims = true, H * W * CEIL(C,
16) * 16 * 2 ≤ 16 * 1024
[Output]
Tensor of the identical data type as
input_tensor
[Quantitative tool support]
No

92 tf.math.negati Neg [Parameter]


ve ● x: Tensor of type float32, int64, or
int32
● name: (optional), string
[Constraint]
The input data range is (-65504 ≤ x ≤
65504), and the output data range is
(-65504 ≤ y ≤ 65504).
[Output]
Tensor. Returns –x.
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 338


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

93 tf.math.greate Greaterequal [Parameter]


r_equal ● x: Tensor, must be one of the
following types: float32, int64,
int32, uint8, uint16, int8, int16
● y: tensor of the identical data type
as x
● name: (optional), string
[Constraint]
The input data range is (-65504 ≤ x ≤
65504)
[Output]
Tensor of type bool
[Quantitative tool support]
No

94 tf.space_to_de SpaceToDepth [Parameter]


pth ● input: tensor, must be one of the
following types: float32, int64,
int32, uint8, int8
● block_size: scalar of type integer, ≥
2
● data_format: string, must be
NHWC (default), NCHW, or
NCHW_VECT_C
● name: (optional), string
[Constraint]
blockSize ≥ 1 and blockSize must be a
divisor of both the input height and
width.
[Output]
Tensor of the identical data type as
input
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 339


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

95 tf.depth_to_sp DepthToSpace [Parameter]


ace ● input: tensor, must be one of the
following types: float32, int64,
int32, uint8, int8
● block_size: scalar of type integer, ≥
2
● data_format: string, must be
NHWC (default), NCHW, or
NCHW_VECT_C
● name: (optional), string
[Constraint]
blockSize ≥ 1, and blockSize *
blockSize must be exactly divided by C.
[Output]
Tensor of the identical data type as
input
[Quantitative tool support]
No

96 tf.math.round Round [Parameter]


● x: Tensor of type float32, int64, or
int32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type and
shape as x
[Quantitative tool support]
No

97 tf.math.rint Rint [Parameter]


● x: tensor, must be one of the
following types: float32, int64,
int32, uint8, int8
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical data type and
shape as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 340


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

98 tf.math.less Less [Parameter]


● x: Tensor, must be one of the
following types: float32, int64,
int32, uint8, uint16, int8, int16
● y: tensor of the identical data type
as x
● name: (optional), string
[Constraint]
None
[Output]
Tensor of type bool
[Quantitative tool support]
No

99 tf.math.sinh Sinh [Parameter]


● x: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical output type as
x
[Quantitative tool support]
No

100 tf.math.cosh Cosh [Parameter]


● x: Tensor of type float32
● name: (optional), string
[Constraint]
None
[Output]
Tensor of the identical output type as
x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 341


Huawei HiLens
User Guide B TensorFlow Operator Boundaries

No. Python API C++ API Boundary

101 tf.math.squar Squared_diffe [Parameter]


ed_difference rence ● x: Tensor of type float32, int64, or
int32
● y: tensor of the identical data type
as x
● name: (optional), string
[Constraint]
Broadcasting is supported only in the
following scenarios:
One NCHW tensor and one tensor of
the following format: dim{} = [1,1,1,1],
[N,C,H,W], [N,1,H,W], [1,C,H,W], [N,C,
1,1], [1,C,1,1], [1,1,H,W], or [N,1,1,1]
[Output]
Tensor of the identical data type as x
[Quantitative tool support]
No

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 342


Huawei HiLens
User Guide C Change History

C Change History

Release Date Description

2019-10-10 Optimized descriptions of procedures in all sections. Major


changes include:
● Deleted the descriptions of concepts such as thin device,
standard device, standard skill, and light skill.
● Modified the descriptions of HiLens Kit access and
registration.
● Updated operations involved on Device Management,
Skill Market, Skill Development, and Products pages
based on the GUI changes.

2019-09-15 Optimized the descriptions and navigation paths in this


document based on the software GUI changes. Optimized
all sections in this document.

2019-08-02 Optimized descriptions of operations based on the software


changes.
● Creating Skills
● Sharing and Releasing Skills

2019-07-05 Edited the file based on version 1.1.0 on the cloud and
version 0.2.6 on the device.

2019-05-21 Deleted
● Deleted the method of registering a HiLens Kit camera
by scanning the QR code.

2019-05-16 Changed
● Changed the names of the service and the deep learning
camera.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 343


Huawei HiLens
User Guide C Change History

Release Date Description

2019-05-07 Added
● Added operations related to manufacturers.
● Added the description of runtime configurations during
skill creation.
Changed
● Changed the screenshots.

2019-03-04 Added
● Added precautions of handlers.

2019-01-30 This is the first official release.

Issue 01 (2021-07-14) Copyright © Huawei Technologies Co., Ltd. 344

You might also like