Pārlūkot izejas kodu

feat: add FrameInspectorDialogComponent for visual detection analysis and implement AnalyzerComponent for batch inference management

Dr-Swopt 2 nedēļas atpakaļ
vecāks
revīzija
09924ece06

+ 0 - 2
src/src.palm.vision/analyzer/analyzer.component.ts

@@ -149,9 +149,7 @@ export class AnalyzerComponent implements OnInit, OnDestroy {
   resetScan(): void {
     this.stopCamera();
     this.activeBatchId = null;
-    this.currentFrame = null;
     this.batchFrames = [];
-    this.selectedFrameIndex = 0;
   }
 
   private submit(files: File[]): void {

+ 4 - 1
src/src.palm.vision/history/batch-report/frame-inspector-dialog.component.ts

@@ -203,10 +203,13 @@ export class FrameInspectorDialogComponent implements AfterViewInit {
 
     const img = new Image();
     img.onload = () => {
-      const maxW = Math.min(560, img.naturalWidth);
+      const containerW = canvas.parentElement?.clientWidth ?? 560;
+      const maxW = Math.min(containerW, img.naturalWidth);
       const scale = maxW / img.naturalWidth;
       canvas.width = img.naturalWidth * scale;
       canvas.height = img.naturalHeight * scale;
+      canvas.style.width = '100%';
+      canvas.style.height = 'auto';
       const ctx = canvas.getContext('2d')!;
       ctx.drawImage(img, 0, 0, canvas.width, canvas.height);