Skip to content

Commit b25cd89

Browse files
authored
Remove useless comments and clean up ObjectDetector documentation
Removed unused typedefs for options and predictions.
1 parent ebda162 commit b25cd89

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

src/ObjectDetector/index.js

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ import { mediaReady } from "../utils/imageUtilities";
1616
const MODEL_OPTIONS = ["cocossd"]; // Expandable for other models like YOLO
1717

1818
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+
2520
/**
2621
* Create ObjectDetector model. Works on video and images.
2722
* @param {string} modelNameOrUrl - The name or the URL of the model to use.
@@ -68,26 +63,7 @@ class ObjectDetector {
6863

6964
return this;
7065
}
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+
9167
/**
9268
* Detect objects once from the input image/video/canvas.
9369
* @param {HTMLVideoElement|HTMLImageElement|HTMLCanvasElement|ImageData} input - Target element.
@@ -148,4 +124,4 @@ const objectDetector = (modelNameOrUrl, optionsOrCallback, cb) => {
148124
return instance;
149125
};
150126

151-
export default objectDetector;
127+
export default objectDetector;

0 commit comments

Comments
 (0)