feat: enhance layout preprocessing and unify image scaling proposal
Backend changes: - Add image scaling configuration for PP-Structure processing - Enhance layout preprocessing service with scaling support - Update OCR service with improved memory management - Add PP-Structure enhanced processing improvements Frontend changes: - Update preprocessing settings UI - Fix processing page layout and state management - Update API types for new parameters Proposals: - Archive add-layout-preprocessing proposal (completed) - Add unify-image-scaling proposal for consistent coordinate handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -382,23 +382,49 @@ export default function ProcessingPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Direct Track Notice - Show when document is editable PDF */}
|
||||
{documentAnalysis && documentAnalysis.recommended_track === 'direct' && (
|
||||
<Card className="border-blue-200 bg-blue-50">
|
||||
{/* Document Analysis Info */}
|
||||
{documentAnalysis && (
|
||||
<Card className={documentAnalysis.recommended_track === 'direct' ? 'border-blue-200 bg-blue-50' : 'border-green-200 bg-green-50'}>
|
||||
<CardContent className="pt-4">
|
||||
<div className="flex items-start gap-3">
|
||||
<Info className="w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5" />
|
||||
<div>
|
||||
<p className="text-sm font-medium text-blue-800">此文件為可編輯 PDF</p>
|
||||
<p className="text-sm text-blue-700 mt-1">
|
||||
系統偵測到此 PDF 包含文字圖層,將使用直接文字提取方式處理。
|
||||
版面偵測和影像前處理設定不適用於此類文件。
|
||||
</p>
|
||||
{documentAnalysis.text_coverage && (
|
||||
<p className="text-xs text-blue-600 mt-2">
|
||||
文字覆蓋率: {(documentAnalysis.text_coverage * 100).toFixed(1)}%
|
||||
</p>
|
||||
<Info className={`w-5 h-5 flex-shrink-0 mt-0.5 ${documentAnalysis.recommended_track === 'direct' ? 'text-blue-600' : 'text-green-600'}`} />
|
||||
<div className="flex-1">
|
||||
{documentAnalysis.recommended_track === 'direct' ? (
|
||||
<>
|
||||
<p className="text-sm font-medium text-blue-800">此文件為可編輯 PDF</p>
|
||||
<p className="text-sm text-blue-700 mt-1">
|
||||
系統偵測到此 PDF 包含文字圖層,將使用直接文字提取方式處理。
|
||||
版面偵測和影像前處理設定不適用於此類文件。
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p className="text-sm font-medium text-green-800">
|
||||
{documentAnalysis.is_editable ? '混合文件' : '掃描文件 / 影像'}
|
||||
</p>
|
||||
<p className="text-sm text-green-700 mt-1">
|
||||
{documentAnalysis.reason}
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-4 mt-2 text-xs">
|
||||
<span className={documentAnalysis.recommended_track === 'direct' ? 'text-blue-600' : 'text-green-600'}>
|
||||
處理方式: {documentAnalysis.recommended_track === 'direct' ? '直接提取' : documentAnalysis.recommended_track === 'ocr' ? 'OCR 識別' : '混合處理'}
|
||||
</span>
|
||||
{documentAnalysis.page_count && (
|
||||
<span className={documentAnalysis.recommended_track === 'direct' ? 'text-blue-600' : 'text-green-600'}>
|
||||
頁數: {documentAnalysis.page_count}
|
||||
</span>
|
||||
)}
|
||||
{documentAnalysis.text_coverage !== null && (
|
||||
<span className={documentAnalysis.recommended_track === 'direct' ? 'text-blue-600' : 'text-green-600'}>
|
||||
文字覆蓋率: {(documentAnalysis.text_coverage * 100).toFixed(1)}%
|
||||
</span>
|
||||
)}
|
||||
<span className={documentAnalysis.recommended_track === 'direct' ? 'text-blue-600' : 'text-green-600'}>
|
||||
信心度: {(documentAnalysis.confidence * 100).toFixed(0)}%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
Reference in New Issue
Block a user