allFaces.js 2.7 KB

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