Skip to content

Enhancement: Real-time Segmentation Metrics (Dice/IoU) #6

Description

@blayyyyyk

Description

As a user, I want to see Dice and IoU metrics displayed in the browser so that I can quantitatively evaluate the model's performance during the live presentation.

Acceptance Criteria

  • Load a ground-truth spleen mask alongside the base medical volume in the viewer.
  • Write a client-side JavaScript utility to calculate the Dice Coefficient between the SAM 3 prediction array and the ground-truth array.
  • Write a client-side JavaScript utility to calculate the Intersection over Union (IoU).
  • Create a UI element (e.g., a floating HTML panel overlaying the canvas) that automatically updates with these scores immediately after an inference pass completes.

Implementation Notes & Resources

  • Keep calculations strictly client-side by comparing the flattened 1D arrays of the ground truth and the prediction mask.
  • Dice Formula: (2 * overlap) / (total_pixels_mask1 + total_pixels_mask2)
  • IoU Formula: overlap / union

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions