You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using OpenCvSharp;
using Sdcb.OpenVINO.PaddleOCR.Models.Online;
using Sdcb.OpenVINO.PaddleOCR.Models;
using Sdcb.OpenVINO.PaddleOCR;
using System.Diagnostics;
using System;
FullOcrModel model = await OnlineFullModels.ChineseV4.DownloadAsync();
using (PaddleOcrAll all = new(model)
{
AllowRotateDetection = true,
Enable180Classification = true,
})
{
while (true) {
var src = Cv2.ImRead("M:/CSharp/20241214_235857880.png");
// Load local file by following code:
// using (Mat src2 = Cv2.ImRead(@"C:\test.jpg"))
Stopwatch sw = Stopwatch.StartNew();
PaddleOcrResult result = all.Run(src);
Console.WriteLine($"elapsed={sw.ElapsedMilliseconds} ms");
Console.WriteLine("Detected all texts: \n" + result.Text);
foreach (PaddleOcrResultRegion region in result.Regions)
{
Console.WriteLine($"Text: {region.Text}, Score: {region.Score}, RectCenter: {region.Rect.Center}, RectSize: {region.Rect.Size}, Angle: {region.Rect.Angle}");
}
Thread.Sleep(1);
}
}
用你给出的这段代码加了一个while测试出现异常 PaddleOcrResult result = all.Run(src);报错System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”
The text was updated successfully, but these errors were encountered:
using OpenCvSharp;
using Sdcb.OpenVINO.PaddleOCR.Models.Online;
using Sdcb.OpenVINO.PaddleOCR.Models;
using Sdcb.OpenVINO.PaddleOCR;
using System.Diagnostics;
using System;
FullOcrModel model = await OnlineFullModels.ChineseV4.DownloadAsync();
using (PaddleOcrAll all = new(model)
{
AllowRotateDetection = true,
Enable180Classification = true,
})
{
while (true) {
var src = Cv2.ImRead("M:/CSharp/20241214_235857880.png");
// Load local file by following code:
// using (Mat src2 = Cv2.ImRead(@"C:\test.jpg"))
Stopwatch sw = Stopwatch.StartNew();
PaddleOcrResult result = all.Run(src);
Console.WriteLine($"elapsed={sw.ElapsedMilliseconds} ms");
Console.WriteLine("Detected all texts: \n" + result.Text);
foreach (PaddleOcrResultRegion region in result.Regions)
{
Console.WriteLine($"Text: {region.Text}, Score: {region.Score}, RectCenter: {region.Rect.Center}, RectSize: {region.Rect.Size}, Angle: {region.Rect.Angle}");
}
Thread.Sleep(1);
}
}
用你给出的这段代码加了一个while测试出现异常 PaddleOcrResult result = all.Run(src);报错System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”
The text was updated successfully, but these errors were encountered: