@souscheflabs/ml-vision 0.1.1 → 0.1.2

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 (149) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +15 -0
  3. package/README.md +50 -5
  4. package/dist/{components → cjs/components}/DetectionOverlay.js +1 -0
  5. package/dist/cjs/components/DetectionOverlay.js.map +1 -0
  6. package/dist/{components → cjs/components}/index.js +1 -0
  7. package/dist/cjs/components/index.js.map +1 -0
  8. package/dist/{core → cjs/core}/CacheManager.js +1 -0
  9. package/dist/cjs/core/CacheManager.js.map +1 -0
  10. package/dist/{core → cjs/core}/MLVisionProvider.js +4 -2
  11. package/dist/cjs/core/MLVisionProvider.js.map +1 -0
  12. package/dist/{core → cjs/core}/ServerClient.js +33 -13
  13. package/dist/cjs/core/ServerClient.js.map +1 -0
  14. package/dist/{core → cjs/core}/index.js +1 -0
  15. package/dist/cjs/core/index.js.map +1 -0
  16. package/dist/{hooks → cjs/hooks}/classLabels.js +1 -0
  17. package/dist/cjs/hooks/classLabels.js.map +1 -0
  18. package/dist/{hooks → cjs/hooks}/classLabelsCoco.js +1 -0
  19. package/dist/cjs/hooks/classLabelsCoco.js.map +1 -0
  20. package/dist/{hooks → cjs/hooks}/index.js +1 -0
  21. package/dist/cjs/hooks/index.js.map +1 -0
  22. package/dist/{hooks → cjs/hooks}/useMultiBarcodeScanner.js +6 -3
  23. package/dist/cjs/hooks/useMultiBarcodeScanner.js.map +1 -0
  24. package/dist/{hooks → cjs/hooks}/useProductDetector.js +161 -90
  25. package/dist/cjs/hooks/useProductDetector.js.map +1 -0
  26. package/dist/{hooks → cjs/hooks}/useReceiptScanner.js +60 -52
  27. package/dist/cjs/hooks/useReceiptScanner.js.map +1 -0
  28. package/dist/{hooks → cjs/hooks}/useVideoScanner.js +8 -5
  29. package/dist/cjs/hooks/useVideoScanner.js.map +1 -0
  30. package/dist/{index.js → cjs/index.js} +8 -4
  31. package/dist/cjs/index.js.map +1 -0
  32. package/dist/{processors → cjs/processors}/detectionProcessor.js +1 -0
  33. package/dist/cjs/processors/detectionProcessor.js.map +1 -0
  34. package/dist/{processors → cjs/processors}/index.js +1 -0
  35. package/dist/cjs/processors/index.js.map +1 -0
  36. package/dist/{processors → cjs/processors}/tfliteFrameProcessor.js +108 -25
  37. package/dist/cjs/processors/tfliteFrameProcessor.js.map +1 -0
  38. package/dist/{types → cjs/types}/barcode.js +1 -0
  39. package/dist/cjs/types/barcode.js.map +1 -0
  40. package/dist/{types → cjs/types}/detection.js +1 -0
  41. package/dist/cjs/types/detection.js.map +1 -0
  42. package/dist/{types → cjs/types}/index.js +1 -0
  43. package/dist/cjs/types/index.js.map +1 -0
  44. package/dist/{types → cjs/types}/ocr.js +1 -0
  45. package/dist/cjs/types/ocr.js.map +1 -0
  46. package/dist/{utils → cjs/utils}/imagePreprocessor.js +30 -25
  47. package/dist/cjs/utils/imagePreprocessor.js.map +1 -0
  48. package/dist/cjs/utils/logger.js +99 -0
  49. package/dist/cjs/utils/logger.js.map +1 -0
  50. package/dist/{utils → cjs/utils}/yoloProcessor.js +1 -0
  51. package/dist/cjs/utils/yoloProcessor.js.map +1 -0
  52. package/dist/esm/components/DetectionOverlay.js +130 -0
  53. package/dist/esm/components/DetectionOverlay.js.map +1 -0
  54. package/dist/esm/components/index.js +5 -0
  55. package/dist/esm/components/index.js.map +1 -0
  56. package/dist/esm/core/CacheManager.js +327 -0
  57. package/dist/esm/core/CacheManager.js.map +1 -0
  58. package/dist/esm/core/MLVisionProvider.js +185 -0
  59. package/dist/esm/core/MLVisionProvider.js.map +1 -0
  60. package/dist/esm/core/ServerClient.js +305 -0
  61. package/dist/esm/core/ServerClient.js.map +1 -0
  62. package/dist/esm/core/index.js +7 -0
  63. package/dist/esm/core/index.js.map +1 -0
  64. package/dist/esm/hooks/classLabels.js +436 -0
  65. package/dist/esm/hooks/classLabels.js.map +1 -0
  66. package/dist/esm/hooks/classLabelsCoco.js +98 -0
  67. package/dist/esm/hooks/classLabelsCoco.js.map +1 -0
  68. package/dist/esm/hooks/index.js +9 -0
  69. package/dist/esm/hooks/index.js.map +1 -0
  70. package/dist/esm/hooks/useMultiBarcodeScanner.js +290 -0
  71. package/dist/esm/hooks/useMultiBarcodeScanner.js.map +1 -0
  72. package/dist/esm/hooks/useProductDetector.js +714 -0
  73. package/dist/esm/hooks/useProductDetector.js.map +1 -0
  74. package/dist/esm/hooks/useReceiptScanner.js +407 -0
  75. package/dist/esm/hooks/useReceiptScanner.js.map +1 -0
  76. package/dist/esm/hooks/useVideoScanner.js +383 -0
  77. package/dist/esm/hooks/useVideoScanner.js.map +1 -0
  78. package/dist/esm/index.js +93 -0
  79. package/dist/esm/index.js.map +1 -0
  80. package/dist/esm/processors/detectionProcessor.js +121 -0
  81. package/dist/esm/processors/detectionProcessor.js.map +1 -0
  82. package/dist/esm/processors/index.js +7 -0
  83. package/dist/esm/processors/index.js.map +1 -0
  84. package/dist/esm/processors/tfliteFrameProcessor.js +292 -0
  85. package/dist/esm/processors/tfliteFrameProcessor.js.map +1 -0
  86. package/dist/esm/types/barcode.js +17 -0
  87. package/dist/esm/types/barcode.js.map +1 -0
  88. package/dist/esm/types/detection.js +8 -0
  89. package/dist/esm/types/detection.js.map +1 -0
  90. package/dist/esm/types/index.js +10 -0
  91. package/dist/esm/types/index.js.map +1 -0
  92. package/dist/esm/types/ocr.js +8 -0
  93. package/dist/esm/types/ocr.js.map +1 -0
  94. package/dist/esm/utils/imagePreprocessor.js +268 -0
  95. package/dist/esm/utils/imagePreprocessor.js.map +1 -0
  96. package/dist/esm/utils/logger.js +94 -0
  97. package/dist/esm/utils/logger.js.map +1 -0
  98. package/dist/esm/utils/yoloProcessor.js +151 -0
  99. package/dist/esm/utils/yoloProcessor.js.map +1 -0
  100. package/dist/{components → types/components}/DetectionOverlay.d.ts +1 -0
  101. package/dist/types/components/DetectionOverlay.d.ts.map +1 -0
  102. package/dist/{components → types/components}/index.d.ts +1 -0
  103. package/dist/types/components/index.d.ts.map +1 -0
  104. package/dist/{core → types/core}/CacheManager.d.ts +1 -0
  105. package/dist/types/core/CacheManager.d.ts.map +1 -0
  106. package/dist/{core → types/core}/MLVisionProvider.d.ts +1 -0
  107. package/dist/types/core/MLVisionProvider.d.ts.map +1 -0
  108. package/dist/{core → types/core}/ServerClient.d.ts +1 -0
  109. package/dist/types/core/ServerClient.d.ts.map +1 -0
  110. package/dist/{core → types/core}/index.d.ts +1 -0
  111. package/dist/types/core/index.d.ts.map +1 -0
  112. package/dist/{hooks → types/hooks}/classLabels.d.ts +1 -0
  113. package/dist/types/hooks/classLabels.d.ts.map +1 -0
  114. package/dist/{hooks → types/hooks}/classLabelsCoco.d.ts +1 -0
  115. package/dist/types/hooks/classLabelsCoco.d.ts.map +1 -0
  116. package/dist/{hooks → types/hooks}/index.d.ts +1 -0
  117. package/dist/types/hooks/index.d.ts.map +1 -0
  118. package/dist/{hooks → types/hooks}/useMultiBarcodeScanner.d.ts +1 -0
  119. package/dist/types/hooks/useMultiBarcodeScanner.d.ts.map +1 -0
  120. package/dist/{hooks → types/hooks}/useProductDetector.d.ts +1 -0
  121. package/dist/types/hooks/useProductDetector.d.ts.map +1 -0
  122. package/dist/{hooks → types/hooks}/useReceiptScanner.d.ts +2 -1
  123. package/dist/types/hooks/useReceiptScanner.d.ts.map +1 -0
  124. package/dist/{hooks → types/hooks}/useVideoScanner.d.ts +1 -0
  125. package/dist/types/hooks/useVideoScanner.d.ts.map +1 -0
  126. package/dist/types/index.d.ts +58 -124
  127. package/dist/types/index.d.ts.map +1 -0
  128. package/dist/{processors → types/processors}/detectionProcessor.d.ts +1 -0
  129. package/dist/types/processors/detectionProcessor.d.ts.map +1 -0
  130. package/dist/{processors → types/processors}/index.d.ts +1 -0
  131. package/dist/types/processors/index.d.ts.map +1 -0
  132. package/dist/{processors → types/processors}/tfliteFrameProcessor.d.ts +5 -4
  133. package/dist/types/processors/tfliteFrameProcessor.d.ts.map +1 -0
  134. package/dist/types/{barcode.d.ts → types/barcode.d.ts} +1 -0
  135. package/dist/types/types/barcode.d.ts.map +1 -0
  136. package/dist/types/{detection.d.ts → types/detection.d.ts} +1 -0
  137. package/dist/types/types/detection.d.ts.map +1 -0
  138. package/dist/types/types/index.d.ts +127 -0
  139. package/dist/types/types/index.d.ts.map +1 -0
  140. package/dist/types/{ocr.d.ts → types/ocr.d.ts} +1 -0
  141. package/dist/types/types/ocr.d.ts.map +1 -0
  142. package/dist/{utils → types/utils}/imagePreprocessor.d.ts +1 -0
  143. package/dist/types/utils/imagePreprocessor.d.ts.map +1 -0
  144. package/dist/types/utils/logger.d.ts +52 -0
  145. package/dist/types/utils/logger.d.ts.map +1 -0
  146. package/dist/{utils → types/utils}/yoloProcessor.d.ts +1 -0
  147. package/dist/types/utils/yoloProcessor.d.ts.map +1 -0
  148. package/package.json +62 -21
  149. package/dist/index.d.ts +0 -58
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Logger utility for @souscheflabs/ml-vision
3
+ *
4
+ * Provides configurable logging with different levels.
5
+ * In production, set LOG_LEVEL to 'none' or 'error' to reduce noise.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { logger, setLogLevel } from './utils/logger';
10
+ *
11
+ * // Set log level (default: 'warn' in production, 'debug' in development)
12
+ * setLogLevel('debug');
13
+ *
14
+ * // Use logger
15
+ * logger.debug('Detailed info for debugging');
16
+ * logger.info('General information');
17
+ * logger.warn('Warning message');
18
+ * logger.error('Error occurred', error);
19
+ * ```
20
+ */
21
+ const LOG_LEVELS = {
22
+ debug: 0,
23
+ info: 1,
24
+ warn: 2,
25
+ error: 3,
26
+ none: 4,
27
+ };
28
+ // Default to 'warn' in production, 'debug' in development
29
+ let currentLevel = __DEV__ ? 'debug' : 'warn';
30
+ /**
31
+ * Set the current log level
32
+ */
33
+ export function setLogLevel(level) {
34
+ currentLevel = level;
35
+ }
36
+ /**
37
+ * Get the current log level
38
+ */
39
+ export function getLogLevel() {
40
+ return currentLevel;
41
+ }
42
+ /**
43
+ * Check if a log level should be printed
44
+ */
45
+ function shouldLog(level) {
46
+ return LOG_LEVELS[level] >= LOG_LEVELS[currentLevel];
47
+ }
48
+ /**
49
+ * Format log message with prefix
50
+ */
51
+ function formatMessage(prefix, message) {
52
+ return `[MLVision:${prefix}] ${message}`;
53
+ }
54
+ /**
55
+ * Logger instance with configurable levels
56
+ */
57
+ export const logger = {
58
+ /**
59
+ * Debug level - detailed information for debugging
60
+ */
61
+ debug(message, ...args) {
62
+ if (shouldLog('debug')) {
63
+ // eslint-disable-next-line no-console
64
+ console.log(formatMessage('DEBUG', message), ...args);
65
+ }
66
+ },
67
+ /**
68
+ * Info level - general information
69
+ */
70
+ info(message, ...args) {
71
+ if (shouldLog('info')) {
72
+ // eslint-disable-next-line no-console
73
+ console.log(formatMessage('INFO', message), ...args);
74
+ }
75
+ },
76
+ /**
77
+ * Warn level - warning messages
78
+ */
79
+ warn(message, ...args) {
80
+ if (shouldLog('warn')) {
81
+ console.warn(formatMessage('WARN', message), ...args);
82
+ }
83
+ },
84
+ /**
85
+ * Error level - error messages
86
+ */
87
+ error(message, ...args) {
88
+ if (shouldLog('error')) {
89
+ console.error(formatMessage('ERROR', message), ...args);
90
+ }
91
+ },
92
+ };
93
+ export default logger;
94
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,MAAM,UAAU,GAA6B;IAC3C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,0DAA0D;AAC1D,IAAI,YAAY,GAAa,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,WAAW,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,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * YOLO Output Processor
3
+ *
4
+ * Processes raw YOLOv8 TFLite model output into detection results.
5
+ * YOLOv8 output format: [1, 84, 8400] where:
6
+ * - 84 = 4 (bbox) + 80 (class scores for COCO)
7
+ * - 8400 = number of predictions (from 3 detection heads)
8
+ *
9
+ * For custom models with N classes: [1, 4+N, 8400]
10
+ */
11
+ /**
12
+ * Process YOLOv8 model output into detections
13
+ *
14
+ * @param output Raw model output as Float32Array
15
+ * @param numClasses Number of classes in the model
16
+ * @param confThreshold Minimum confidence threshold (0-1)
17
+ * @param iouThreshold IoU threshold for NMS (0-1)
18
+ * @returns Array of processed detections
19
+ */
20
+ export function processYoloOutput(output, numClasses, confThreshold = 0.25, iouThreshold = 0.45) {
21
+ // YOLOv8 output shape: [1, 4+numClasses, 8400]
22
+ // We need to transpose to [8400, 4+numClasses] for easier processing
23
+ const numPredictions = 8400;
24
+ // Note: numOutputs = 4 + numClasses (4 bbox coords + class scores)
25
+ // Extract raw detections above confidence threshold
26
+ const rawDetections = [];
27
+ for (let i = 0; i < numPredictions; i++) {
28
+ // Find the class with highest score
29
+ let maxScore = 0;
30
+ let maxClassIdx = 0;
31
+ for (let c = 0; c < numClasses; c++) {
32
+ // Output is in format [1, 84, 8400], so index is: (4 + c) * 8400 + i
33
+ const score = output[(4 + c) * numPredictions + i];
34
+ if (score > maxScore) {
35
+ maxScore = score;
36
+ maxClassIdx = c;
37
+ }
38
+ }
39
+ if (maxScore >= confThreshold) {
40
+ // Extract bounding box (center x, center y, width, height)
41
+ const cx = output[0 * numPredictions + i];
42
+ const cy = output[1 * numPredictions + i];
43
+ const w = output[2 * numPredictions + i];
44
+ const h = output[3 * numPredictions + i];
45
+ rawDetections.push({
46
+ x: cx,
47
+ y: cy,
48
+ width: w,
49
+ height: h,
50
+ classIndex: maxClassIdx,
51
+ confidence: maxScore,
52
+ });
53
+ }
54
+ }
55
+ // Apply Non-Maximum Suppression
56
+ const nmsDetections = nonMaxSuppression(rawDetections, iouThreshold);
57
+ // Convert from center format to corner format
58
+ return nmsDetections.map((det) => ({
59
+ x: Math.max(0, det.x - det.width / 2),
60
+ y: Math.max(0, det.y - det.height / 2),
61
+ width: det.width,
62
+ height: det.height,
63
+ classIndex: det.classIndex,
64
+ confidence: det.confidence,
65
+ }));
66
+ }
67
+ /**
68
+ * Non-Maximum Suppression to remove overlapping detections
69
+ */
70
+ function nonMaxSuppression(detections, iouThreshold) {
71
+ if (detections.length === 0)
72
+ return [];
73
+ // Sort by confidence (highest first)
74
+ const sorted = [...detections].sort((a, b) => b.confidence - a.confidence);
75
+ const kept = [];
76
+ const suppressed = new Set();
77
+ for (let i = 0; i < sorted.length; i++) {
78
+ if (suppressed.has(i))
79
+ continue;
80
+ const current = sorted[i];
81
+ kept.push(current);
82
+ // Suppress overlapping detections of the same class
83
+ for (let j = i + 1; j < sorted.length; j++) {
84
+ if (suppressed.has(j))
85
+ continue;
86
+ const other = sorted[j];
87
+ // Only suppress same class
88
+ if (current.classIndex !== other.classIndex)
89
+ continue;
90
+ const iou = calculateIoU(current, other);
91
+ if (iou > iouThreshold) {
92
+ suppressed.add(j);
93
+ }
94
+ }
95
+ }
96
+ return kept;
97
+ }
98
+ /**
99
+ * Calculate Intersection over Union between two boxes
100
+ * Boxes are in center format (cx, cy, w, h)
101
+ */
102
+ function calculateIoU(box1, box2) {
103
+ // Convert to corner format
104
+ const x1_min = box1.x - box1.width / 2;
105
+ const y1_min = box1.y - box1.height / 2;
106
+ const x1_max = box1.x + box1.width / 2;
107
+ const y1_max = box1.y + box1.height / 2;
108
+ const x2_min = box2.x - box2.width / 2;
109
+ const y2_min = box2.y - box2.height / 2;
110
+ const x2_max = box2.x + box2.width / 2;
111
+ const y2_max = box2.y + box2.height / 2;
112
+ // Calculate intersection
113
+ const intersect_x_min = Math.max(x1_min, x2_min);
114
+ const intersect_y_min = Math.max(y1_min, y2_min);
115
+ const intersect_x_max = Math.min(x1_max, x2_max);
116
+ const intersect_y_max = Math.min(y1_max, y2_max);
117
+ const intersect_width = Math.max(0, intersect_x_max - intersect_x_min);
118
+ const intersect_height = Math.max(0, intersect_y_max - intersect_y_min);
119
+ const intersect_area = intersect_width * intersect_height;
120
+ // Calculate union
121
+ const area1 = box1.width * box1.height;
122
+ const area2 = box2.width * box2.height;
123
+ const union_area = area1 + area2 - intersect_area;
124
+ if (union_area === 0)
125
+ return 0;
126
+ return intersect_area / union_area;
127
+ }
128
+ /**
129
+ * Scale detection coordinates to actual image dimensions
130
+ */
131
+ export function scaleDetections(detections, modelSize, imageWidth, imageHeight) {
132
+ // The model was trained on square images, so we need to account for letterboxing
133
+ const scale = Math.min(modelSize / imageWidth, modelSize / imageHeight);
134
+ const padX = (modelSize - imageWidth * scale) / 2;
135
+ const padY = (modelSize - imageHeight * scale) / 2;
136
+ return detections.map((det) => {
137
+ // Remove padding and scale back to original image dimensions
138
+ const x = (det.x * modelSize - padX) / scale / imageWidth;
139
+ const y = (det.y * modelSize - padY) / scale / imageHeight;
140
+ const w = (det.width * modelSize) / scale / imageWidth;
141
+ const h = (det.height * modelSize) / scale / imageHeight;
142
+ return {
143
+ ...det,
144
+ x: Math.max(0, Math.min(1, x)),
145
+ y: Math.max(0, Math.min(1, y)),
146
+ width: Math.max(0, Math.min(1 - x, w)),
147
+ height: Math.max(0, Math.min(1 - y, h)),
148
+ };
149
+ });
150
+ }
151
+ //# sourceMappingURL=yoloProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yoloProcessor.js","sourceRoot":"","sources":["../../../src/utils/yoloProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAoB,EACpB,UAAkB,EAClB,gBAAwB,IAAI,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*/
56
56
  export declare function DetectionLoadingOverlay(): React.ReactElement;
57
57
  export default DetectionOverlay;
58
+ //# sourceMappingURL=DetectionOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetectionOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/DetectionOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMxE,MAAM,WAAW,qBAAqB;IACpC,4CAA4C;IAC5C,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,gCAAgC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kCAAkC;IAClC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAChE;AAwBD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,UAAU,EAAE,WAAW,EACvB,WAAW,EAAE,YAAY,EACzB,cAAqB,EACrB,SAAgB,EAChB,aAAiB,EACjB,cAAmB,EACnB,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAyD5C;AAmCD;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,KAAK,CAAC,YAAY,CAQ5D;AAsBD,eAAe,gBAAgB,CAAC"}
@@ -2,3 +2,4 @@
2
2
  * Components exports
3
3
  */
4
4
  export { DetectionOverlay, DetectionLoadingOverlay, type DetectionOverlayProps, } from './DetectionOverlay';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC"}
@@ -166,3 +166,4 @@ export declare class CacheManager {
166
166
  */
167
167
  export declare function createCacheManager(storage: MMKV, customTTL?: Partial<typeof CACHE_TTL>): CacheManager;
168
168
  export {};
169
+ //# sourceMappingURL=CacheManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../../src/core/CacheManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAMlB;;GAEG;AACH,eAAO,MAAM,SAAS;IACpB,+BAA+B;;IAE/B,qCAAqC;;IAErC,+BAA+B;;IAE/B,8CAA8C;;IAE9C,mCAAmC;;CAE3B,CAAC;AAEX;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;CAMR,CAAC;AAMX;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,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,CAAC,GAAG,IAAI;IAK1E;;OAEG;IACH,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAiBxE;;OAEG;IACH,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAKzC;;OAEG;IACH,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;IAiB7C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAiCxB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAYhB;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,OAAO,YAAY,GAAG,IAAI;IAUlD;;OAEG;IACH,QAAQ,IAAI,UAAU;IAmCtB;;OAEG;IACH,OAAO,CAAC,SAAS;CAIlB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,IAAI,EACb,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,SAAS,CAAC,GACpC,YAAY,CAEd"}
@@ -88,3 +88,4 @@ export declare function useMLVisionContext(): MLVisionContextValue;
88
88
  * Returns false if used outside provider (won't throw)
89
89
  */
90
90
  export declare function useMLVisionReady(): boolean;
91
+ //# sourceMappingURL=MLVisionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MLVisionProvider.d.ts","sourceRoot":"","sources":["../../../src/core/MLVisionProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAsB,M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AG1C"}
@@ -129,3 +129,4 @@ export declare class ServerClient {
129
129
  * Create a ServerClient instance
130
130
  */
131
131
  export declare function createServerClient(baseUrl: string, timeout?: number): ServerClient;
132
+ //# sourceMappingURL=ServerClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerClient.d.ts","sourceRoot":"","sources":["../../../src/core/ServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAOlB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,E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AiB,GAC1B,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAgB7C;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;OAEG;YACW,OAAO;IAkErB;;OAEG;YACW,eAAe;CA8D9B;AAMD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,YAAY,CAEd"}
@@ -4,3 +4,4 @@
4
4
  export { MLVisionProvider, useMLVisionContext, useMLVisionReady, type MLVisionProviderProps, type MLVisionContextValue, } from './MLVisionProvider';
5
5
  export { CacheManager, createCacheManager, CACHE_TTL, type CachedBarcodeLookup, type CachedProductRecognition, } from './CacheManager';
6
6
  export { ServerClient, createServerClient, ServerError, type ServerRequestOptions, type ImageUploadData, type DetectionRequestOptions, type OCRRequestOptions, } from './ServerClient';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
@@ -33,3 +33,4 @@ export declare function getLabelsArray(): string[];
33
33
  */
34
34
  export declare const CATEGORY_CLASSES: Record<ProductCategory, number[]>;
35
35
  export { categorizeLabel };
36
+ //# sourceMappingURL=classLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classLabels.d.ts","sourceRoot":"","sources":["../../../src/hooks/classLabels.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE/D;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAuHvD;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,aA0O1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAOA;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAMzC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAkC9D,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -41,3 +41,4 @@ export declare function isFoodClass(classIndex: number): boolean;
41
41
  * Get all COCO labels as an array
42
42
  */
43
43
  export declare function getCocoLabelsArray(): string[];
44
+ //# sourceMappingURL=classLabelsCoco.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classLabelsCoco.d.ts","sourceRoot":"","sources":["../../../src/hooks/classLabelsCoco.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,YAAY,w2BAaf,CAAC;AA+BX;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAK/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAA2C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,qBAAqB,UAAuD,CAAC;AAE1F;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAMA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
@@ -6,3 +6,4 @@ export { useMultiBarcodeScanner, default as useMultiBarcodeScannerDefault } from
6
6
  export { useReceiptScanner, default as useReceiptScannerDefault } from './useReceiptScanner';
7
7
  export { useVideoScanner, default as useVideoScannerDefault, type ScanMode, type VideoScanResult, type UseVideoScannerOptions, type UseVideoScannerReturn, } from './useVideoScanner';
8
8
  export { CLASS_LABELS, NUM_CLASSES, getClassInfo, getLabelsArray, CATEGORY_CLASSES } from './classLabels';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,eAAe,EACf,OAAO,IAAI,sBAAsB,EACjC,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -32,3 +32,4 @@ import type { UseMultiBarcodeScannerOptions, UseMultiBarcodeScannerReturn } from
32
32
  */
33
33
  export declare function useMultiBarcodeScanner(options?: UseMultiBarcodeScannerOptions): UseMultiBarcodeScannerReturn;
34
34
  export default useMultiBarcodeScanner;
35
+ //# sourceMappingURL=useMultiBarcodeScanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMultiBarcodeScanner.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMultiBarcodeScanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAI7B,MAAM,UAAU,CAAC;AAmBlB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,6BAAkC,GAC1C,4BAA4B,CA4N9B;AA2ED,eAAe,sBAAsB,CAAC"}
@@ -36,3 +36,4 @@ import type { UseProductDetectorOptions, UseProductDetectorReturn } from '../typ
36
36
  */
37
37
  export declare function useProductDetector(options?: UseProductDetectorOptions): UseProductDetectorReturn;
38
38
  export default useProductDetector;
39
+ //# sourceMappingURL=useProductDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProductDetector.d.ts","sourceRoot":"","sources":["../../../src/hooks/useProductDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EAEzB,MAAM,UAAU,CAAC;AA6TlB;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CA0iB1B;AAED,eAAe,kBAAkB,CAAC"}
@@ -29,9 +29,10 @@
29
29
  * }
30
30
  * ```
