elliottzheng / face-detection

Fast and reliable face detection with RetinaFace.PyTorch
MIT License
114 stars 24 forks source link

About Resnet50 #6

Closed wtw11mdg closed 1 year ago

wtw11mdg commented 1 year ago

Hi!
According to the changelog, I found that this code had a Resnet version before. Is it still available? Thanks!

elliottzheng commented 1 year ago

yes, you can simply pass network = "resnet50" to RetinaFace, to use it, and you can find the weights here https://github.com/elliottzheng/face-detection/releases/download/0.0.1/Resnet50_Final.pth

wtw11mdg commented 1 year ago

Thanks for the reply and help!

But to clarify, Besides passing the 'network' to the class RetinaFace, Should I also pass the parameter 'model_path(location of 'Resnet50_Final.pth')' to RetinaFace? Thanks!

elliottzheng commented 1 year ago

No need, the weight will be automatically downloaded.

--------------原始邮件-------------- 发件人:"wtw11mdg @.>; 发送时间:2023年3月14日(星期二) 晚上7:42 收件人:"elliottzheng/face-detection" @.>; 抄送:"Elliott Zheng @.>;"Comment @.>; 主题:Re: [elliottzheng/face-detection] About Resnet50 (Issue #6)

Thanks for the reply and help!

But to clarify, Besides passing the 'network' to the class RetinaFace, Should I also pass the parameter 'model_path(location of 'Resnet50_Final.pth')' to RetinaFace? Thanks!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

wtw11mdg commented 1 year ago

Great! Thanks for your quick response. It helps me a lot : )

wtw11mdg commented 1 year ago

No need, the weight will be automatically downloaded.

Hi! Because I found the following line(line 462) of code in the file alignment.py: net = load_model(net, model_path, True)

To make sure it has introduced the Resnet pretrained weight correctly, I blocked 'mobilenet0.25_Final.pth' in 'weight' folder and then ran the following code: detector = RetinaFace(network="resnet50")

But it returned the following error: FileNotFoundError: [Errno 2] No such file or directory: '.../lib/python3.9/site-packages/face_detection/weights/mobilenet0.25_Final.pth

According to this result, does it mean the model still needs to be passed into the 'model_path' parameter, as I mentioned above, to work correctly?

elliottzheng commented 1 year ago

There seems to be a bug using resnet 50 in this repo, my more updated repo https://github.com/elliottzheng/batch-face has it fixed, and it can be used in the same way as in this repo. I am too busy to fix the bug now, you may want to check the updated repo.

wtw11mdg commented 1 year ago

Thanks for the information! I will check it~