zhouyuchong / face-recognition-deepstream

Deepstream app use retinaface and arcface for face recognition.
MIT License
60 stars 13 forks source link

Anonymous face #2

Closed sbmalik closed 2 years ago

sbmalik commented 2 years ago

No matter which video, I run it always gives print THIS AN ANONYMOUS FACE, DISCARD is there a way to solve it?

sbmalik commented 2 years ago

@zhouyuchong obj_meta.parent always give none... Can you please guide me how to tackle this ?

zhouyuchong commented 2 years ago

@sbmalik sorry, this repo has many problems, but I'm been busy with another job and didn't fix them. For your problem, that's because nvvideoconvert will drop the obj.parent from the metadata, so you should do the job earlier by adding the probe you want to extract the obj.parent before the nvvideoconv.

I'll find some time to update this repo recently and @ you at that time.

sbmalik commented 2 years ago

@zhouyuchong Thank you for your response, I'll try your solution.

However, Looking forward for the updation of this repository.

zhouyuchong commented 2 years ago

@sbmalik Hi, I update this repo. you can check the codes now. main branch can play all format video files, and the process-mode-2-version could only play rtsp source on my pc.

the old version is using retinaface as secondary nvinfer and set its process-mode to 2, which means only detect face on the top of yolo's detections. However, for some reason, it fails on regular local video files, there is no error and no debug information which make it hard for me to find the reason.

So I have to give up on Plan A and try to connect face and body manually. The performance is not very good to be honest especially when crowded.

I'll dig into this if I have time.

sbmalik commented 2 years ago

@zhouyuchong I checked it and it's working very well. Thank you for providing the support on this repo. Moreover, I wanted to ask that I am unable to get the face-recognition (detection is working like charm). Can you share any sample video where recognition is working good?

if you want I can open another issue because the problem related to this is solved already.

zhouyuchong commented 2 years ago

@sbmalik what do you mean unable to get the face-recognition? I've tested different video types:rtsp, mp4, h264, etc. Just find one on the Internet, if there is something wrong, please let me know.

sbmalik commented 2 years ago

@zhouyuchong face-recognition means identification of person face, like facenet do. face-detection is working very well. but recognition is causing trouble, if a person appears after 5,6 frames it is not persisting the previous id.

zhouyuchong commented 2 years ago

@sbmalik Oh, that is another problem. The id is from nvtracker and in this repo I use NvDCF, you can check here for more details.

I tried IOU, NvDCF and ReID, to be honest, none of them work very good. For your instance, if a object disappears from screen and comes back after some time, you can set maxShadowTrackingAge, probationAge and earlyTerminationAge for better accuracy.

Since the nvtracker is not open-source as well, there isn't a good way to solve this temporarily. So I add ArcFace to extract the facial feature. If you are building a face-recognition app, you can try to send the results out or save them locally.

sbmalik commented 2 years ago

@zhouyuchong sure, but how to make ArcFace works (with labels of person faces)?

zhouyuchong commented 2 years ago

@sbmalik the arcface works as the tertiary gie in the pipeline, and you can find the data in here.

I didn't achieve the face comparison in the pipeline. If you want a real-time comparison, you can do it in the probe by compare the output to your own facial-feature data. Then you can add a label to the video.

sbmalik commented 2 years ago

Oh sure @zhouyuchong , thanks a lot for the guidelines. I'll try that, please let me know when you will be going to implement face comparison feature in this application.