TinyYolov2Options.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var TinyYolov2SizeType;
  4. (function (TinyYolov2SizeType) {
  5. TinyYolov2SizeType[TinyYolov2SizeType["XS"] = 224] = "XS";
  6. TinyYolov2SizeType[TinyYolov2SizeType["SM"] = 320] = "SM";
  7. TinyYolov2SizeType[TinyYolov2SizeType["MD"] = 416] = "MD";
  8. TinyYolov2SizeType[TinyYolov2SizeType["LG"] = 608] = "LG";
  9. })(TinyYolov2SizeType = exports.TinyYolov2SizeType || (exports.TinyYolov2SizeType = {}));
  10. var TinyYolov2Options = /** @class */ (function () {
  11. function TinyYolov2Options(_a) {
  12. var _b = _a === void 0 ? {} : _a, inputSize = _b.inputSize, scoreThreshold = _b.scoreThreshold;
  13. this._name = 'TinyYolov2Options';
  14. this._inputSize = inputSize || 416;
  15. this._scoreThreshold = scoreThreshold || 0.5;
  16. if (typeof this._inputSize !== 'number' || this._inputSize % 32 !== 0) {
  17. throw new Error(this._name + " - expected inputSize to be a number divisible by 32");
  18. }
  19. if (typeof this._scoreThreshold !== 'number' || this._scoreThreshold <= 0 || this._scoreThreshold >= 1) {
  20. throw new Error(this._name + " - expected scoreThreshold to be a number between 0 and 1");
  21. }
  22. }
  23. Object.defineProperty(TinyYolov2Options.prototype, "inputSize", {
  24. get: function () { return this._inputSize; },
  25. enumerable: true,
  26. configurable: true
  27. });
  28. Object.defineProperty(TinyYolov2Options.prototype, "scoreThreshold", {
  29. get: function () { return this._scoreThreshold; },
  30. enumerable: true,
  31. configurable: true
  32. });
  33. return TinyYolov2Options;
  34. }());
  35. exports.TinyYolov2Options = TinyYolov2Options;
  36. //# sourceMappingURL=TinyYolov2Options.js.map