Skip to content

Commit aeb81a2

Browse files
committed
Use explicit strings in Math
1 parent 13349ed commit aeb81a2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/metricLibrary.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { BlockMath, InlineMath } from 'react-katex';
3-
import 'katex/dist/katex.min.css';
43

54
export interface MetricDefinitionRich {
65
title: string;
@@ -16,12 +15,12 @@ export const METRIC_RICH_CONTENT: Record<string, MetricDefinitionRich> = {
1615
The Dice Coefficient <InlineMath math="DSC" /> is a statistical tool used to gauge the similarity of two samples. In image segmentation, it measures the overlap between the segmented mask (<InlineMath math="X" />) and the ground truth (<InlineMath math="Y" />).
1716
</p>
1817

19-
<BlockMath math="DSC = \\frac{2 |X \\cap Y|}{|X| + |Y|}" />
18+
<BlockMath math={String.raw`DSC = \frac{2 |X \cap Y|}{|X| + |Y|}`} />
2019

2120
<div style={{ background: '#f8fafc', padding: '1rem', borderRadius: '8px', border: '1px solid #e2e8f0', textAlign: 'center' }}>
2221
<h4>Confusion Matrix Formula</h4>
2322
<div style={{ display: 'flex', justifyContent: 'center', gap: '3em' }}>
24-
<BlockMath math="DSC = \\frac{2*TP}{2*TP + FP + FN}" />
23+
<BlockMath math={String.raw`DSC = \frac{2*TP}{2*TP + FP + FN}`} />
2524

2625
<div style={{ display: 'inline-flex', flexDirection: 'column', alignItems: 'center' }}>
2726
{/* Numerator */}
@@ -90,12 +89,12 @@ export const METRIC_RICH_CONTENT: Record<string, MetricDefinitionRich> = {
9089
The IoU <InlineMath math="IoU" /> is the standard metric for object detection and semantic segmentation challenges. It calculates the ratio of the intersection area to the union area of the two masks.
9190
</p>
9291

93-
<BlockMath math="IoU = \frac{\text{Area of Overlap}}{\text{Area of Union}} = \frac{|X \cap Y|}{|X \cup Y|}" />
92+
<BlockMath math={String.raw`IoU = \frac{\text{Area of Overlap}}{\text{Area of Union}} = \frac{|X \cap Y|}{|X \cup Y|}`} />
9493

9594
<div style={{ background: '#f8fafc', padding: '1rem', borderRadius: '8px', border: '1px solid #e2e8f0', textAlign: 'center' }}>
9695
<h4>Confusion Matrix Formula</h4>
9796
<div style={{ display: 'flex', justifyContent: 'center', gap: '3em' }}>
98-
<BlockMath math="IoU = \frac{TP}{TP + FP + FN}" />
97+
<BlockMath math={String.raw`IoU = \frac{TP}{TP + FP + FN}`} />
9998

10099
<div style={{ display: 'inline-flex', flexDirection: 'column', alignItems: 'center' }}>
101100
{/* Numerator */}

0 commit comments

Comments
 (0)