From c8e202dc8c16cde6770d68a9a2268310ff7fad08 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Fri, 20 Mar 2026 20:09:30 +0800 Subject: [PATCH] =?UTF-8?q?ci(workflows):=20=E4=BF=AE=E5=A4=8D=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=B8=AD=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=96=87=E4=BB=B6=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-test.yml | 32 ++++++++++++++++++++++++++++++- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++- requirement.txt | Bin 1600 -> 1600 bytes 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 773123f..809148a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -55,6 +55,36 @@ jobs: python -m pip install --upgrade pip pip install -r requirement.txt + - name: Copy ddddocr model files + run: | + $ddddocrPath = python -c "import ddddocr, os; print(os.path.dirname(ddddocr.__file__))" + Write-Host "ddddocr package location: $ddddocrPath" + + if (-not (Test-Path "models")) { + New-Item -ItemType Directory -Path "models" | Out-Null + Write-Host "✓ Created models directory" + } + + $onnxSource = Join-Path $ddddocrPath "common_old.onnx" + $onnxDest = "models/common_old.onnx" + if (Test-Path $onnxSource) { + Copy-Item $onnxSource $onnxDest -Force + Write-Host "✓ Copied ONNX model from: $onnxSource" + Write-Host "✓ ONNX model copied to: $onnxDest" + } else { + Write-Error "✗ ONNX model not found in ddddocr package: $onnxSource" + exit 1 + } + + if (Test-Path $onnxDest) { + $fileSize = (Get-Item $onnxDest).Length / 1MB + Write-Host "✓ Model file verified: $onnxDest (Size: $([math]::Round($fileSize, 2)) MB)" + } else { + Write-Error "✗ Failed to copy model file" + exit 1 + } + shell: pwsh + - name: Compile Qt Resource files run: | cd batchs @@ -84,7 +114,7 @@ jobs: " pathex=[]," " binaries=[]," " datas=[" - " ('models\\common.onnx', 'ddddocr')," + " ('models\\common_old.onnx', 'ddddocr')," " ('src\\gui\\resources\\icons\\AutoLibrary_32x32.ico', 'gui\\resources\\icons')," " ]," " hiddenimports=[]," diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02b826f..f54a2ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,36 @@ jobs: python -m pip install --upgrade pip pip install -r requirement.txt + - name: Copy ddddocr model files + run: | + $ddddocrPath = python -c "import ddddocr, os; print(os.path.dirname(ddddocr.__file__))" + Write-Host "ddddocr package location: $ddddocrPath" + + if (-not (Test-Path "models")) { + New-Item -ItemType Directory -Path "models" | Out-Null + Write-Host "✓ Created models directory" + } + + $onnxSource = Join-Path $ddddocrPath "common_old.onnx" + $onnxDest = "models/common_old.onnx" + if (Test-Path $onnxSource) { + Copy-Item $onnxSource $onnxDest -Force + Write-Host "✓ Copied ONNX model from: $onnxSource" + Write-Host "✓ ONNX model copied to: $onnxDest" + } else { + Write-Error "✗ ONNX model not found in ddddocr package: $onnxSource" + exit 1 + } + + if (Test-Path $onnxDest) { + $fileSize = (Get-Item $onnxDest).Length / 1MB + Write-Host "✓ Model file verified: $onnxDest (Size: $([math]::Round($fileSize, 2)) MB)" + } else { + Write-Error "✗ Failed to copy model file" + exit 1 + } + shell: pwsh + - name: Compile Qt Resource files run: | cd batchs @@ -120,7 +150,7 @@ jobs: " pathex=[]," " binaries=[]," " datas=[" - " ('models\\common.onnx', 'ddddocr')," + " ('models\\common_old.onnx', 'ddddocr')," " ('src\\gui\\resources\\icons\\AutoLibrary_32x32.ico', 'gui\\resources\\icons')," " ]," " hiddenimports=[]," diff --git a/requirement.txt b/requirement.txt index 30bbe30e4e1455481388986e9b53729e45ce76d3..5a95907538c96df1dbdd5a9dc4c01af2384d5537 100644 GIT binary patch delta 16 XcmX@WbAV?<6AQC3gT>}nmfeg1FZTsC delta 16 XcmX@WbAV?<6AQBmgW={@mfeg1FVzJv