TinyYolov2Options.js 1.6 KB

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