Skip to content

Commit bcd366f

Browse files
committed
test OfflineModelsTest only
1 parent ce9cf2a commit bcd366f

File tree

2 files changed

+5
-52
lines changed

2 files changed

+5
-52
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,9 @@ jobs:
6161
- name: Test
6262
shell: bash
6363
run: |
64-
# export FLAGS_mklml_dir=${{ github.workspace }}/tests/Sdcb.PaddleOCR.Tests/bin/Release/net8.0/runtimes/linux-x64/native
65-
# export GLOG_v=4
66-
# if [[ "${{ matrix.runs-on }}" == "macos-15" ]]; then
67-
# export FLAGS_use_system_allocator=1
64+
# if [[ "${{ runner.os }}" != "Windows" ]]; then
65+
# dotnet test ./tests/Sdcb.PaddleOCR.Tests/Sdcb.PaddleOCR.Tests.csproj -c Release --no-build --verbosity normal --filter 'Category!=WindowsOnly'
66+
# else
67+
# dotnet test ./tests/Sdcb.PaddleOCR.Tests/Sdcb.PaddleOCR.Tests.csproj -c Release --no-build --verbosity normal
6868
# fi
69-
70-
if [[ "${{ runner.os }}" != "Windows" ]]; then
71-
dotnet test ./tests/Sdcb.PaddleOCR.Tests/Sdcb.PaddleOCR.Tests.csproj -c Release --no-build --verbosity normal --filter 'Category!=WindowsOnly'
72-
else
73-
dotnet test ./tests/Sdcb.PaddleOCR.Tests/Sdcb.PaddleOCR.Tests.csproj -c Release --no-build --verbosity normal
74-
fi
69+
dotnet test ./tests/Sdcb.PaddleOCR.Tests/Sdcb.PaddleOCR.Tests.csproj -c Release --no-build --verbosity normal --filter 'FullyQualifiedName=Sdcb.PaddleOCR.Tests.OfflineModelsTest'

tests/Sdcb.PaddleOCR.Tests/OfflineModelsTest.cs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -96,46 +96,4 @@ public async Task QueuedOCR()
9696
}
9797
}
9898
}
99-
100-
[Fact(Skip = "Too slow")]
101-
public void TwoThreadsInferAtSameTime()
102-
{
103-
FullOcrModel model = LocalFullModels.EnglishV3;
104-
105-
// from: https://visualstudio.microsoft.com/wp-content/uploads/2021/11/Home-page-extension-visual-updated.png
106-
byte[] sampleImageData = File.ReadAllBytes(@"./samples/vsext.png");
107-
108-
using PaddleOcrAll all = new(model)
109-
{
110-
AllowRotateDetection = true,
111-
Enable180Classification = false,
112-
};
113-
114-
// Load local file by following code:
115-
// using (Mat src2 = Cv2.ImRead(@"C:\test.jpg"))
116-
using (Mat src = Cv2.ImDecode(sampleImageData, ImreadModes.Color))
117-
{
118-
int threadCount = 2;
119-
Thread[] threads = new Thread[threadCount];
120-
PaddleOcrResult[] results = new PaddleOcrResult[threadCount];
121-
for (int i = 0; i < threadCount; i++)
122-
{
123-
int index = i;
124-
threads[i] = new(() =>
125-
{
126-
results[index] = all.Run(src);
127-
});
128-
threads[i].Start();
129-
}
130-
foreach (Thread thread in threads)
131-
{
132-
thread.Join();
133-
}
134-
135-
for (int i = 0; i < threadCount; ++i)
136-
{
137-
_console.WriteLine($"Detected all texts in thread {i}: \n" + results[i].Text);
138-
}
139-
}
140-
}
14199
}

0 commit comments

Comments
 (0)