31
31
  */
32
- import type { UseReceiptScannerOptions, UseReceiptScannerReturn } from '../types';
32
+ import type { UseReceiptScannerOptions, UseReceiptScannerReturn } from "../types";
33
33
  /**
34
34
  * Hook for receipt scanning and parsing
35
35
  */
36
36
  export declare function useReceiptScanner(options?: UseReceiptScannerOptions): UseReceiptScannerReturn;
37
37
  export default useReceiptScanner;
38
+ //# sourceMappingURL=useReceiptScanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReceiptScanner.d.ts","sourceRoot":"","sources":["../../../src/hooks/useReceiptScanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EAMxB,MAAM,UAAU,CAAC;AA2ClB;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CAmZzB;AAED,eAAe,iBAAiB,CAAC"}
@@ -116,3 +116,4 @@ export interface UseVideoScannerReturn {
116
116
  */
117
117
  export declare function useVideoScanner(options?: UseVideoScannerOptions): UseVideoScannerReturn;
118
118
  export default useVideoScanner;
119
+ //# sourceMappingURL=useVideoScanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVideoScanner.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVideoScanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EAChB,MAAM,UAAU,CAAC;AAelB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACn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,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,0CAA0C;IAC1C,eAAe,EAAE,MAAM,CAAC;IAGxB,2BAA2B;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,0BAA0B;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,sBAAsB;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,2BAA2B;IAC3B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,qCAAqC;IACrC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAG3C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAG1C,oBAAoB,EAAE,OAAO,CAAC;IAG9B,2EAA2E;IAC3E,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACtD;AAcD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAsZvB;AAED,eAAe,eAAe,CAAC"}
@@ -1,126 +1,60 @@
1
1
  /**
2
- * @souschef/ml-vision Type Definitions
2
+ * @souschef/ml-vision
3
3
  *
4
- * Core types for the ML Vision package. These types are designed to be
5
- * compatible with your existing Sous Chef app patterns.
6
- */
7
- export * from './barcode';
8
- export * from './detection';
9
- export * from './ocr';
10
- /**
11
- * Configuration for the MLVisionProvider
12
- */
13
- export interface MLVisionConfig {
14
- /** URL for the ML inference server (your Docker server) */
15
- serverUrl?: string;
16
- /** Timeout for server requests in milliseconds (default: 5000) */
17
- serverTimeout?: number;
18
- /** Enable MMKV caching for results (default: true) */
19
- cacheEnabled?: boolean;
20
- /** Cache TTL in milliseconds (default: 24 hours) */
21
- cacheTTL?: number;
22
- /** Check for model updates on app start (default: true) */
23
- modelUpdateCheck?: boolean;
24
- /** Enable GPU delegates for on-device inference (default: true) */
25
- enableGPUDelegate?: boolean;
26
- }
27
- /**
28
- * Bounding box for detected items
29
- */
30
- export interface BoundingBox {
31
- /** X coordinate (0-1 normalized) */
32
- x: number;
33
- /** Y coordinate (0-1 normalized) */
34
- y: number;
35
- /** Width (0-1 normalized) */
36
- width: number;
37
- /** Height (0-1 normalized) */
38
- height: number;
39
- /** Rotation in degrees (optional) */
40
- rotation?: number;
41
- }
42
- /**
43
- * Base detection result that all specific results extend
44
- */
45
- export interface BaseDetectionResult {
46
- /** Unique identifier for this detection */
47
- id: string;
48
- /** Confidence score (0-1) */
49
- confidence: number;
50
- /** Bounding box in the image */
51
- boundingBox?: BoundingBox;
52
- /** Whether this was processed on-device or via server */
53
- source: 'on_device' | 'server';
54
- /** Processing time in milliseconds */
55
- processingTimeMs: number;
56
- /** Timestamp of detection */
57
- timestamp: number;
58
- }
59
- /**
60
- * Information about a loaded ML model
61
- */
62
- export interface ModelInfo {
63
- /** Model identifier */
64
- id: string;
65
- /** Human-readable name */
66
- name: string;
67
- /** Semantic version */
68
- version: string;
69
- /** File size in bytes */
70
- sizeBytes: number;
71
- /** When the model was last updated */
72
- lastUpdated: Date;
73
- /** Model type */
74
- type: 'detection' | 'classification' | 'ocr';
75
- /** Whether the model is currently loaded */
76
- isLoaded: boolean;
77
- }
78
- /**
79
- * Model download progress
80
- */
81
- export interface ModelDownloadProgress {
82
- modelId: string;
83
- bytesDownloaded: number;
84
- totalBytes: number;
85
- progress: number;
86
- }
87
- /**
88
- * Cache entry wrapper
89
- */
90
- export interface CacheEntry<T> {
91
- data: T;
92
- timestamp: number;
93
- ttl: number;
94
- }
95
- /**
96
- * Cache statistics
97
- */
98
- export interface CacheStats {
99
- barcodeEntries: number;
100
- productEntries: number;
101
- receiptEntries: number;
102
- totalSizeBytes: number;
103
- }
104
- /**
105
- * Server health response
106
- */
107
- export interface ServerHealthResponse {
108
- status: 'healthy' | 'degraded' | 'unhealthy';
109
- version: string;
110
- models: {
111
- id: string;
112
- loaded: boolean;
113
- lastUsed?: string;
114
- }[];
115
- gpuAvailable: boolean;
116
- gpuMemoryUsed?: number;
117
- gpuMemoryTotal?: number;
118
- }
119
- /**
120
- * Server error response
121
- */
122
- export interface ServerErrorResponse {
123
- error: string;
124
- code: string;
125
- details?: Record<string, unknown>;
126
- }
4
+ * ML-powered product detection for React Native
5
+ *
6
+ * Features:
7
+ * - Multi-barcode scanning (scan multiple barcodes at once)
8
+ * - Receipt OCR (photograph receipts to extract items)
9
+ * - Visual product recognition (recognize fridge/pantry contents)
10
+ * - Video scanning (real-time product detection)
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import {
15
+ * MLVisionProvider,
16
+ * useMultiBarcodeScanner,
17
+ * useProductDetector,
18
+ * useReceiptScanner,
19
+ * } from '@souschef/ml-vision';
20
+ *
21
+ * // Wrap your app with the provider
22
+ * function App() {
23
+ * return (
24
+ * <MLVisionProvider
25
+ * config={{ serverUrl: 'http://192.168.1.100:8000' }}
26
+ * storage={mmkvInstance}
27
+ * >
28
+ * <YourApp />
29
+ * </MLVisionProvider>
30
+ * );
31
+ * }
32
+ *
33
+ * // Use hooks in your components
34
+ * function ScannerScreen() {
35
+ * const { scanPhoto, results } = useMultiBarcodeScanner();
36
+ * const { detectProducts, detections } = useProductDetector();
37
+ *
38
+ * // ...
39
+ * }
40
+ * ```
41
+ *
42
+ * @packageDocumentation
43
+ */
44
+ export type { MLVisionConfig, BoundingBox, BaseDetectionResult, ModelInfo, ModelDownloadProgress, CacheEntry, CacheStats, ServerHealthResponse, ServerErrorResponse, BarcodeFormat, BarcodeData, BarcodeDetectionResult, UseMultiBarcodeScannerOptions, UseMultiBarcodeScannerReturn, BarcodeCacheEntry, ProductCategory, ProduceType, ProduceQuality, ProductData, ProductMatch, ProduceData, ProductDetectionResult, DetectionModel, UseProductDetectorOptions, UseProductDetectorReturn, TFLiteDetectionOutput, ClassLabelMap, TextLine, TextBlock, TextRecognitionResult, ReceiptItem, ReceiptMetadata, ReceiptScanResult, KnownStore, UseReceiptScannerOptions, UseReceiptScannerReturn, ReceiptLineType, ParsedReceiptLine, } from './types';
45
+ export { GROCERY_BARCODE_FORMATS } from './types/barcode';
46
+ export { MLVisionProvider, useMLVisionContext, useMLVisionReady, type MLVisionProviderProps, type MLVisionContextValue, CacheManager, createCacheManager, CACHE_TTL, type CachedBarcodeLookup, type CachedProductRecognition, ServerClient, createServerClient, ServerError, type ServerRequestOptions, type ImageUploadData, type DetectionRequestOptions, type OCRRequestOptions, } from './core';
47
+ export { useProductDetector } from './hooks/useProductDetector';
48
+ export { CLASS_LABELS, NUM_CLASSES, getClassInfo, getLabelsArray, CATEGORY_CLASSES, } from './hooks/classLabels';
49
+ export { useMultiBarcodeScanner } from './hooks/useMultiBarcodeScanner';
50
+ export { useReceiptScanner } from './hooks/useReceiptScanner';
51
+ export { useVideoScanner, type ScanMode, type VideoScanResult, type UseVideoScannerOptions, type UseVideoScannerReturn, } from './hooks/useVideoScanner';
52
+ export { DetectionOverlay, DetectionLoadingOverlay, type DetectionOverlayProps, } from './components';
53
+ export { createDetectionProcessor, frameDetectionToResult, getClassLabel, type FrameDetection, type DetectionProcessorOptions, } from './processors';
54
+ export { useTFLiteFrameProcessor, createTFLiteFrameProcessor, type TFLiteFrameDetection, type FrameProcessorResult, type UseTFLiteFrameProcessorOptions, } from './processors';
55
+ export { preprocessImage, isSkiaAvailable, isResizePluginAvailable, getFrameProcessorInstructions, } from './utils/imagePreprocessor';
56
+ export { processYoloOutput, scaleDetections, } from './utils/yoloProcessor';
57
+ export { COCO_CLASSES, CLASS_LABELS_COCO, NUM_CLASSES_COCO, FOOD_CLASS_INDICES, getCocoClassInfo, isFoodClass, } from './hooks/classLabelsCoco';
58
+ export { logger, setLogLevel, getLogLevel, type LogLevel, } from './utils/logger';
59
+ export declare const VERSION = "0.1.1";
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],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G9D,OAAO,EACL,eAAe,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AAMtB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,GACpC,MAAM,cAAc,CAAC;AAOtB,OAAO,EACL,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,KAAK,QAAQ,GACd,MAAM,gBAAgB,CAAC;AAMxB,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -84,3 +84,4 @@ export declare function frameDetectionToResult(detection: FrameDetection, imageW
84
84
  */
85
85
  export declare function getClassLabel(classIndex: number): string;
86
86
  export { NUM_CLASSES, CLASS_LABELS };
87
+ //# sourceMappingURL=detectionProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detectionProcessor.d.ts","sourceRoot":"","sources":["../../../src/processors/detectionProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,GAAG,EAAE;QACH,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAYD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,yBAA8B,IAW5E,QAAQ,OAAO,KACd,cAAc,EAAE,CAoBpB;AAMD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,sBAAsB,CA4BxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAExD;AAMD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
@@ -3,3 +3,4 @@
3
3
  */
4
4
  export { createDetectionProcessor, frameDetectionToResult, getClassLabel, NUM_CLASSES, CLASS_LABELS, type FrameDetection, type DetectionProcessorOptions, } from './detectionProcessor';
5
5
  export { useTFLiteFrameProcessor, createTFLiteFrameProcessor, type FrameDetection as TFLiteFrameDetection, type FrameProcessorResult, type UseTFLiteFrameProcessorOptions, } from './tfliteFrameProcessor';
6
+ //# sourceMappingURL=index.d.ts.map