Git Product home page Git Product logo

samyuen101234 / masked_face_recognition Goto Github PK

View Code? Open in Web Editor NEW
119.0 119.0 32.0 2.25 MB

2020/2021 HKUST CSE FYP Masked Facial Recognition, developer: Sam Yuen, Alex Xie, Tony Cheng

Home Page: https://github.com/SamYuen101234/maskedfacerecognition

License: MIT License

Python 100.00%
arcface artificial-intelligence cnn computer-vision efficientnet face-alignment facial-recognition hkust inceptionresnet machine-learning masked-face-recognition mtcnn online-triplet-mining pytorch se-resnext transfer-learining triplet-loss triplet-mining-sampler

masked_face_recognition's Introduction

Hi there 👋 I am Sam Yuen, a Machine Learning Engineer.

SamYuen's GitHub stats

Top Langs

masked_face_recognition's People

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

masked_face_recognition's Issues

Purple masks

I noticed that some of the images in your Casia dataset have purple surgical mask in it. Can you tell me what's the hex color for that?

Can't load pretrained model

I'm trying to load the .pt model you provided, but I can't seem to make it work
Code:

model = InceptionResnetV1(pretrained='vggface2')
checkpoint = torch.load("/content/drive/MyDrive/export/InceptionResNetV1_ArcFace.pt")
model.load_state_dict(checkpoint)
model = model.cuda()

Output:

`ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-6-9840bef75f84>](https://localhost:8080/#) in <module>()
      1 model = InceptionResnetV1(pretrained='vggface2')
----> 2 checkpoint= torch.load("/content/drive/MyDrive/export/InceptionResNetV1_ArcFace.pt")
      3 model.load_state_dict(checkpoint)
      4 model = model.cuda()

2 frames
[/usr/local/lib/python3.7/dist-packages/torch/serialization.py](https://localhost:8080/#) in find_class(self, mod_name, name)
    873         def find_class(self, mod_name, name):
    874             mod_name = load_module_mapping.get(mod_name, mod_name)
--> 875             return super().find_class(mod_name, name)
    876 
    877     # Load the data (which may in turn use `persistent_load` to load tensors)

ModuleNotFoundError: No module named 'model'`

Can you please tell me what did I do wrong and how to fix it? I'm a beginner so I don't really know what to do here.

Qs

Hi there, deos the tesetset include masked faces?

Requesting project

Hi Sam Yuan,

This is Yuvaraj Singh from India, Studying engineering.

I came across your project “Access Control System with Masked Face Recognition”

I could only get your version and got Test and model results.

Was hoping if you could share the whole project with me was very interested in knowing this project.

In my version of project the accuracy is low and am unable to satisfy the spoofing version of it.

It would be of great help if you could help me out with it As soon as possible.

Thankyou,

Yuvaraj Singh

Mail- [email protected]

When does "collapse" happens?

Hello!
I ran this code, but I had met "collapse" when 1epoch was over. (I edited code...)
When does "collapse" happens? and How can I solve this problem?

eval graph

Hello,I could not understand the meaning of the eval graph,could you please explain about it such as the meaning of horizontal coordinate and vertical coordinate?

How to load previous trained model and finetune?

Hi dear,
I have downloaded the Model1 and tended to finetune it. But it raise error that

Traceback (most recent call last):
File "main2.py", line 81, in
facenet, optimizer, scheduler = load(name)
File "/root/maskedface/Masked_Face_Recognition/train.py", line 26, in load
model = checkpoint['model']
TypeError: 'FaceNet2' object is not subscriptable

so how to load your trained model1?
And where is the code of finetune?

Gettting eror while running main_test.py. #4

We are trying to recreate your execellent work.

We are using facenet = torch.load('../Model/InceptionResNetV1_ArcFace.pt') from the shared gDrive
we are getting error in the line distance = torch.norm(eval_out - eval_pait_out, dim=1)
can you please help in getting over this issue ?


(model-training) C:\Users\ranji\AML-ReferenceCode\Masked_Face_Recognition\Code>python ./main_test.py
Device: cpu
0%| | 0/456 [00:22<?, ?it/s]
Traceback (most recent call last):
File "C:\Users\ranji\AML-ReferenceCode\Masked_Face_Recognition\Code\main_test.py", line 72, in
dist_threshold = evalulate(facenet, eval_loader1, eval_loader2, device)
File "C:\Users\ranji\AML-ReferenceCode\Masked_Face_Recognition\Code\test.py", line 56, in evalulate
dist1 = result(model,eval_loader1, device)
File "C:\Users\ranji\AML-ReferenceCode\Masked_Face_Recognition\Code\test.py", line 42, in result
distance = torch.norm(eval_out - eval_pait_out, dim=1)
TypeError: unsupported operand type(s) for -: 'dict' and 'dict'

Test real faces dataset

In this real faces dataset, there are 75 real people, and each class has three non masked and masked images. Can you test this data set in your code, and how to operate it

How to use?

Greetings! Thank you for this useful contribution.
How can I try this out? I.e. you provided 3 models, is there a script for the inference? You also provide a link to some gh repo where you used it, but the link is broken. Or maybe you could give me a hint so I can get it running. Since we are talking about face recognition, I assume that somewhere gotta be a part where I build a face embedding and use some distance metric. Is that correct?

How to use the real face dataset to test the train model?

I found that the images in the train, eval, test set have the size of 128x128. However, the images in the real masked face dataset have diverse sizes. How to use the real masked face dataset to test the model trained with images of size 128x128?

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.