2758 views|2 replies

75

Posts

1

Resources
The OP
 

Face recognition model building process [Copy link]

 This post was last edited by swzswz on 2022-10-21 19:08

Face recognition model

Face recognition model steps

Face recognition is mainly divided into two models:

  • Detection network model

  • Classification Network Model

Model building process

[attach ]650136[/attach]

Video Recording Conversion

Modify the corresponding parameters according to the store_sample routine in the HiSilicon development document . Record the video or use a mobile phone to record the video.

After compiling, use NFS to copy the video on the board to the local computer.

Build the FFmpeg environment and crop the video into pictures.

Dataset creation and annotation

Use labelme tool to label the dataset.

Model Training

We use HiSilicon servers to perform cloud model training using CUDA.

Model Conversion

Generally, pytorch-caffe is used for conversion.

Model Quantization

Convert the caffe model into a wk model for board-side reasoning.

Model deployment and debugging

Video Demonstration

1

Code and other files

static HI_S32 CnnTrashClassifyFlag(const RecogNumInfo items[], HI_S32 itemNum, HI_CHAR* buf, HI_S32 size)
{
   HI_S32 offset = 0;
   HI_CHAR *trashName = NULL;

   offset += snprintf_s(buf + offset, size - offset, size - offset - 1, "face_classify: {");
   for (HI_U32 i = 0; i < itemNum; i++) {
     const RecogNumInfo *item = &items ;
     uint32_t score = item->score * HI_PER_BASE / SCORE_MAX;
     if (score < THRESH_MIN) {
       break;
     }
     SAMPLE_PRT("----trash item flag----num:%d, score:%d\n", item->num, score);
     switch (item->num) {
       case 0u:
         trashName = "face";
         UartSendRead(uartFd1,face);
         SAMPLE_PRT("----trash name----:%s\n", trashName);
         break;
       case 1u:
         trashName = "background";
         UartSendRead(uartFd1,background);
         SAMPLE_PRT("----trash name----:%s\n", trashName);
         break;
       default:
         trashName = "unknown";
         UartSendRead(uartFd1,unknown);
         SAMPLE_PRT("----trash name----:%s\n", trashName);
         break;
     }
     offset += snprintf_s(buf + offset, size - offset, size - offset - 1,
       "%s%s %u:%u%%", (i == 0 ? " " : ", "), trashName, (int)item->num, (int)score);
     HI_ASSERT(offset < size);
   }
   offset += snprintf_s(buf + offset, size - offset, size - offset - 1, " }");
   HI_ASSERT(offset < size);
   return HI_SUCCESS;
}

code.zip

15.02 KB, downloads: 0

ip_camera.py

892 Bytes, downloads: 0

txt.py

212 Bytes, downloads: 0

face_classcify_inst.wk

11.04 MB, downloads: 0

2022年嵌入式大赛海思赛道开发指导.pdf

44.86 MB, downloads: 0

ohos_camera_ai_demo

122.23 KB, downloads: 0

ohos_store_demo

40.77 KB, downloads: 0

ohos_vio_demo

70.55 KB, downloads: 0

sample_ai.conf

303 Bytes, downloads: 0

This post is from DigiKey Technology Zone

Latest reply

Looks very classy, thanks for sharing!   Details Published on 2022-10-21 22:26
 
 

6818

Posts

11

Resources
2
 

Looks very classy, thanks for sharing!

This post is from DigiKey Technology Zone

Comments

I used the HiSilicon development kit and it worked pretty well!  Details Published on 2022-11-10 16:45
 
 
 

75

Posts

1

Resources
3
 
lugl4313820 posted on 2022-10-21 22:26 It looks very high-end, thanks for sharing!

I used the HiSilicon development kit and it worked pretty well!

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list