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 30bbe30..5a95907 100644 Binary files a/requirement.txt and b/requirement.txt differ