4

ほとんどの顔認識SDKでは、2つの主要な機能のみを提供します

  1. 顔を検出して写真からテンプレートを抽出することを検出と呼びます。
  2. 2 つのテンプレートを比較して同様のスコアを返すことを認識と呼びます。

しかし、これら 2 つの機能を超えて、私が探しているのは、類似した顔を持つ写真をグループ化するためのアルゴリズムまたは SDK です。たとえば、類似したスコアに基づいています。

ありがとう

4

1 に答える 1

2

まず、ステップ1を実行してテンプレートを抽出し、次にステップ2をすべての可能なペアに適用して、各テンプレートを他のすべてのテンプレートと比較し、それらの類似度スコアを取得します。

この類似度スコアに基づいて一致を並べ替え、しきい値を決定し、それを超えるテンプレートをグループ化します。

たとえば、次の場合を考えてみましょう。

10個のテンプレート: A、B、C、D、E、F、G、H、I、J。
スコア: 0〜100。
類似性のしきい値: 80。

類似性テーブル:

   A   B   C   D   E   F   G   H   I   J
A  100 85  8   0   1   50  55  88  90  10

B  85  100 5   30  99  60  15  23  8   2 

C  8   5   100 60  16  80  29  33  5   8

D  0   30  60  100 50  50  34  18  2   66

E  1   99  16  50  100 8   3   2   19  6

F  50  60  80  50  8   100 20  55  13  90

G  55  15  29  34  3   20  100 51  57  16

H  88  23  33  18  2   55  51  100 8   0

I  90  8   5   2   19  13  57  8   100 3

J  10  2   8   66  6   90  16  0   3   100

ソートされた一致リスト:

AI 90
FJ 90
BE 99
AH 88
AB 85
CF 80
-------<-しきい値カットオフライン
DJ66
......。

値がそれを超えなくなるしきい値カットオフポイントまでリストを繰り返し、完全なテンプレートセットと各テンプレートの関連付けセットを維持し、最終的なグループを取得します。

// Empty initial full templates set
fullSet = {};

// Iterate through the pairs list
foreach (templatePair : pairList)
{
  // If the full set contains the first template from the pair
  if (fullSet.contains(templatePair.first))
  {
     // Add the second template to its group
     templatePair.first.addTemplateToGroup(templatePair.second);

     // If the full set also contains the second template
     if (fullSet.contains(templatePair.second))
     {
        // The second template is removed from the full set
        fullSet.remove(templatePair.second);

        // The second template's group is added to the first template's group
        templatePair.first.addGroupToGroup(templatePair.second.group);
     }
  }
  else
  {
    // If the full set contains only the second template from the pair
    if (fullSet.contains(templatePair.second))
    {
      // Add the first template to its group
      templatePair.second.addTemplateToGroup(templatePair.first);
    }
  }
  else
  {
     // If none of the templates are present in the full set, add the first one
     // to the full set and the second one to the first one's group
     fullSet.add(templatePair.first);
     templatePair.first.addTemplateToGroup(templatePair.second);
  } 
}

リストの実行の詳細:

AI: fullSet.add(A); A.addTemplateToGroup(I);
FJ: fullSet.add(F); F.addTemplateToGroup(J);
BE: fullSet.add(B); B.addTemplateToGroup(E);
AH: A.addTemplateToGroup(H);
AB: A.addTemplateToGroup(B); fullSet.remove(B); A.addGroupToGroup(B.group);
CF: C.addTemplateToGroup(F);

最終的に、次の類似性グループになります。

A - I, H, B, E
C - F, J
于 2011-08-29T07:53:53.763 に答える