官术网_书友最值得收藏!

Creating a group 

Before we can recognize a face, we need to teach the service who is who. To do this, we need to create a group, and create people we want to recognize within this group and for each person, upload a set of photos that can be used to train the system. It helps to have a few photos to help the model identify each person. Once all photos have been uploaded, you signal the service to train with the current dataset and only once trained can we use the service to identify the persons we have updated.

Accompanied with this chapter's source code is a Python script to take care of this task; do this now before moving on. Clone or download the source code with this book from the https://github.com/PacktPublishing/Microsoft-HoloLens-By-Example repository. Within the Chapter2/CreateGroup folder, you will find the create_group.py Python script that we can run to take care of this process. Before running this script, we need to build a dataset to upload and train; the script is expecting a folder hierarchy where all images for each person reside in a single directory, with the directory named with the label you would like associated with this person; the hierarchy should resemble the following structure:

Once created; open up the Command Prompt and navigate to the create_group.py script and run, including the parameters shown in the following example:

> create_group.py -k <subscription_key> -g <group_id> -d <source_directory> -o <output_file> [-r <region>]

If all goes well, the script will run through the process of creating a group and person for each subdirectory of the root directory provided, train the service, and export a JSON file to be used by your project. This needs to be imported into your project, talking of which, let's now move on to building the example for this project.

主站蜘蛛池模板: 尼勒克县| 得荣县| 原阳县| 乐亭县| 资中县| 西安市| 内乡县| 象州县| 遵义市| 达州市| 北流市| 绵竹市| 通江县| 剑河县| 洛隆县| 饶平县| 碌曲县| 浪卡子县| 葵青区| 东兰县| 许昌市| 盖州市| 永川市| 清水河县| 广南县| 广昌县| 乌鲁木齐县| 娄底市| 陆川县| 吉木乃县| 南京市| 桂阳县| 正蓝旗| 平和县| 海晏县| 金山区| 芦山县| 察隅县| 泽普县| 宣化县| 雅安市|