Summary - Today’s changes (what I did)

  • Added: logging_config.py - centralized logging; defaults to LOG_LEVEL=WARNING, writes full DEBUG to app.debug.log, mutes noisy libs and makes HTTP logs visible only in debug.
  • Updated: train.py - call configure_logging() early (before HF imports); fallback if missing; promoted key progress messages (epoch summaries, new-best, trial lines, tuning/complete summaries) from INFO → WARNING so they show on default terminal.
  • Updated: run.ps1 - added --debug flag; sets/passes LOG_LEVEL=DEBUG to enable HTTP/debug logs for local and HF jobs; prints log-level in summary.
  • Updated: PS1_USAGE.md - reordered examples (tune → train (no predict) → train + predict) and documented --debug with usage rationale.

Rationale

  • Reduce noisy HTTP/third-party INFO logs in normal runs while preserving full debug traces to a file.
  • Ensure important progress (epochs, new bests, tuning results) is visible by default.
  • Provide a simple flag (--debug) to enable verbose output when troubleshooting.

Current behavior / status

  • Normal runs show WARNING+ only (clean terminal) while key progress summaries remain visible.
  • Debug runs (--debug or LOG_LEVEL=DEBUG) show full HTTP/request logs and INFO/DEBUG output.
  • Jobs executed successfully (package installs, dataset downloads, and training split generation). The repeated “No files have been modified since last commit” messages are benign HF uploader info.

How to run

Quiet (default):

.\\run.ps1 train.py train --local    # Local
.\\run.ps1 train.py train            # HF job

Debug (show HTTP + verbose):

.\\run.ps1 train.py train --local --debug
.\\run.ps1 train.py train --debug

Inspect persisted debug file:

Get-Content app.debug.log -Tail 200

Potential next improvements (pick one)

  • Suppress HF uploader messages by redirecting hf stdout/stderr in run.ps1.
  • Make other in-code warnings (e.g., “Clearing train directory”) conditional on debug, or change to INFO.
  • Upload app.debug.log as a job artifact so logs are always downloadable independent of hf jobs logs.

Daily Work Report - 2026-03-09

Goal

Migrate frontend to SvelteKit and get full stack (SvelteKit + FastAPI) running; debug UX issues and dataset problems.

What I implemented

  • Scaffold & app files: Created SvelteKit frontend scaffold and app shell (configs, build): package.json, svelte.config.js, vite.config.ts, tsconfig.json, src/app.html.
  • Frontend features: Implemented stores, API client, utilities, components and routes (major files under src/lib and src/routes), including the main page and maintenance page.
  • Docker / compose: Added Dockerfile and updated docker-compose.yml to point at the SvelteKit frontend.
  • Build & deps: Resolved npm peer conflicts, installed deps, ran npx svelte-kit sync and npm run build - production build succeeded (client + server bundles produced).
  • .gitignore: Created .gitignore to exclude build artifacts and node_modules.

Issues found & resolved

  • Dataset images unreadable: Backend logged repeated PIL errors “cannot identify image file …”. Validator confirmed files under anana-dataset/faces were Git LFS pointer files, not binaries. Action: run git lfs pull (or install git-lfs) - images are now valid.
  • Tooltip UX bug: Hovered image always appeared at bottom-left.
    • Diagnosis: tooltip was statically positioned; ScatterPlot passed only data-space coords.
    • Fix: added screenX/screenY to TooltipData and updated:
      • src/lib/types/index.ts
      • src/lib/components/ScatterPlot.svelte
      • src/lib/components/PointTooltip.svelte
    • Result: tooltip follows cursor and flips to stay onscreen.
  • Toolbar alignment: Moved bottom-left buttons to centered bottom by editing src/routes/+page.svelte CSS (.toolbar and .dirty-indicator).

Commands I ran

Project build and checks:

npm install
npx svelte-kit sync
npm run build

Backend run / diagnostics:

python start_server.py
uvicorn backend.api:app --reload
python backend/scripts/validate_images.py
git lfs pull

Files changed (high level)

  • Frontend edits: types, components, routes, Dockerfile, .gitignore.
  • Backend: added diagnostic script validate_images.py (image validator).

Status

  • Backend: running; image-serving errors resolved after git lfs pull.
  • Frontend: built successfully; tooltip and toolbar UI fixes applied.
  • Docker compose updated; frontend Dockerfile added.

Next recommended steps

  • Commit changes (source + package-lock.json) and exclude build artifacts (node_modules, build/, .svelte-kit/).
  • Run end-to-end manual QA: hover tooltips, drag/save flow, maintenance page, audit log modal.
  • Optionally add small unit/visual tests for tooltip placement and responsive toolbar tweaks.
  • If desired, I can create a commit with these changes or open a PR.

Architecture & Strategy

  • Dynamic Data Binding: LegendGalleryApp pulls from vishal.csv and maps Photo_No to the faces/ directory. Implemented lazy-loading for the 2,864-image dataset.
  • Severity Mapping Logic: LEVEL_RANGES translates raw AutoML floats into human-readable categories (Level 0–3).
  • Medical Context Integration: Hardcoded REGION_DESCRIPTIONS (R_1 to R_9) provide immediate diagnostic context for clinicians.

2) Frontend Migration Strategy: React → SvelteKit

  • Konva Imperative Bridge: Use Konva’s native API inside Svelte’s onMount to bypass virtual-DOM overhead for smoother interactions.
  • State Management Overhaul: Migrate useRelabelState and useIterationState to Svelte writable/derived stores for global reactivity.
  • Proxy & Asset Security: Phase 1 plan includes a Vite proxy for /faces to avoid CORS and ensure secure image delivery from FastAPI.

3) Infrastructure & DevOps

  • PowerShell Execution Wrapper (run.ps1): Refactored to support uv experimental feature for Hugging Face jobs, enforce UTF-8, and pass complex Typer args for local/cloud runs.
  • Multi-Environment Deployment: Updated app.py launch_kwargs to keep Gradio secure and compatible with local file paths and deployed environments.

Current Project Status

Module Status Next milestone
Legend Gallery (L1) ✅ Complete Smoke test with fully synced data
Relabel Migration 📋 Phase 0 Scaffold SvelteKit & implement Konva PoC
Training Pipeline ✅ Stable Run full tunetrain on GPU flavor
Data Integrity ✅ Verified Validate orphaned images in faces/

Next Steps (Tomorrow)

  1. Initiate Phase 1 of the Svelte migration (scaffold + store setup).
  2. Pre-flight check on Legend Gallery to verify R-value → PNG mapping.
  3. Draft the side-by-side comparison UI for the Level 2 Gallery transition.

This site uses Just the Docs, a documentation theme for Jekyll.