@@ -16,12 +16,7 @@ import { mediaReady } from "../utils/imageUtilities";
16
16
const MODEL_OPTIONS = [ "cocossd" ] ; // Expandable for other models like YOLO
17
17
18
18
class ObjectDetector {
19
- /**
20
- * @typedef {Object } options
21
- * @property {number } filterBoxesThreshold - Optional. default 0.01
22
- * @property {number } IOUThreshold - Optional. default 0.4
23
- * @property {number } classProbThreshold - Optional. default 0.4
24
- */
19
+
25
20
/**
26
21
* Create ObjectDetector model. Works on video and images.
27
22
* @param {string } modelNameOrUrl - The name or the URL of the model to use.
@@ -68,26 +63,7 @@ class ObjectDetector {
68
63
69
64
return this ;
70
65
}
71
-
72
- /**
73
- * @typedef {Object } ObjectDetectorPrediction
74
- * @property {number } x - top left x coordinate of the prediction box in pixels.
75
- * @property {number } y - top left y coordinate of the prediction box in pixels.
76
- * @property {number } width - width of the prediction box in pixels.
77
- * @property {number } height - height of the prediction box in pixels.
78
- * @property {string } label - the label given.
79
- * @property {number } confidence - the confidence score (0 to 1).
80
- * @property {ObjectDetectorPredictionNormalized } normalized - a normalized object of the predicition
81
- */
82
-
83
- /**
84
- * @typedef {Object } ObjectDetectorPredictionNormalized
85
- * @property {number } x - top left x coordinate of the prediction box (0 to 1).
86
- * @property {number } y - top left y coordinate of the prediction box (0 to 1).
87
- * @property {number } width - width of the prediction box (0 to 1).
88
- * @property {number } height - height of the prediction box (0 to 1).
89
- */
90
-
66
+
91
67
/**
92
68
* Detect objects once from the input image/video/canvas.
93
69
* @param {HTMLVideoElement|HTMLImageElement|HTMLCanvasElement|ImageData } input - Target element.
@@ -148,4 +124,4 @@ const objectDetector = (modelNameOrUrl, optionsOrCallback, cb) => {
148
124
return instance ;
149
125
} ;
150
126
151
- export default objectDetector ;
127
+ export default objectDetector ;
0 commit comments