%code
var
  AAreas: TCatalogAreas;
  AArea: TCatalogArea;
  i: Integer;
  AFaceCount, ARecognizedCount: Integer;
begin
  AAreas := TCatalogAreas.Create(TCatalogArea, '')
  try
    PublicCatalog.EnumAreasForImage(ImageItem, AAreas);

    AFaceCount := 0;
    ARecognizedCount := 0;
    for i := 0 to AAreas.Count - 1 do
    begin
      AArea := AAreas.Items[i];

      if AArea.IsFaceDetected then
        Inc(AFaceCount);

      if AArea.IsFaceRecognized then
        Inc(ARecognizedCount);
    end;

    result := IntToStrW(AAreas.Count) + ' areas; ' + IntToStrW(AFaceCount) + ' detected; ' + IntToStrW(ARecognizedCount) + ' recognized';
  finally
    AAreas.Free;
  end;
end;
%/code