@camstack/addon-vision 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/addons/animal-classifier/index.d.mts +30 -0
  2. package/dist/addons/animal-classifier/index.d.ts +30 -0
  3. package/dist/addons/animal-classifier/index.js +822 -999
  4. package/dist/addons/animal-classifier/index.js.map +1 -1
  5. package/dist/addons/animal-classifier/index.mjs +7 -242
  6. package/dist/addons/animal-classifier/index.mjs.map +1 -1
  7. package/dist/addons/audio-classification/index.d.mts +36 -0
  8. package/dist/addons/audio-classification/index.d.ts +36 -0
  9. package/dist/addons/audio-classification/index.js +378 -501
  10. package/dist/addons/audio-classification/index.js.map +1 -1
  11. package/dist/addons/audio-classification/index.mjs +4 -224
  12. package/dist/addons/audio-classification/index.mjs.map +1 -1
  13. package/dist/addons/bird-global-classifier/index.d.mts +31 -0
  14. package/dist/addons/bird-global-classifier/index.d.ts +31 -0
  15. package/dist/addons/bird-global-classifier/index.js +825 -1002
  16. package/dist/addons/bird-global-classifier/index.js.map +1 -1
  17. package/dist/addons/bird-global-classifier/index.mjs +7 -248
  18. package/dist/addons/bird-global-classifier/index.mjs.map +1 -1
  19. package/dist/addons/bird-nabirds-classifier/index.d.mts +33 -0
  20. package/dist/addons/bird-nabirds-classifier/index.d.ts +33 -0
  21. package/dist/addons/bird-nabirds-classifier/index.js +825 -1002
  22. package/dist/addons/bird-nabirds-classifier/index.js.map +1 -1
  23. package/dist/addons/bird-nabirds-classifier/index.mjs +7 -289
  24. package/dist/addons/bird-nabirds-classifier/index.mjs.map +1 -1
  25. package/dist/addons/face-detection/index.d.mts +29 -0
  26. package/dist/addons/face-detection/index.d.ts +29 -0
  27. package/dist/addons/face-detection/index.js +934 -1196
  28. package/dist/addons/face-detection/index.js.map +1 -1
  29. package/dist/addons/face-detection/index.mjs +7 -227
  30. package/dist/addons/face-detection/index.mjs.map +1 -1
  31. package/dist/addons/face-recognition/index.d.mts +29 -0
  32. package/dist/addons/face-recognition/index.d.ts +29 -0
  33. package/dist/addons/face-recognition/index.js +807 -1003
  34. package/dist/addons/face-recognition/index.js.map +1 -1
  35. package/dist/addons/face-recognition/index.mjs +6 -197
  36. package/dist/addons/face-recognition/index.mjs.map +1 -1
  37. package/dist/addons/motion-detection/index.d.mts +28 -0
  38. package/dist/addons/motion-detection/index.d.ts +28 -0
  39. package/dist/addons/motion-detection/index.js +111 -214
  40. package/dist/addons/motion-detection/index.js.map +1 -1
  41. package/dist/addons/motion-detection/index.mjs +9 -12
  42. package/dist/addons/motion-detection/index.mjs.map +1 -1
  43. package/dist/addons/object-detection/index.d.mts +31 -0
  44. package/dist/addons/object-detection/index.d.ts +31 -0
  45. package/dist/addons/object-detection/index.js +1082 -1287
  46. package/dist/addons/object-detection/index.js.map +1 -1
  47. package/dist/addons/object-detection/index.mjs +7 -373
  48. package/dist/addons/object-detection/index.mjs.map +1 -1
  49. package/dist/addons/plate-detection/index.d.mts +30 -0
  50. package/dist/addons/plate-detection/index.d.ts +30 -0
  51. package/dist/addons/plate-detection/index.js +868 -1075
  52. package/dist/addons/plate-detection/index.js.map +1 -1
  53. package/dist/addons/plate-detection/index.mjs +7 -230
  54. package/dist/addons/plate-detection/index.mjs.map +1 -1
  55. package/dist/addons/plate-recognition/index.d.mts +31 -0
  56. package/dist/addons/plate-recognition/index.d.ts +31 -0
  57. package/dist/addons/plate-recognition/index.js +505 -684
  58. package/dist/addons/plate-recognition/index.js.map +1 -1
  59. package/dist/addons/plate-recognition/index.mjs +5 -244
  60. package/dist/addons/plate-recognition/index.mjs.map +1 -1
  61. package/dist/addons/segmentation-refiner/index.d.mts +30 -0
  62. package/dist/addons/segmentation-refiner/index.d.ts +30 -0
  63. package/dist/addons/segmentation-refiner/index.js +790 -967
  64. package/dist/addons/segmentation-refiner/index.js.map +1 -1
  65. package/dist/addons/segmentation-refiner/index.mjs +17 -21
  66. package/dist/addons/segmentation-refiner/index.mjs.map +1 -1
  67. package/dist/addons/vehicle-classifier/index.d.mts +31 -0
  68. package/dist/addons/vehicle-classifier/index.d.ts +31 -0
  69. package/dist/addons/vehicle-classifier/index.js +410 -581
  70. package/dist/addons/vehicle-classifier/index.js.map +1 -1
  71. package/dist/addons/vehicle-classifier/index.mjs +16 -20
  72. package/dist/addons/vehicle-classifier/index.mjs.map +1 -1
  73. package/dist/chunk-22BHCDT5.mjs +101 -0
  74. package/dist/{chunk-WG66JYYW.mjs.map → chunk-22BHCDT5.mjs.map} +1 -1
  75. package/dist/chunk-2IOKI4ES.mjs +335 -0
  76. package/dist/{chunk-PIFS7AIT.mjs.map → chunk-2IOKI4ES.mjs.map} +1 -1
  77. package/dist/chunk-7DYHXUPZ.mjs +36 -0
  78. package/dist/{chunk-BS4DKYGN.mjs.map → chunk-7DYHXUPZ.mjs.map} +1 -1
  79. package/dist/chunk-BJTO5JO5.mjs +11 -0
  80. package/dist/chunk-BP7H4NFS.mjs +412 -0
  81. package/dist/{chunk-MGT6RUVX.mjs.map → chunk-BP7H4NFS.mjs.map} +1 -1
  82. package/dist/chunk-BR2FPGOX.mjs +98 -0
  83. package/dist/{chunk-YYDM6V2F.mjs.map → chunk-BR2FPGOX.mjs.map} +1 -1
  84. package/dist/chunk-D6WEHN33.mjs +276 -0
  85. package/dist/chunk-D6WEHN33.mjs.map +1 -0
  86. package/dist/chunk-DRYFGARD.mjs +289 -0
  87. package/dist/chunk-DRYFGARD.mjs.map +1 -0
  88. package/dist/chunk-DUN6XU3N.mjs +72 -0
  89. package/dist/{chunk-XD7WGXHZ.mjs.map → chunk-DUN6XU3N.mjs.map} +1 -1
  90. package/dist/chunk-ESLHNWWE.mjs +387 -0
  91. package/dist/chunk-ESLHNWWE.mjs.map +1 -0
  92. package/dist/chunk-JUQEW6ON.mjs +256 -0
  93. package/dist/chunk-JUQEW6ON.mjs.map +1 -0
  94. package/dist/chunk-KUO2BVFY.mjs +90 -0
  95. package/dist/{chunk-DE7I3VHO.mjs.map → chunk-KUO2BVFY.mjs.map} +1 -1
  96. package/dist/chunk-R5J3WAUI.mjs +645 -0
  97. package/dist/chunk-R5J3WAUI.mjs.map +1 -0
  98. package/dist/chunk-XZ6ZMXXU.mjs +39 -0
  99. package/dist/{chunk-K36R6HWY.mjs.map → chunk-XZ6ZMXXU.mjs.map} +1 -1
  100. package/dist/chunk-YPU4WTXZ.mjs +269 -0
  101. package/dist/chunk-YPU4WTXZ.mjs.map +1 -0
  102. package/dist/chunk-YUCD2TFH.mjs +242 -0
  103. package/dist/chunk-YUCD2TFH.mjs.map +1 -0
  104. package/dist/chunk-ZTJENCFC.mjs +379 -0
  105. package/dist/chunk-ZTJENCFC.mjs.map +1 -0
  106. package/dist/chunk-ZWYXXCXP.mjs +248 -0
  107. package/dist/chunk-ZWYXXCXP.mjs.map +1 -0
  108. package/dist/index.d.mts +183 -0
  109. package/dist/index.d.ts +183 -0
  110. package/dist/index.js +3930 -4449
  111. package/dist/index.js.map +1 -1
  112. package/dist/index.mjs +250 -2698
  113. package/dist/index.mjs.map +1 -1
  114. package/package.json +5 -5
  115. package/dist/chunk-2YMA6QOV.mjs +0 -193
  116. package/dist/chunk-2YMA6QOV.mjs.map +0 -1
  117. package/dist/chunk-3IIFBJCD.mjs +0 -45
  118. package/dist/chunk-BS4DKYGN.mjs +0 -48
  119. package/dist/chunk-DE7I3VHO.mjs +0 -106
  120. package/dist/chunk-F6D2OZ36.mjs +0 -89
  121. package/dist/chunk-F6D2OZ36.mjs.map +0 -1
  122. package/dist/chunk-GAOIFQDX.mjs +0 -59
  123. package/dist/chunk-GAOIFQDX.mjs.map +0 -1
  124. package/dist/chunk-HUIX2XVR.mjs +0 -159
  125. package/dist/chunk-HUIX2XVR.mjs.map +0 -1
  126. package/dist/chunk-K36R6HWY.mjs +0 -51
  127. package/dist/chunk-MBTAI3WE.mjs +0 -78
  128. package/dist/chunk-MBTAI3WE.mjs.map +0 -1
  129. package/dist/chunk-MGT6RUVX.mjs +0 -423
  130. package/dist/chunk-PIFS7AIT.mjs +0 -446
  131. package/dist/chunk-WG66JYYW.mjs +0 -116
  132. package/dist/chunk-XD7WGXHZ.mjs +0 -82
  133. package/dist/chunk-YYDM6V2F.mjs +0 -113
  134. package/dist/chunk-ZK7P3TZN.mjs +0 -286
  135. package/dist/chunk-ZK7P3TZN.mjs.map +0 -1
  136. /package/dist/{chunk-3IIFBJCD.mjs.map → chunk-BJTO5JO5.mjs.map} +0 -0
