feat(ocr-pipeline): add column_ignore type for margins/empty areas
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,7 @@ export interface DewarpGroundTruth {
|
|||||||
|
|
||||||
export interface PageRegion {
|
export interface PageRegion {
|
||||||
type: 'column_en' | 'column_de' | 'column_example' | 'page_ref'
|
type: 'column_en' | 'column_de' | 'column_example' | 'page_ref'
|
||||||
| 'column_marker' | 'column_text' | 'header' | 'footer'
|
| 'column_marker' | 'column_text' | 'column_ignore' | 'header' | 'footer'
|
||||||
x: number
|
x: number
|
||||||
y: number
|
y: number
|
||||||
width: number
|
width: number
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const TYPE_COLORS: Record<string, string> = {
|
|||||||
column_text: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400',
|
column_text: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400',
|
||||||
page_ref: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
page_ref: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
||||||
column_marker: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400',
|
column_marker: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400',
|
||||||
|
column_ignore: 'bg-gray-100 text-gray-500 dark:bg-gray-700/30 dark:text-gray-500',
|
||||||
header: 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400',
|
header: 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400',
|
||||||
footer: 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400',
|
footer: 'bg-gray-100 text-gray-600 dark:bg-gray-700/50 dark:text-gray-400',
|
||||||
}
|
}
|
||||||
@@ -30,6 +31,7 @@ const TYPE_LABELS: Record<string, string> = {
|
|||||||
column_text: 'Text',
|
column_text: 'Text',
|
||||||
page_ref: 'Seite',
|
page_ref: 'Seite',
|
||||||
column_marker: 'Marker',
|
column_marker: 'Marker',
|
||||||
|
column_ignore: 'Ignorieren',
|
||||||
header: 'Header',
|
header: 'Header',
|
||||||
footer: 'Footer',
|
footer: 'Footer',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const COLUMN_TYPES: { value: ColumnTypeKey; label: string }[] = [
|
|||||||
{ value: 'column_text', label: 'Text' },
|
{ value: 'column_text', label: 'Text' },
|
||||||
{ value: 'page_ref', label: 'Seite' },
|
{ value: 'page_ref', label: 'Seite' },
|
||||||
{ value: 'column_marker', label: 'Marker' },
|
{ value: 'column_marker', label: 'Marker' },
|
||||||
|
{ value: 'column_ignore', label: 'Ignorieren' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const TYPE_OVERLAY_COLORS: Record<string, string> = {
|
const TYPE_OVERLAY_COLORS: Record<string, string> = {
|
||||||
@@ -19,6 +20,7 @@ const TYPE_OVERLAY_COLORS: Record<string, string> = {
|
|||||||
column_text: 'rgba(6, 182, 212, 0.12)',
|
column_text: 'rgba(6, 182, 212, 0.12)',
|
||||||
page_ref: 'rgba(168, 85, 247, 0.12)',
|
page_ref: 'rgba(168, 85, 247, 0.12)',
|
||||||
column_marker: 'rgba(239, 68, 68, 0.12)',
|
column_marker: 'rgba(239, 68, 68, 0.12)',
|
||||||
|
column_ignore: 'rgba(128, 128, 128, 0.06)',
|
||||||
}
|
}
|
||||||
|
|
||||||
const TYPE_BADGE_COLORS: Record<string, string> = {
|
const TYPE_BADGE_COLORS: Record<string, string> = {
|
||||||
@@ -28,6 +30,7 @@ const TYPE_BADGE_COLORS: Record<string, string> = {
|
|||||||
column_text: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400',
|
column_text: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400',
|
||||||
page_ref: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
page_ref: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
||||||
column_marker: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400',
|
column_marker: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400',
|
||||||
|
column_ignore: 'bg-gray-100 text-gray-500 dark:bg-gray-700/30 dark:text-gray-500',
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default column type sequence for newly created columns
|
// Default column type sequence for newly created columns
|
||||||
|
|||||||
@@ -753,6 +753,7 @@ async def _get_columns_overlay(session_id: str) -> Response:
|
|||||||
"column_text": (200, 200, 0), # Cyan/Turquoise
|
"column_text": (200, 200, 0), # Cyan/Turquoise
|
||||||
"page_ref": (200, 0, 200), # Purple
|
"page_ref": (200, 0, 200), # Purple
|
||||||
"column_marker": (0, 0, 220), # Red
|
"column_marker": (0, 0, 220), # Red
|
||||||
|
"column_ignore": (180, 180, 180), # Light Gray
|
||||||
"header": (128, 128, 128), # Gray
|
"header": (128, 128, 128), # Gray
|
||||||
"footer": (128, 128, 128), # Gray
|
"footer": (128, 128, 128), # Gray
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user