takuya-takeuchi / UltraFaceDotNet

C# version of Ultra-Light-Fast-Generic-Face-Detector-1MB for Windows, MacOS, Linux, iOS and Android
MIT License
80 stars 16 forks source link

Bug in Non-Max Suppression #12

Closed ynchae closed 3 years ago

ynchae commented 3 years ago

Hi I would like to report there is some bug in NMS parts.

if we wee 267 lines in UltraFace.cs

input.Sort((f1, f2) => f1.Score.CompareTo(f2.Score));

This code is making opposite site sorting for face score. (lower face score is going first for NMS, higher score should go first)

so, we need to exchange like below: input.Sort((f1, f2) => f2.Score.CompareTo(f1.Score));

if you have a time, please review it and update it.

takuya-takeuchi commented 3 years ago

@ynchae

You are correct!!! Just in case, I checked the source code. https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/3cb8d7f9a9e418ab594b5b0bb349756a49699517/ncnn/src/UltraFace.cpp#L113

input should be sorted as descending.

takuya-takeuchi commented 3 years ago

Fix and published nuget package https://www.nuget.org/packages/UltraFaceDotNet/1.0.0.1