|
@@ -1,13 +1,13 @@
|
|
|
import { Injectable, OnModuleInit } from '@nestjs/common';
|
|
import { Injectable, OnModuleInit } from '@nestjs/common';
|
|
|
import * as onnx from 'onnxruntime-node';
|
|
import * as onnx from 'onnxruntime-node';
|
|
|
-import * as sharp from 'sharp';
|
|
|
|
|
|
|
+import sharp from 'sharp';
|
|
|
import * as path from 'path';
|
|
import * as path from 'path';
|
|
|
import { MPOB_CLASSES, HEALTH_ALERT_CLASSES } from '../constants/mpob-standards';
|
|
import { MPOB_CLASSES, HEALTH_ALERT_CLASSES } from '../constants/mpob-standards';
|
|
|
import { DetectionResult } from '../interfaces/palm-analysis.interface';
|
|
import { DetectionResult } from '../interfaces/palm-analysis.interface';
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
|
export class ScannerProvider implements OnModuleInit {
|
|
export class ScannerProvider implements OnModuleInit {
|
|
|
- private session: onnx.InferenceSession;
|
|
|
|
|
|
|
+ private session!: onnx.InferenceSession;
|
|
|
private readonly modelPath = path.join(process.cwd(), 'best.onnx');
|
|
private readonly modelPath = path.join(process.cwd(), 'best.onnx');
|
|
|
|
|
|
|
|
async onModuleInit() {
|
|
async onModuleInit() {
|