Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
610265158 committed May 4, 2023
1 parent 0a5b71d commit e428909
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
37 changes: 6 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

It is a simple demo including face detection and face aligment, and some optimizations were made to make the result better.





click the gif to see the video:
[![demo](https://github.com/610265158/simpleface-engine/blob/master/figure/sample.gif)](https://v.youku.com/v_show/id_XNDM3MTY4MTM2MA==.html?spm=a2h3j.8428770.3416059.1)

Expand All @@ -21,7 +17,6 @@ and with face mask:
+ PyTorch
+ onnxruntime
+ opencv
+ python 3.7
+ easydict

## model
Expand All @@ -36,33 +31,13 @@ and with face mask:

Refer to [TRAIN/face_landmark/README.md](https://github.com/610265158/Peppa_Pig_Face_Landmark/blob/master/TRAIN/face_landmark/README.md) to train the model.

the model is trained with WFLW data. For student **mobilenetv3-large** was used as backbone, for teacher is **efficientnetb5**.

| model | Resolution | NME(test set) | model size (int8 weights) | Pretrained |
| ------- | ---------- | ------------- | ------------------------- | ------------------------------------------------------------ |
| Student | 128x128 | 4.95 | 1.9M | [model128](https://drive.google.com/drive/folders/1zivD151CkOSm8KYyeC7v4YPC0aYDomry?usp=share_link) |
| Teacher | 128x128 | 4.64 | 6.9M | [model128](https://drive.google.com/drive/folders/1zivD151CkOSm8KYyeC7v4YPC0aYDomry?usp=share_link) |
| Student | 256x256 | 4.65 | 1.9M | [model256](https://drive.google.com/drive/folders/1JFVrbMx07PwL47dFlUSZ1tAMcVxVmJXo?usp=share_link) |
| Teacher | 256x256 | 4.47 | 6.9M | [model256](https://drive.google.com/drive/folders/1JFVrbMx07PwL47dFlUSZ1tAMcVxVmJXo?usp=share_link) |


**UPDATE Better model**

| model | Resolution | NME(test set) | Params | Flops | Pretrained |
| ------- |------------|---------------|--------|-------|-------------------------------------------------------------------------------------------------------|
| Student | 128x128 | | 2.07M | 0.63G | |
| Teacher | 128x128 | | 27.42M | 1.30G | |
| Student | 256x256 | 4.60 | 2.07M | 2.49G | [model256_update](https://drive.google.com/file/d/1bLE6RhQu-SVmQR2MWIt6s2vyUbnTjA83/view?usp=sharing) |
| Teacher | 256x256 | 4.24 | 27.42M | 5.18G | [model256_update](https://drive.google.com/file/d/1bLE6RhQu-SVmQR2MWIt6s2vyUbnTjA83/view?usp=sharing) |


| WLFW | inputsize | Fullset | Pose | Exp. | Ill. | Mu. | Occ. | Blur |
|---------|-----------|--------|------|------|------|------|------|------|
| Student | 128x128 | | | | | | | |
| Teacher | 128x128 | | | | | | | |
| Student | 256x256 | 4.60 | 7.84 | 4.71 | 4.40 | 4.49 | 5.90 | 5.31 |
| Teacher | 256x256 | 4.24 | 7.06 | 4.27 | 4.10 | 4.03 | 5.28 | 4.90 |

| WLFW | inputsize | NME | Params(M) | Flops(G) | Pose | Exp. | Ill. | Mu. | Occ. | Blur | pretrained |
|---------|-----------|---------|----------|---------|------|------|------|------|------|------|----------------------------------------------------------------------------------------------|
| Student | 128x128 | | | | | | | | | | |
| Teacher | 128x128 | | | | | | | | | | |
| Student | 256x256 | 4.35 | 1.39 | 3.25 | 7.53 | 4.52 | 4.16 | 4.21 | 5.34 | 4.93 | [skps](https://drive.google.com/drive/folders/1Y8FvJV1X5YTUkwt5MywVFvqzStpxRK_S?usp=sharing) |
| Teacher | 256x256 | 3.95 | 5.53 | 11.53 | 7.00 | 4.00 | 3.81 | 3.78 | 4.85 | 4.54 | [skps](https://drive.google.com/drive/folders/1Y8FvJV1X5YTUkwt5MywVFvqzStpxRK_S?usp=sharing) |


I will release new model when there is better one. 7.5K trainning data is not enough for a very good model. Please label more data if needed.
Expand Down
2 changes: 1 addition & 1 deletion lib/core/api/face_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __call__(self, image,
# Inference
t0=time.time()
output = self.model(img_for_net)
print(time.time()-t0)

output = np.reshape(output, ( 15120, 16))

output[:,:4] = self.xywh2xyxy(output[:, :4])
Expand Down

0 comments on commit e428909

Please sign in to comment.