allFaces.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { __awaiter, __generator } from "tslib";
  2. import { MtcnnOptions } from '../mtcnn/MtcnnOptions';
  3. import { SsdMobilenetv1Options } from '../ssdMobilenetv1';
  4. import { TinyYolov2Options } from '../tinyYolov2';
  5. import { detectAllFaces } from './detectFaces';
  6. // export allFaces API for backward compatibility
  7. export function allFacesSsdMobilenetv1(input, minConfidence) {
  8. return __awaiter(this, void 0, void 0, function () {
  9. return __generator(this, function (_a) {
  10. switch (_a.label) {
  11. case 0:
  12. console.warn('allFacesSsdMobilenetv1 is deprecated and will be removed soon, use the high level api instead');
  13. return [4 /*yield*/, detectAllFaces(input, new SsdMobilenetv1Options(minConfidence ? { minConfidence: minConfidence } : {}))
  14. .withFaceLandmarks()
  15. .withFaceDescriptors()];
  16. case 1: return [2 /*return*/, _a.sent()];
  17. }
  18. });
  19. });
  20. }
  21. export function allFacesTinyYolov2(input, forwardParams) {
  22. if (forwardParams === void 0) { forwardParams = {}; }
  23. return __awaiter(this, void 0, void 0, function () {
  24. return __generator(this, function (_a) {
  25. switch (_a.label) {
  26. case 0:
  27. console.warn('allFacesTinyYolov2 is deprecated and will be removed soon, use the high level api instead');
  28. return [4 /*yield*/, detectAllFaces(input, new TinyYolov2Options(forwardParams))
  29. .withFaceLandmarks()
  30. .withFaceDescriptors()];
  31. case 1: return [2 /*return*/, _a.sent()];
  32. }
  33. });
  34. });
  35. }
  36. export function allFacesMtcnn(input, forwardParams) {
  37. if (forwardParams === void 0) { forwardParams = {}; }
  38. return __awaiter(this, void 0, void 0, function () {
  39. return __generator(this, function (_a) {
  40. switch (_a.label) {
  41. case 0:
  42. console.warn('allFacesMtcnn is deprecated and will be removed soon, use the high level api instead');
  43. return [4 /*yield*/, detectAllFaces(input, new MtcnnOptions(forwardParams))
  44. .withFaceLandmarks()
  45. .withFaceDescriptors()];
  46. case 1: return [2 /*return*/, _a.sent()];
  47. }
  48. });
  49. });
  50. }
  51. export var allFaces = allFacesSsdMobilenetv1;
  52. //# sourceMappingURL=allFaces.js.map