Code Monkey home page Code Monkey logo

Comments (9)

woctezuma avatar woctezuma commented on May 23, 2024 2

How does this have anything to do with this repo?

It is additional information for users like myself who:

  • have used this repository in the past,
  • would like to have validation accuracy for the model checkpoints which they use.

FaceXLib is an alternative which:

  • did not exist when this repository was created,
  • is installable with pip and just as easy to use as this repository,
  • relies on the original weights, for which accuracy is documented.

from retinaface.

ternaus avatar ternaus commented on May 23, 2024 1

I did not.

It is not that hard to add the whole set of backbones from https://github.com/rwightman/pytorch-image-models/blob/master/results/results-imagenet.csv but I do not really need it right now, hence I cannot tell when this functionality will be added.

from retinaface.

tloki avatar tloki commented on May 23, 2024 1

I doubt it is the same since @ternaus did train his own model.

A validation accuracy (and other numbers) would be nice just to compare to the baseline retinaface.

from retinaface.

tloki avatar tloki commented on May 23, 2024 1

The reason I was actually interested in this repo was - NMS. biubug6 uses its own implementation, which is slow (it could somewhat easily be parallelized), and this one uses off-the shelf NMS which seems like a less of bottleneck. I'm mainly refereing to for loop which does NMS for every element in batch.

from retinaface.

JohannesTK avatar JohannesTK commented on May 23, 2024

Thanks for a quick response and well understood regards mobilenet.

Regards the Resnet50 val accuracy, is it the same as reported in https://github.com/biubug6/Pytorch_Retinaface#widerface-val-performance-in-single-scale-when-using-resnet50-as-backbone-net or do you have some numbers for that?

from retinaface.

woctezuma avatar woctezuma commented on May 23, 2024

For information, there is also another project called FaceXLib with RetinaFace for detection.

FaceXlib

The Python package is available on PyPI:

pip install facexlib

As shown in the following code:

https://github.com/xinntao/facexlib/blob/45fee8e7885fc462d2d4c4eafb2650ff384b89c8/facexlib/detection/__init__.py#L8-L16

The model checkpoints are downloaded from here:

FaceXLib weights

https://github.com/xinntao/facexlib/releases/tag/v0.1.0

They use the same name convention as the original model checkpoints, so I wonder if these are direct copies without re-training.
Edit: See my following post, the answer is yes.

https://github.com/biubug6/Pytorch_Retinaface#training

Original weights

from retinaface.

woctezuma avatar woctezuma commented on May 23, 2024

I have run the following code on a Google Colab machine:

!wget https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_mobilenet0.25_Final.pth
!wget https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth

!gdown --id 15zP8BP-5IvWXWZoYTNdvUJUiBqZ1hxu1
!gdown --id 14KX6VqF69MdSPk3Tr9PlDYbq7ArpdNUW
!sha256sum *.pth

This is the output:

2979b33ffafda5d74b6948cd7a5b9a7a62f62b949cef24e95fd15d2883a65220  detection_mobilenet0.25_Final.pth
6d1de9c2944f2ccddca5f5e010ea5ae64a39845a86311af6fdf30841b0a5a16d  detection_Resnet50_Final.pth
2979b33ffafda5d74b6948cd7a5b9a7a62f62b949cef24e95fd15d2883a65220  mobilenet0.25_Final.pth
6d1de9c2944f2ccddca5f5e010ea5ae64a39845a86311af6fdf30841b0a5a16d  Resnet50_Final.pth

So the model checkpoints should be the same.

--

If you don't have access to sha256sum on your system (maybe Windows), you can do it in Python:

# Reference: https://stackoverflow.com/a/44873382/376454

import hashlib

def sha256sum(filename):
    h  = hashlib.sha256()
    b  = bytearray(128*1024)
    mv = memoryview(b)
    with open(filename, 'rb', buffering=0) as f:
        for n in iter(lambda : f.readinto(mv), 0):
            h.update(mv[:n])
    return h.hexdigest()
import glob

for fname in glob.glob('*.pth'):
  print(f'{sha256sum(fname)} {fname}')

This is the output (same as above):

2979b33ffafda5d74b6948cd7a5b9a7a62f62b949cef24e95fd15d2883a65220 mobilenet0.25_Final.pth
6d1de9c2944f2ccddca5f5e010ea5ae64a39845a86311af6fdf30841b0a5a16d detection_Resnet50_Final.pth
2979b33ffafda5d74b6948cd7a5b9a7a62f62b949cef24e95fd15d2883a65220 detection_mobilenet0.25_Final.pth
6d1de9c2944f2ccddca5f5e010ea5ae64a39845a86311af6fdf30841b0a5a16d Resnet50_Final.pth

from retinaface.

tloki avatar tloki commented on May 23, 2024

How does this have anything to do with this repo? If I understood you right - your claim is that FaceXLib uses same weights as biubug6 (original retinaface repo?). On FaceXLib it is even stated (README) that they do use biubug6 model/code...

from retinaface.

woctezuma avatar woctezuma commented on May 23, 2024

I see. It looks like this repository relies on:

wile FaceXLib relies on:

I'm mainly referring to for loop which does NMS for every element in batch.

Maybe I misunderstood and you are referring to another part of the code than the one which I mentioned.

from retinaface.

Related Issues (19)

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.