Skip to content

Commit 56c69a3

Browse files
committed
Skip v3/v4 models for osx-arm64
1 parent 1599fba commit 56c69a3

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

tests/Sdcb.PaddleOCR.Tests/OfflineModelsTest.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void FastCheckOCREnglishV3()
2121
// E0623 03:57:55.708065 159170560 onnxruntime_predictor.cc:354] Got invalid dimensions for input: x for the following indices
2222
// index: 2 Got: 320 Expected: 960
2323
// Please fix either the inputs or the model.
24-
console.WriteLine("Skipping EnglishV3 test on macOS x64 due to known issues with ONNX model.");
24+
Console.WriteLine("Skipping EnglishV3 test on macOS x64 due to known issues with ONNX model.");
2525
return;
2626
}
2727
else if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
@@ -34,7 +34,7 @@ public void FastCheckOCREnglishV3()
3434
// [Hint: Expected iter != allocators.end(), but received iter == allocators.end().] (at /Users/runner/work/PaddleSharp/PaddleSharp/paddle-src/paddle/phi/core/memory/allocation/allocator_facade.cc:381)
3535
// [operator < matmul > error]
3636
// The active test run was aborted. Reason: Test host process crashed
37-
console.WriteLine("Skipping EnglishV3 test on macOS arm64 because this issue: https://github.com/PaddlePaddle/Paddle/issues/72413");
37+
Console.WriteLine("Skipping EnglishV3 test on macOS arm64 because this issue: https://github.com/PaddlePaddle/Paddle/issues/72413");
3838
return;
3939
}
4040
}
@@ -46,14 +46,27 @@ public void FastCheckOCREnglishV3()
4646
[Fact]
4747
public void FastCheckOCREnglishV4()
4848
{
49-
Console.WriteLine($"Running EnglishV4 test on {RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})");
49+
// skip for osx-arm64
50+
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && RuntimeInformation.OSArchitecture == Architecture.Arm64)
51+
{
52+
Console.WriteLine("Skipping EnglishV4 test on macOS arm64 due to known issues: https://github.com/PaddlePaddle/Paddle/issues/72413");
53+
return;
54+
}
55+
5056
FullOcrModel model = LocalFullModels.EnglishV4;
5157
FastCheck(model);
5258
}
5359

5460
[Fact]
5561
public void FastCheckOCRChineseV4()
5662
{
63+
// skip for osx-arm64
64+
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && RuntimeInformation.OSArchitecture == Architecture.Arm64)
65+
{
66+
Console.WriteLine("Skipping EnglishV4 test on macOS arm64 due to known issues: https://github.com/PaddlePaddle/Paddle/issues/72413");
67+
return;
68+
}
69+
5770
Console.WriteLine($"Running ChineseV4 test on {RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})");
5871
FullOcrModel model = LocalFullModels.ChineseV4;
5972
FastCheck(model);
@@ -84,6 +97,7 @@ private void FastCheck(FullOcrModel model)
8497
{
8598
PaddleOcrResult result = all.Run(src);
8699
console.WriteLine("Detected all texts: \n" + result.Text);
100+
Console.WriteLine("Detected all texts: \n" + result.Text);
87101
foreach (PaddleOcrResultRegion region in result.Regions)
88102
{
89103
console.WriteLine($"Text: {region.Text}, Score: {region.Score}, RectCenter: {region.Rect.Center}, RectSize: {region.Rect.Size}, Angle: {region.Rect.Angle}");
@@ -114,6 +128,7 @@ public async Task QueuedOCR()
114128
{
115129
PaddleOcrResult result = await all.Run(src);
116130
console.WriteLine("Detected all texts: \n" + result.Text);
131+
Console.WriteLine("Detected all texts: \n" + result.Text);
117132
foreach (PaddleOcrResultRegion region in result.Regions)
118133
{
119134
console.WriteLine($"Text: {region.Text}, Score: {region.Score}, RectCenter: {region.Rect.Center}, RectSize: {region.Rect.Size}, Angle: {region.Rect.Angle}");

0 commit comments

Comments
 (0)