GithubHelp home page GithubHelp logo

daybreak-u / yolo-face-with-landmark Goto Github PK

View Code? Open in Web Editor NEW
298.0 15.0 69.0 81.39 MB

yoloface大礼包 使用pytroch实现的基于yolov3的轻量级人脸检测(包含关键点)

Python 45.52% CMake 2.09% C++ 52.39%
torch face-detection light ncnn

yolo-face-with-landmark's Introduction

yolo-face-with-landmark

实现的功能

  • 添加关键点检测分支,使用wing loss

Installation

Clone and install
  1. git clone https://github.com/ouyanghuiyu/yolo-face-with-landmark
  2. 使用src/retinaface2yololandmark.py脚本将retinaface的标记文件转为yolo的格式使用,
  3. 使用src/create_train.py 创建训练样本

训练

python train.py --net mbv3_large_75 --backbone_weights \
./pretrained/mobilenetv3-large-0.75-9632d2a8.pth --batch-size 16 

测试

python evaluation_on_widerface.py
cd widerface_evaluate
python evaluation.py

demo

python demo.py

精度

Widerface测试

  • 在wider face val精度(单尺度输入分辨率:320*240
方法 Easy Medium Hard Flops
Retinaface-Mobilenet-0.25(Mxnet) 0.745 0.553 0.232
mbv3large_1.0_yolov3(our) 0.861 0.781 0.387 405M
mbv3large_1.0_yolov3_light(our) 0.856 0.770 0.370 311M
mbv3large_0.75_yolov3(our) 0.853 0.778 0.382 334M
mbv3large_0.75_yolov3_light(our) 0.845 0.766 0.365 240M
mbv3samll_1.0_yolov3(our) 0.798 0.696 0.3 185M
mbv3small_1.0_yolov3_light(our) 0.759 0.662 0.300 91M
mbv3samll_0.75_yolov3(our) 0.768 0.673 0.305 174M
mbv3small_0.75_yolov3_light(our) 0.754 0.647 0.291 80M
  • 在wider face val精度(单尺度输入分辨率:640*480
方法 Easy Medium Hard
Retinaface-Mobilenet-0.25(mxnet) 0.879 0.807 0.481
mbv3large_1.0_yolov3(our) 0.900 0.882 0.707
mbv3large_1.0_yolov3_light(our) 0.900 0.874 0.683
mbv3large_0.75_yolov3(our) 0.886 0.871 0.694
mbv3large_0.75_yolov3_light(our) 0.881 0.862 0.678
mbv3samll_1.0_yolov3(our) 0.856 0.827 0.602
mbv3small_1.0_yolov3_light(our) 0.847 0.807 0.578
mbv3samll_0.75_yolov3(our) 0.841 0.815 0.584
mbv3small_0.75_yolov3_light(our) 0.832 0.796 0.553

ps: 测试的时候,长边为320 或者 640 ,图像等比例缩放

测试

References

yolo-face-with-landmark's People

Contributors

daybreak-u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolo-face-with-landmark's Issues

Train a model with 64 or 98 key points

Thank you very much for your innovative work, if I want to train a model with 64 or 98 key points. What other modifications are needed besides modifying point_num. Please provide help, thanks!

How to train my own dataset?

Hi!It is my honor to see your codes,I want to know how to train my own fish datasets instead of people datasets.Which codes should I change?I would appreciate it if you could tell me!Thanks!

标签文件示例

你好,可不可以给一下标签文件 的示例呢?非常感谢

torch模型转caffe

十分感谢大佬的代码,请问下,这个有尝试过pytorch的模型转成caffemodel么,好不好操作,损失大么?

ncnn inference why low accuracy?

Hi,

I am trying to evaluate all models in ncnn. But even with ncnn converted model mbv3_small_1.bin/param the detection accuracy is much lower. I would like to know did you verified from your end that ncnn inference also gives the same result as this pytorch inference. If required I can provide detection results with eval numbers. Just for reference I have attached below ncnn detection result as well as python pytorch detection result in a sample image with same input size.

pytorch inference:

  • detected faces: 864
    sample

ncnn infernence:

  • detected faces: 534
    test

复现train.py的一个报错。

`
Saving labels to /home/ps/superb/yolo-face-with-landmark/datas/yololandmark_wider_train.npy for faster future loading
Image sizes 320 - 640 train, 640 test
Using 8 dataloader workers
Starting training for 250 epochs...

 Epoch   gpu_mem      GIoU       obj       cls      land     total   targets  img_size        lr

0%| | 0/805 [00:00<?, ?it/s]Traceback (most recent call last):
File "train.py", line 365, in
train(hyp) # train normally
File "train.py", line 265, in train
loss, loss_items = compute_loss(pred, targets, model,point_number=hyp['point_num'])
File "/home/ps/zhouyizhi/yolo-face-with-landmark/utils/utils.py", line 238, in compute_loss
tcls, tbox, tpoint ,indices, anchors = build_targets(p, targets, model,point_number=point_number) # targets
File "/home/ps/zhouyizhi/yolo-face-with-landmark/utils/utils.py", line 342, in build_targets
no_train_index = torch.where(targets == -1 )
TypeError: where() missing 2 required positional argument: "input", "other"
`
请问下作者,这个错误该如何解决。

pytorch 和torchvision 版本

你好,pytorch 和torchvision 版本是多少呢,我训练报下面的错
TypeError: _resolve_type_from_object(): incompatible function arguments. The following argument types are supported:
1. (arg0: object, arg1: torch._C._jit_tree_views.SourceRange, arg2: Callable[[str], function]) -> torch._C.Type

Invoked with: typing.Union[int, NoneType], None, <function try_ann_to_type..fake_rcb at 0x7f52e2a0de18>
谷歌搜了一下说是版本问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.