Downloads for English V3 and English V4 Stalling
Closed this issue · 6 comments
Describe the bug
Whenever I run the default code found from the online docs example on my Windows 11 64 bit machine the download stalls. It hangs forever.
Steps to reproduce the bug
` private async Task<Rectangle[]> runPaddleOCR(Mat src)
{
List ocrResults = new List();
FullOcrModel model = await OnlineFullModels.EnglishV4.DownloadAsync();
using (PaddleOcrAll all = new PaddleOcrAll(model, PaddleDevice.Mkldnn())
{
AllowRotateDetection = true,
Enable180Classification = false,
})
{
PaddleOcrResult result = all.Run(src);
Console.WriteLine("Detected all texts: \n" + result.Text);
foreach (PaddleOcrResultRegion region in result.Regions)
{
var boundingRect = region.Rect.BoundingRect();
Rectangle rect = new Rectangle(boundingRect.X, boundingRect.Y, boundingRect.Width, boundingRect.Height);
ocrResults.Add(rect);
Console.WriteLine($"Text: {region.Text}, Score: {region.Score}, RectCenter: {region.Rect.Center}, RectSize: {region.Rect.Size}, Angle: {region.Rect.Angle}");
}
}
return ocrResults.ToArray();
}`
My code is above it always hangs on the downloadAsync line never reaching the using statement. I've tried EnglishV3 and EnglishV4.
Expected behavior
I'd like the file to download and run the model.
Screenshots
No response
Release version
No response
IDE
Visual Studio 2022 Community
OS version
Windows 11 64 bit
Additional context
No response
#104 #84 #80 #62 #32
tl;dr: Download models from upstream: https://paddlepaddle.github.io/PaddleOCR/ppocr/model_list.html and put them under the configured
Deeplink for EnglishV(3|4)
models: env4
env3
If it's still hard for you to connect these servers in China, here's mirrors on github: en_PP-OCRv4_rec_infer.tar.zip
en_PP-OCRv3_det_infer.tar.zip
(rename to remove .zip
extension)
Hey! Thank you for getting back to me! I downloaded the models and put them in the AppData folder as instructed, however the download still stalls for some reason. Thank you for your response, but I might use Tesseract for the time being so no rush to figure it out.
Did you uncompressed that .tar
?
Also feel free to modify the value of global variable GlobalModelDirectory
before using it.
Please remove the suffix _infer
from the unextracted folder name following
PaddleSharp/src/Sdcb.PaddleOCR.Models.LocalV4/KnownModels.cs
Lines 16 to 28 in 475ed95
This worked! I got rid of the Online Model library and downloaded the Local model library. Now the local example works perfectly. Thank you!