@@ -1,45 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
-
38
- export {
39
- __require,
40
- __commonJS,
41
- __export,
42
- __reExport,
43
- __toESM
44
- };
45
- //# sourceMappingURL=chunk-3IIFBJCD.mjs.map
@@ -1,48 +0,0 @@
1
- import {
2
- require_object_detection_models
3
- } from "./chunk-MGT6RUVX.mjs";
4
- import {
5
- __commonJS,
6
- __require
7
- } from "./chunk-3IIFBJCD.mjs";
8
-
9
- // src/catalogs/segmentation-refiner-models.js
10
- var require_segmentation_refiner_models = __commonJS({
11
- "src/catalogs/segmentation-refiner-models.js"(exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.SEGMENTATION_REFINER_MODELS = void 0;
15
- var types_1 = __require("@camstack/types");
16
- var object_detection_models_js_1 = require_object_detection_models();
17
- var HF_REPO = "camstack/camstack-models";
18
- var hf = (path) => (0, types_1.hfModelUrl)(HF_REPO, path);
19
- var MASK_LABELS = [
20
- { id: "mask", name: "Segmentation Mask" }
21
- ];
22
- exports.SEGMENTATION_REFINER_MODELS = [
23
- {
24
- id: "u2netp",
25
- name: "U2-Net Portable",
26
- description: "U2-Net-P \u2014 ultra-lightweight salient object segmentation (4.7 MB), no prompt needed",
27
- inputSize: { width: 320, height: 320 },
28
- labels: MASK_LABELS,
29
- formats: {
30
- onnx: { url: hf("segmentationRefiner/u2netp/onnx/camstack-u2netp.onnx"), sizeMB: 5 },
31
- coreml: {
32
- url: hf("segmentationRefiner/u2netp/coreml/camstack-u2netp.mlpackage"),
33
- sizeMB: 3,
34
- isDirectory: true,
35
- files: object_detection_models_js_1.MLPACKAGE_FILES,
36
- runtimes: ["python"]
37
- }
38
- // OpenVINO: not yet converted
39
- }
40
- }
41
- ];
42
- }
43
- });
44
-
45
- export {
46
- require_segmentation_refiner_models
47
- };
48
- //# sourceMappingURL=chunk-BS4DKYGN.mjs.map
@@ -1,106 +0,0 @@
1
- import {
2
- __commonJS
3
- } from "./chunk-3IIFBJCD.mjs";
4
-
5
- // src/shared/postprocess/yolo.js
6
- var require_yolo = __commonJS({
7
- "src/shared/postprocess/yolo.js"(exports) {
8
- "use strict";
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.iou = iou;
11
- exports.nms = nms;
12
- exports.yoloPostprocess = yoloPostprocess;
13
- function iou(a, b) {
14
- const ax1 = a.x;
15
- const ay1 = a.y;
16
- const ax2 = a.x + a.w;
17
- const ay2 = a.y + a.h;
18
- const bx1 = b.x;
19
- const by1 = b.y;
20
- const bx2 = b.x + b.w;
21
- const by2 = b.y + b.h;
22
- const interX1 = Math.max(ax1, bx1);
23
- const interY1 = Math.max(ay1, by1);
24
- const interX2 = Math.min(ax2, bx2);
25
- const interY2 = Math.min(ay2, by2);
26
- const interW = Math.max(0, interX2 - interX1);
27
- const interH = Math.max(0, interY2 - interY1);
28
- const interArea = interW * interH;
29
- if (interArea === 0)
30
- return 0;
31
- const areaA = a.w * a.h;
32
- const areaB = b.w * b.h;
33
- const unionArea = areaA + areaB - interArea;
34
- return unionArea === 0 ? 0 : interArea / unionArea;
35
- }
36
- function nms(boxes, iouThreshold) {
37
- const indices = boxes.map((_, i) => i).sort((a, b) => boxes[b].score - boxes[a].score);
38
- const kept = [];
39
- const suppressed = /* @__PURE__ */ new Set();
40
- for (const idx of indices) {
41
- if (suppressed.has(idx))
42
- continue;
43
- kept.push(idx);
44
- for (const other of indices) {
45
- if (other === idx || suppressed.has(other))
46
- continue;
47
- if (iou(boxes[idx].bbox, boxes[other].bbox) > iouThreshold) {
48
- suppressed.add(other);
49
- }
50
- }
51
- }
52
- return kept;
53
- }
54
- function yoloPostprocess(output, numClasses, numBoxes, options) {
55
- const { confidence, iouThreshold, labels, scale, padX, padY, originalWidth, originalHeight } = options;
56
- const candidates = [];
57
- for (let i = 0; i < numBoxes; i++) {
58
- const cx = output[0 * numBoxes + i];
59
- const cy = output[1 * numBoxes + i];
60
- const w = output[2 * numBoxes + i];
61
- const h = output[3 * numBoxes + i];
62
- let bestScore = -Infinity;
63
- let bestClass = 0;
64
- for (let j = 0; j < numClasses; j++) {
65
- const score = output[(4 + j) * numBoxes + i];
66
- if (score > bestScore) {
67
- bestScore = score;
68
- bestClass = j;
69
- }
70
- }
71
- if (bestScore < confidence)
72
- continue;
73
- const bbox = {
74
- x: cx - w / 2,
75
- y: cy - h / 2,
76
- w,
77
- h
78
- };
79
- candidates.push({ bbox, score: bestScore, classIdx: bestClass });
80
- }
81
- if (candidates.length === 0)
82
- return [];
83
- const keptIndices = nms(candidates, iouThreshold);
84
- return keptIndices.map((idx) => {
85
- const { bbox, score, classIdx } = candidates[idx];
86
- const label = labels[classIdx] ?? String(classIdx);
87
- const x = Math.max(0, Math.min(originalWidth, (bbox.x - padX) / scale));
88
- const y = Math.max(0, Math.min(originalHeight, (bbox.y - padY) / scale));
89
- const x2 = Math.max(0, Math.min(originalWidth, (bbox.x + bbox.w - padX) / scale));
90
- const y2 = Math.max(0, Math.min(originalHeight, (bbox.y + bbox.h - padY) / scale));
91
- const finalBbox = { x, y, w: x2 - x, h: y2 - y };
92
- return {
93
- class: label,
94
- originalClass: label,
95
- score,
96
- bbox: finalBbox
97
- };
98
- });
99
- }
100
- }
101
- });
102
-
103
- export {
104
- require_yolo
105
- };
106
- //# sourceMappingURL=chunk-DE7I3VHO.mjs.map
@@ -1,89 +0,0 @@
1
- import {
2
- require_object_detection_models
3
- } from "./chunk-MGT6RUVX.mjs";
4
- import {
5
- __commonJS,
6
- __require
7
- } from "./chunk-3IIFBJCD.mjs";
8
-
9
- // src/shared/postprocess/arcface.js
10
- var require_arcface = __commonJS({
11
- "src/shared/postprocess/arcface.js"(exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.l2Normalize = l2Normalize;
15
- exports.cosineSimilarity = cosineSimilarity;
16
- function l2Normalize(vec) {
17
- let sumSq = 0;
18
- for (let i = 0; i < vec.length; i++) {
19
- sumSq += vec[i] * vec[i];
20
- }
21
- const norm = Math.sqrt(sumSq);
22
- if (norm === 0)
23
- return new Float32Array(vec.length);
24
- const out = new Float32Array(vec.length);
25
- for (let i = 0; i < vec.length; i++) {
26
- out[i] = vec[i] / norm;
27
- }
28
- return out;
29
- }
30
- function cosineSimilarity(a, b) {
31
- if (a.length !== b.length)
32
- throw new Error("Embedding length mismatch");
33
- let dot = 0;
34
- for (let i = 0; i < a.length; i++) {
35
- dot += a[i] * b[i];
36
- }
37
- return dot;
38
- }
39
- }
40
- });
41
-
42
- // src/catalogs/face-recognition-models.js
43
- var require_face_recognition_models = __commonJS({
44
- "src/catalogs/face-recognition-models.js"(exports) {
45
- "use strict";
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.FACE_RECOGNITION_MODELS = void 0;
48
- var types_1 = __require("@camstack/types");
49
- var object_detection_models_js_1 = require_object_detection_models();
50
- var HF_REPO = "camstack/camstack-models";
51
- var FACE_EMBEDDING_LABELS = [
52
- { id: "embedding", name: "Face Embedding" }
53
- ];
54
- exports.FACE_RECOGNITION_MODELS = [
55
- {
56
- id: "arcface-r100",
57
- name: "ArcFace R100",
58
- description: "ArcFace ResNet-100 \u2014 high-accuracy face recognition embeddings",
59
- inputSize: { width: 112, height: 112 },
60
- inputLayout: "nhwc",
61
- labels: FACE_EMBEDDING_LABELS,
62
- formats: {
63
- onnx: {
64
- url: (0, types_1.hfModelUrl)(HF_REPO, "faceRecognition/arcface/onnx/camstack-arcface-arcface.onnx"),
65
- sizeMB: 130
66
- },
67
- coreml: {
68
- url: (0, types_1.hfModelUrl)(HF_REPO, "faceRecognition/arcface/coreml/camstack-arcface-r100.mlpackage"),
69
- sizeMB: 65,
70
- isDirectory: true,
71
- files: object_detection_models_js_1.MLPACKAGE_FILES,
72
- runtimes: ["python"]
73
- },
74
- openvino: {
75
- url: (0, types_1.hfModelUrl)(HF_REPO, "faceRecognition/arcface/openvino/camstack-arcface-r100.xml"),
76
- sizeMB: 65,
77
- runtimes: ["python"]
78
- }
79
- }
80
- }
81
- ];
82
- }
83
- });
84
-
85
- export {
86
- require_arcface,
87
- require_face_recognition_models
88
- };
89
- //# sourceMappingURL=chunk-F6D2OZ36.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared/postprocess/arcface.ts","../src/catalogs/face-recognition-models.ts"],"sourcesContent":["/** L2 normalize a vector in-place, returning a new Float32Array */\nexport function l2Normalize(vec: Float32Array): Float32Array {\n let sumSq = 0\n for (let i = 0; i < vec.length; i++) {\n sumSq += vec[i]! * vec[i]!\n }\n const norm = Math.sqrt(sumSq)\n if (norm === 0) return new Float32Array(vec.length)\n\n const out = new Float32Array(vec.length)\n for (let i = 0; i < vec.length; i++) {\n out[i] = vec[i]! / norm\n }\n return out\n}\n\n/** Cosine similarity between two embeddings (assumes they are already L2-normalized) */\nexport function cosineSimilarity(a: Float32Array, b: Float32Array): number {\n if (a.length !== b.length) throw new Error('Embedding length mismatch')\n let dot = 0\n for (let i = 0; i < a.length; i++) {\n dot += a[i]! * b[i]!\n }\n return dot\n}\n","import type { ModelCatalogEntry, LabelDefinition } from '@camstack/types'\nimport { hfModelUrl } from '@camstack/types'\nimport { MLPACKAGE_FILES } from './object-detection-models.js'\n\nconst HF_REPO = 'camstack/camstack-models'\n\nconst FACE_EMBEDDING_LABELS: readonly LabelDefinition[] = [\n { id: 'embedding', name: 'Face Embedding' },\n] as const\n\nexport const FACE_RECOGNITION_MODELS: readonly ModelCatalogEntry[] = [\n {\n id: 'arcface-r100',\n name: 'ArcFace R100',\n description: 'ArcFace ResNet-100 — high-accuracy face recognition embeddings',\n inputSize: { width: 112, height: 112 },\n inputLayout: 'nhwc',\n labels: FACE_EMBEDDING_LABELS,\n formats: {\n onnx: {\n url: hfModelUrl(HF_REPO, 'faceRecognition/arcface/onnx/camstack-arcface-arcface.onnx'),\n sizeMB: 130,\n },\n coreml: {\n url: hfModelUrl(HF_REPO, 'faceRecognition/arcface/coreml/camstack-arcface-r100.mlpackage'),\n sizeMB: 65,\n isDirectory: true,\n files: MLPACKAGE_FILES,\n runtimes: ['python'],\n },\n openvino: {\n url: hfModelUrl(HF_REPO, 'faceRecognition/arcface/openvino/camstack-arcface-r100.xml'),\n sizeMB: 65,\n runtimes: ['python'],\n },\n },\n },\n] as const\n"],"mappings":";;;;;;;;;;;;;AACA,YAAA,cAAA;AAgBA,YAAA,mBAAA;AAhBA,aAAgB,YAAY,KAAiB;AAC3C,UAAI,QAAQ;AACZ,eAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,iBAAS,IAAI,CAAC,IAAK,IAAI,CAAC;MAC1B;AACA,YAAM,OAAO,KAAK,KAAK,KAAK;AAC5B,UAAI,SAAS;AAAG,eAAO,IAAI,aAAa,IAAI,MAAM;AAElD,YAAM,MAAM,IAAI,aAAa,IAAI,MAAM;AACvC,eAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,YAAI,CAAC,IAAI,IAAI,CAAC,IAAK;MACrB;AACA,aAAO;IACT;AAGA,aAAgB,iBAAiB,GAAiB,GAAe;AAC/D,UAAI,EAAE,WAAW,EAAE;AAAQ,cAAM,IAAI,MAAM,2BAA2B;AACtE,UAAI,MAAM;AACV,eAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,eAAO,EAAE,CAAC,IAAK,EAAE,CAAC;MACpB;AACA,aAAO;IACT;;;;;;;;;;ACvBA,QAAA,UAAA,UAAA,iBAAA;AACA,QAAA,+BAAA;AAEA,QAAM,UAAU;AAEhB,QAAM,wBAAoD;MACxD,EAAE,IAAI,aAAa,MAAM,iBAAgB;;AAG9B,YAAA,0BAAwD;MACnE;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,IAAG;QACpC,aAAa;QACb,QAAQ;QACR,SAAS;UACP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,4DAA4D;YACrF,QAAQ;;UAEV,QAAQ;YACN,MAAK,GAAA,QAAA,YAAW,SAAS,gEAAgE;YACzF,QAAQ;YACR,aAAa;YACb,OAAO,6BAAA;YACP,UAAU,CAAC,QAAQ;;UAErB,UAAU;YACR,MAAK,GAAA,QAAA,YAAW,SAAS,4DAA4D;YACrF,QAAQ;YACR,UAAU,CAAC,QAAQ;;;;;;;","names":[]}
@@ -1,59 +0,0 @@
1
- import {
2
- require_object_detection_models
3
- } from "./chunk-MGT6RUVX.mjs";
4
- import {
5
- __commonJS,
6
- __require
7
- } from "./chunk-3IIFBJCD.mjs";
8
-
9
- // src/catalogs/plate-detection-models.js
10
- var require_plate_detection_models = __commonJS({
11
- "src/catalogs/plate-detection-models.js"(exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.PLATE_DETECTION_MODELS = void 0;
15
- var types_1 = __require("@camstack/types");
16
- var object_detection_models_js_1 = require_object_detection_models();
17
- var HF_REPO = "camstack/camstack-models";
18
- var PLATE_LABELS = [
19
- { id: "plate", name: "License Plate" }
20
- ];
21
- exports.PLATE_DETECTION_MODELS = [
22
- {
23
- id: "yolov8n-plate",
24
- name: "YOLOv8 Nano \u2014 License Plate",
25
- description: "YOLOv8 Nano fine-tuned for license plate detection",
26
- inputSize: { width: 640, height: 640 },
27
- labels: PLATE_LABELS,
28
- formats: {
29
- onnx: {
30
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateDetection/yolov8-plate/onnx/camstack-yolov8n-plate.onnx"),
31
- sizeMB: 12
32
- },
33
- coreml: {
34
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateDetection/yolov8-plate/coreml/camstack-yolov8n-plate.mlpackage"),
35
- sizeMB: 5.9,
36
- isDirectory: true,
37
- files: object_detection_models_js_1.MLPACKAGE_FILES,
38
- runtimes: ["python"]
39
- },
40
- openvino: {
41
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateDetection/yolov8-plate/openvino/camstack-yolov8n-plate.xml"),
42
- sizeMB: 6.1,
43
- runtimes: ["python"]
44
- },
45
- tflite: {
46
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateDetection/yolov8-plate/tflite/camstack-yolov8n-plate_float32.tflite"),
47
- sizeMB: 12,
48
- runtimes: ["python"]
49
- }
50
- }
51
- }
52
- ];
53
- }
54
- });
55
-
56
- export {
57
- require_plate_detection_models
58
- };
59
- //# sourceMappingURL=chunk-GAOIFQDX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/catalogs/plate-detection-models.ts"],"sourcesContent":["import type { ModelCatalogEntry, LabelDefinition } from '@camstack/types'\nimport { hfModelUrl } from '@camstack/types'\nimport { MLPACKAGE_FILES } from './object-detection-models.js'\n\nconst HF_REPO = 'camstack/camstack-models'\n\nconst PLATE_LABELS: readonly LabelDefinition[] = [\n { id: 'plate', name: 'License Plate' },\n] as const\n\nexport const PLATE_DETECTION_MODELS: readonly ModelCatalogEntry[] = [\n {\n id: 'yolov8n-plate',\n name: 'YOLOv8 Nano — License Plate',\n description: 'YOLOv8 Nano fine-tuned for license plate detection',\n inputSize: { width: 640, height: 640 },\n labels: PLATE_LABELS,\n formats: {\n onnx: {\n url: hfModelUrl(HF_REPO, 'plateDetection/yolov8-plate/onnx/camstack-yolov8n-plate.onnx'),\n sizeMB: 12,\n },\n coreml: {\n url: hfModelUrl(HF_REPO, 'plateDetection/yolov8-plate/coreml/camstack-yolov8n-plate.mlpackage'),\n sizeMB: 5.9,\n isDirectory: true,\n files: MLPACKAGE_FILES,\n runtimes: ['python'],\n },\n openvino: {\n url: hfModelUrl(HF_REPO, 'plateDetection/yolov8-plate/openvino/camstack-yolov8n-plate.xml'),\n sizeMB: 6.1,\n runtimes: ['python'],\n },\n tflite: {\n url: hfModelUrl(HF_REPO, 'plateDetection/yolov8-plate/tflite/camstack-yolov8n-plate_float32.tflite'),\n sizeMB: 12,\n runtimes: ['python'],\n },\n },\n },\n] as const\n"],"mappings":";;;;;;;;;;;;;;AACA,QAAA,UAAA,UAAA,iBAAA;AACA,QAAA,+BAAA;AAEA,QAAM,UAAU;AAEhB,QAAM,eAA2C;MAC/C,EAAE,IAAI,SAAS,MAAM,gBAAe;;AAGzB,YAAA,yBAAuD;MAClE;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,IAAG;QACpC,QAAQ;QACR,SAAS;UACP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,8DAA8D;YACvF,QAAQ;;UAEV,QAAQ;YACN,MAAK,GAAA,QAAA,YAAW,SAAS,qEAAqE;YAC9F,QAAQ;YACR,aAAa;YACb,OAAO,6BAAA;YACP,UAAU,CAAC,QAAQ;;UAErB,UAAU;YACR,MAAK,GAAA,QAAA,YAAW,SAAS,iEAAiE;YAC1F,QAAQ;YACR,UAAU,CAAC,QAAQ;;UAErB,QAAQ;YACN,MAAK,GAAA,QAAA,YAAW,SAAS,0EAA0E;YACnG,QAAQ;YACR,UAAU,CAAC,QAAQ;;;;;;;","names":[]}
@@ -1,159 +0,0 @@
1
- import {
2
- __commonJS,
3
- __require
4
- } from "./chunk-3IIFBJCD.mjs";
5
-
6
- // src/shared/postprocess/paddleocr.js
7
- var require_paddleocr = __commonJS({
8
- "src/shared/postprocess/paddleocr.js"(exports) {
9
- "use strict";
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ctcDecode = ctcDecode;
12
- function ctcDecode(output, seqLen, numChars, charset) {
13
- let totalLogScore = 0;
14
- const rawIndices = [];
15
- for (let t = 0; t < seqLen; t++) {
16
- const offset = t * numChars;
17
- let bestIdx = 0;
18
- let bestVal = output[offset];
19
- for (let c = 1; c < numChars; c++) {
20
- const val = output[offset + c];
21
- if (val > bestVal) {
22
- bestVal = val;
23
- bestIdx = c;
24
- }
25
- }
26
- rawIndices.push(bestIdx);
27
- totalLogScore += bestVal;
28
- }
29
- const collapsed = [];
30
- for (let i = 0; i < rawIndices.length; i++) {
31
- const cur = rawIndices[i];
32
- if (i === 0 || cur !== rawIndices[i - 1]) {
33
- collapsed.push(cur);
34
- }
35
- }
36
- const filtered = collapsed.filter((idx) => idx !== 0);
37
- const text = filtered.map((idx) => charset[idx] ?? "").join("");
38
- const confidence = seqLen > 0 ? totalLogScore / seqLen : 0;
39
- return { text, confidence };
40
- }
41
- }
42
- });
43
-
44
- // src/catalogs/plate-recognition-models.js
45
- var require_plate_recognition_models = __commonJS({
46
- "src/catalogs/plate-recognition-models.js"(exports) {
47
- "use strict";
48
- Object.defineProperty(exports, "__esModule", { value: true });
49
- exports.PLATE_RECOGNITION_MODELS = void 0;
50
- var types_1 = __require("@camstack/types");
51
- var HF_REPO = "camstack/camstack-models";
52
- var PLATE_TEXT_LABELS = [
53
- { id: "text", name: "Plate Text" }
54
- ];
55
- exports.PLATE_RECOGNITION_MODELS = [
56
- // ── PaddleOCR PP-OCRv5 ────────────────────────────────────────
57
- {
58
- id: "paddleocr-latin",
59
- name: "PaddleOCR Latin",
60
- description: "PaddleOCR PP-OCRv5 recognition model for Latin-script license plates",
61
- inputSize: { width: 320, height: 48 },
62
- labels: PLATE_TEXT_LABELS,
63
- formats: {
64
- // ONNX only — PaddleOCR has dynamic dimensions incompatible with CoreML native conversion.
65
- // On Apple Silicon, ONNX Runtime uses CoreML EP automatically for acceleration.
66
- onnx: {
67
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/onnx/camstack-paddleocr-latin-rec.onnx"),
68
- sizeMB: 7.5
69
- },
70
- openvino: {
71
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/openvino/camstack-paddleocr-latin.xml"),
72
- sizeMB: 4,
73
- runtimes: ["python"]
74
- }
75
- },
76
- extraFiles: [
77
- {
78
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/onnx/camstack-paddleocr-latin-dict.txt"),
79
- filename: "camstack-paddleocr-latin-dict.txt",
80
- sizeMB: 0.01
81
- }
82
- ]
83
- },
84
- {
85
- id: "paddleocr-en",
86
- name: "PaddleOCR English",
87
- description: "PaddleOCR PP-OCRv5 recognition model optimized for English license plates",
88
- inputSize: { width: 320, height: 48 },
89
- labels: PLATE_TEXT_LABELS,
90
- formats: {
91
- onnx: {
92
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/onnx/camstack-paddleocr-en-rec.onnx"),
93
- sizeMB: 7.5
94
- },
95
- openvino: {
96
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/openvino/camstack-paddleocr-en.xml"),
97
- sizeMB: 4,
98
- runtimes: ["python"]
99
- }
100
- },
101
- extraFiles: [
102
- {
103
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/paddleocr/onnx/camstack-paddleocr-en-dict.txt"),
104
- filename: "camstack-paddleocr-en-dict.txt",
105
- sizeMB: 0.01
106
- }
107
- ]
108
- },
109
- // ── CRNN-MobileNetV3 (via OnnxTR/docTR) ─────────────────────────
110
- // Simple CNN+LSTM+CTC architecture — good CoreML compatibility (no dynamic ops)
111
- {
112
- id: "crnn-mobilenet-v3-small",
113
- name: "CRNN MobileNet V3 Small",
114
- description: "CRNN MobileNetV3-Small \u2014 lightweight text recognition, CoreML compatible via OnnxTR",
115
- inputSize: { width: 128, height: 32 },
116
- labels: PLATE_TEXT_LABELS,
117
- formats: {
118
- onnx: {
119
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/crnn-mobilenet/onnx/camstack-crnn-mobilenet-v3-small.onnx"),
120
- sizeMB: 8
121
- }
122
- },
123
- extraFiles: [
124
- {
125
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/crnn-mobilenet/camstack-crnn-mobilenet-charset.txt"),
126
- filename: "camstack-crnn-mobilenet-charset.txt",
127
- sizeMB: 0.01
128
- }
129
- ]
130
- },
131
- {
132
- id: "crnn-mobilenet-v3-large",
133
- name: "CRNN MobileNet V3 Large",
134
- description: "CRNN MobileNetV3-Large \u2014 higher accuracy text recognition, CoreML compatible",
135
- inputSize: { width: 128, height: 32 },
136
- labels: PLATE_TEXT_LABELS,
137
- formats: {
138
- onnx: {
139
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/crnn-mobilenet/onnx/camstack-crnn-mobilenet-v3-large.onnx"),
140
- sizeMB: 17
141
- }
142
- },
143
- extraFiles: [
144
- {
145
- url: (0, types_1.hfModelUrl)(HF_REPO, "plateRecognition/crnn-mobilenet/camstack-crnn-mobilenet-charset.txt"),
146
- filename: "camstack-crnn-mobilenet-charset.txt",
147
- sizeMB: 0.01
148
- }
149
- ]
150
- }
151
- ];
152
- }
153
- });
154
-
155
- export {
156
- require_paddleocr,
157
- require_plate_recognition_models
158
- };
159
- //# sourceMappingURL=chunk-HUIX2XVR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared/postprocess/paddleocr.ts","../src/catalogs/plate-recognition-models.ts"],"sourcesContent":["/** Decode CTC output to text.\n *\n * Output shape: [1, seqLen, numChars]\n * Algorithm: argmax per timestep → collapse consecutive duplicates → remove blank (index 0) → join\n */\nexport function ctcDecode(\n output: Float32Array,\n seqLen: number,\n numChars: number,\n charset: readonly string[], // index 0 = blank token\n): { text: string; confidence: number } {\n // Step 1: argmax per timestep + track confidence as mean of selected scores\n let totalLogScore = 0\n const rawIndices: number[] = []\n\n for (let t = 0; t < seqLen; t++) {\n const offset = t * numChars\n let bestIdx = 0\n let bestVal = output[offset]!\n\n for (let c = 1; c < numChars; c++) {\n const val = output[offset + c]!\n if (val > bestVal) {\n bestVal = val\n bestIdx = c\n }\n }\n\n rawIndices.push(bestIdx)\n totalLogScore += bestVal\n }\n\n // Step 2: collapse consecutive duplicates\n const collapsed: number[] = []\n for (let i = 0; i < rawIndices.length; i++) {\n const cur = rawIndices[i]!\n if (i === 0 || cur !== rawIndices[i - 1]) {\n collapsed.push(cur)\n }\n }\n\n // Step 3: remove blank (index 0)\n const filtered = collapsed.filter((idx) => idx !== 0)\n\n // Step 4: join characters\n const text = filtered.map((idx) => charset[idx] ?? '').join('')\n\n const confidence = seqLen > 0 ? totalLogScore / seqLen : 0\n\n return { text, confidence }\n}\n","import type { ModelCatalogEntry, LabelDefinition } from '@camstack/types'\nimport { hfModelUrl } from '@camstack/types'\n\nconst HF_REPO = 'camstack/camstack-models'\n\nconst PLATE_TEXT_LABELS: readonly LabelDefinition[] = [\n { id: 'text', name: 'Plate Text' },\n] as const\n\nexport const PLATE_RECOGNITION_MODELS: readonly ModelCatalogEntry[] = [\n // ── PaddleOCR PP-OCRv5 ────────────────────────────────────────\n {\n id: 'paddleocr-latin',\n name: 'PaddleOCR Latin',\n description: 'PaddleOCR PP-OCRv5 recognition model for Latin-script license plates',\n inputSize: { width: 320, height: 48 },\n labels: PLATE_TEXT_LABELS,\n formats: {\n // ONNX only — PaddleOCR has dynamic dimensions incompatible with CoreML native conversion.\n // On Apple Silicon, ONNX Runtime uses CoreML EP automatically for acceleration.\n onnx: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/onnx/camstack-paddleocr-latin-rec.onnx'),\n sizeMB: 7.5,\n },\n openvino: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/openvino/camstack-paddleocr-latin.xml'),\n sizeMB: 4,\n runtimes: ['python'],\n },\n },\n extraFiles: [\n {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/onnx/camstack-paddleocr-latin-dict.txt'),\n filename: 'camstack-paddleocr-latin-dict.txt',\n sizeMB: 0.01,\n },\n ],\n },\n {\n id: 'paddleocr-en',\n name: 'PaddleOCR English',\n description: 'PaddleOCR PP-OCRv5 recognition model optimized for English license plates',\n inputSize: { width: 320, height: 48 },\n labels: PLATE_TEXT_LABELS,\n formats: {\n onnx: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/onnx/camstack-paddleocr-en-rec.onnx'),\n sizeMB: 7.5,\n },\n openvino: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/openvino/camstack-paddleocr-en.xml'),\n sizeMB: 4,\n runtimes: ['python'],\n },\n },\n extraFiles: [\n {\n url: hfModelUrl(HF_REPO, 'plateRecognition/paddleocr/onnx/camstack-paddleocr-en-dict.txt'),\n filename: 'camstack-paddleocr-en-dict.txt',\n sizeMB: 0.01,\n },\n ],\n },\n\n // ── CRNN-MobileNetV3 (via OnnxTR/docTR) ─────────────────────────\n // Simple CNN+LSTM+CTC architecture — good CoreML compatibility (no dynamic ops)\n {\n id: 'crnn-mobilenet-v3-small',\n name: 'CRNN MobileNet V3 Small',\n description: 'CRNN MobileNetV3-Small — lightweight text recognition, CoreML compatible via OnnxTR',\n inputSize: { width: 128, height: 32 },\n labels: PLATE_TEXT_LABELS,\n formats: {\n onnx: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/crnn-mobilenet/onnx/camstack-crnn-mobilenet-v3-small.onnx'),\n sizeMB: 8,\n },\n },\n extraFiles: [\n {\n url: hfModelUrl(HF_REPO, 'plateRecognition/crnn-mobilenet/camstack-crnn-mobilenet-charset.txt'),\n filename: 'camstack-crnn-mobilenet-charset.txt',\n sizeMB: 0.01,\n },\n ],\n },\n {\n id: 'crnn-mobilenet-v3-large',\n name: 'CRNN MobileNet V3 Large',\n description: 'CRNN MobileNetV3-Large — higher accuracy text recognition, CoreML compatible',\n inputSize: { width: 128, height: 32 },\n labels: PLATE_TEXT_LABELS,\n formats: {\n onnx: {\n url: hfModelUrl(HF_REPO, 'plateRecognition/crnn-mobilenet/onnx/camstack-crnn-mobilenet-v3-large.onnx'),\n sizeMB: 17,\n },\n },\n extraFiles: [\n {\n url: hfModelUrl(HF_REPO, 'plateRecognition/crnn-mobilenet/camstack-crnn-mobilenet-charset.txt'),\n filename: 'camstack-crnn-mobilenet-charset.txt',\n sizeMB: 0.01,\n },\n ],\n },\n] as const\n"],"mappings":";;;;;;;;;;AAKA,YAAA,YAAA;AAAA,aAAgB,UACd,QACA,QACA,UACA,SAA0B;AAG1B,UAAI,gBAAgB;AACpB,YAAM,aAAuB,CAAA;AAE7B,eAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC/B,cAAM,SAAS,IAAI;AACnB,YAAI,UAAU;AACd,YAAI,UAAU,OAAO,MAAM;AAE3B,iBAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,gBAAM,MAAM,OAAO,SAAS,CAAC;AAC7B,cAAI,MAAM,SAAS;AACjB,sBAAU;AACV,sBAAU;UACZ;QACF;AAEA,mBAAW,KAAK,OAAO;AACvB,yBAAiB;MACnB;AAGA,YAAM,YAAsB,CAAA;AAC5B,eAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,cAAM,MAAM,WAAW,CAAC;AACxB,YAAI,MAAM,KAAK,QAAQ,WAAW,IAAI,CAAC,GAAG;AACxC,oBAAU,KAAK,GAAG;QACpB;MACF;AAGA,YAAM,WAAW,UAAU,OAAO,CAAC,QAAQ,QAAQ,CAAC;AAGpD,YAAM,OAAO,SAAS,IAAI,CAAC,QAAQ,QAAQ,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE;AAE9D,YAAM,aAAa,SAAS,IAAI,gBAAgB,SAAS;AAEzD,aAAO,EAAE,MAAM,WAAU;IAC3B;;;;;;;;;;ACjDA,QAAA,UAAA,UAAA,iBAAA;AAEA,QAAM,UAAU;AAEhB,QAAM,oBAAgD;MACpD,EAAE,IAAI,QAAQ,MAAM,aAAY;;AAGrB,YAAA,2BAAyD;;MAEpE;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,GAAE;QACnC,QAAQ;QACR,SAAS;;;UAGP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,mEAAmE;YAC5F,QAAQ;;UAEV,UAAU;YACR,MAAK,GAAA,QAAA,YAAW,SAAS,kEAAkE;YAC3F,QAAQ;YACR,UAAU,CAAC,QAAQ;;;QAGvB,YAAY;UACV;YACE,MAAK,GAAA,QAAA,YAAW,SAAS,mEAAmE;YAC5F,UAAU;YACV,QAAQ;;;;MAId;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,GAAE;QACnC,QAAQ;QACR,SAAS;UACP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,gEAAgE;YACzF,QAAQ;;UAEV,UAAU;YACR,MAAK,GAAA,QAAA,YAAW,SAAS,+DAA+D;YACxF,QAAQ;YACR,UAAU,CAAC,QAAQ;;;QAGvB,YAAY;UACV;YACE,MAAK,GAAA,QAAA,YAAW,SAAS,gEAAgE;YACzF,UAAU;YACV,QAAQ;;;;;;MAOd;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,GAAE;QACnC,QAAQ;QACR,SAAS;UACP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,4EAA4E;YACrG,QAAQ;;;QAGZ,YAAY;UACV;YACE,MAAK,GAAA,QAAA,YAAW,SAAS,qEAAqE;YAC9F,UAAU;YACV,QAAQ;;;;MAId;QACE,IAAI;QACJ,MAAM;QACN,aAAa;QACb,WAAW,EAAE,OAAO,KAAK,QAAQ,GAAE;QACnC,QAAQ;QACR,SAAS;UACP,MAAM;YACJ,MAAK,GAAA,QAAA,YAAW,SAAS,4EAA4E;YACrG,QAAQ;;;QAGZ,YAAY;UACV;YACE,MAAK,GAAA,QAAA,YAAW,SAAS,qEAAqE;YAC9F,UAAU;YACV,QAAQ;;;;;;;","names":[]}
@@ -1,51 +0,0 @@
1
- import {
2
- __commonJS,
3
- __require
4
- } from "./chunk-3IIFBJCD.mjs";
5
-
6
- // src/catalogs/vehicle-classification-models.js
7
- var require_vehicle_classification_models = __commonJS({
8
- "src/catalogs/vehicle-classification-models.js"(exports) {
9
- "use strict";
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.VEHICLE_TYPE_MODELS = void 0;
12
- var types_1 = __require("@camstack/types");
13
- var HF_REPO = "camstack/camstack-models";
14
- var hf = (path) => (0, types_1.hfModelUrl)(HF_REPO, path);
15
- var VEHICLE_LABELS = [
16
- { id: "vehicle-type", name: "Vehicle Type" }
17
- ];
18
- exports.VEHICLE_TYPE_MODELS = [
19
- {
20
- id: "vehicle-type-efficientnet",
21
- name: "Vehicle Type (EfficientNet)",
22
- description: "EfficientNet-B4 vehicle make/model/year classifier \u2014 8,949 classes from VMMRdb",
23
- inputSize: { width: 380, height: 380 },
24
- inputNormalization: "imagenet",
25
- labels: VEHICLE_LABELS,
26
- formats: {
27
- onnx: { url: hf("vehicleClassification/efficientnet/onnx/camstack-vehicle-type-efficientnet.onnx"), sizeMB: 135 },
28
- coreml: {
29
- url: hf("vehicleClassification/efficientnet/coreml/camstack-vehicle-type-efficientnet.mlpackage"),
30
- sizeMB: 10,
31
- isDirectory: true,
32
- files: ["Manifest.json", "Data/com.apple.CoreML/model.mlmodel", "Data/com.apple.CoreML/weights/weight.bin"],
33
- runtimes: ["python"]
34
- }
35
- },
36
- extraFiles: [
37
- {
38
- url: hf("vehicleClassification/efficientnet/camstack-vehicle-type-labels.json"),
39
- filename: "camstack-vehicle-type-labels.json",
40
- sizeMB: 0.2
41
- }
42
- ]
43
- }
44
- ];
45
- }
46
- });
47
-
48
- export {
49
- require_vehicle_classification_models
50
- };
51
- //# sourceMappingURL=chunk-K36R6HWY.mjs.map
@@ -1,78 +0,0 @@
1
- import {
2
- __commonJS,
3
- __require
4
- } from "./chunk-3IIFBJCD.mjs";
5
-
6
- // src/shared/postprocess/yamnet.js
7
- var require_yamnet = __commonJS({
8
- "src/shared/postprocess/yamnet.js"(exports) {
9
- "use strict";
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.yamnetPostprocess = yamnetPostprocess;
12
- function yamnetPostprocess(output, numFrames, numClasses, classNames, minScore) {
13
- const avgScores = new Float32Array(numClasses);
14
- for (let f = 0; f < numFrames; f++) {
15
- for (let c = 0; c < numClasses; c++) {
16
- const prev = avgScores[c] ?? 0;
17
- avgScores[c] = prev + (output[f * numClasses + c] ?? 0);
18
- }
19
- }
20
- if (numFrames > 0) {
21
- for (let c = 0; c < numClasses; c++) {
22
- const val = avgScores[c] ?? 0;
23
- avgScores[c] = val / numFrames;
24
- }
25
- }
26
- const results = [];
27
- for (let c = 0; c < numClasses; c++) {
28
- const score = avgScores[c];
29
- if (score >= minScore) {
30
- results.push({
31
- className: classNames[c] ?? String(c),
32
- score
33
- });
34
- }
35
- }
36
- return results.sort((a, b) => b.score - a.score);
37
- }
38
- }
39
- });
40
-
41
- // src/catalogs/audio-classification-models.js
42
- var require_audio_classification_models = __commonJS({
43
- "src/catalogs/audio-classification-models.js"(exports) {
44
- "use strict";
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.AUDIO_CLASSIFICATION_MODELS = void 0;
47
- var types_1 = __require("@camstack/types");
48
- var HF_REPO = "camstack/camstack-models";
49
- var AUDIO_LABELS = [
50
- { id: "audio", name: "Audio Event" }
51
- ];
52
- exports.AUDIO_CLASSIFICATION_MODELS = [
53
- {
54
- id: "yamnet",
55
- name: "YAMNet",
56
- description: "YAMNet \u2014 audio event classification from raw waveform",
57
- inputSize: { width: 1, height: 16e3 },
58
- labels: AUDIO_LABELS,
59
- formats: {
60
- onnx: {
61
- url: (0, types_1.hfModelUrl)(HF_REPO, "audioClassification/yamnet/onnx/camstack-yamnet.onnx"),
62
- sizeMB: 15
63
- },
64
- openvino: {
65
- url: (0, types_1.hfModelUrl)(HF_REPO, "audioClassification/yamnet/openvino/camstack-yamnet.xml"),
66
- sizeMB: 8
67
- }
68
- }
69
- }
70
- ];
71
- }
72
- });
73
-
74
- export {
75
- require_yamnet,
76
- require_audio_classification_models
77
- };
78
- //# sourceMappingURL=chunk-MBTAI3WE.mjs.map