{"id":34,"date":"2023-11-24T14:30:17","date_gmt":"2023-11-24T06:30:17","guid":{"rendered":"https:\/\/dimtechstudio.com\/?p=34"},"modified":"2023-11-25T18:38:00","modified_gmt":"2023-11-25T10:38:00","slug":"%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae","status":"publish","type":"post","link":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/","title":{"rendered":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee"},"content":{"rendered":"<p><a href=\"https:\/\/www.dimtechstudio.com\/\"><img decoding=\"async\" src=\"\/dimwalker\/Wlkr.MyNote\/raw\/master\/2023\/11\/24\/vx_images\/DimTechStudio-Logo.png\" alt=\"DimTechStudio.Com\" \/><\/a><\/p>\n<h1>Wlkr.Core.ThreadUtils<\/h1>\n<h2>\u9879\u76ee\u80cc\u666f<\/h2>\n<p>\u65e9\u5728PaddleOCR 2.2\u7248\u672c\u65f6\u671f\uff0c\u8ba4\u8bc6\u4e86\u5468\u6770\u5927\u4f6c\u7684PaddleSharp\u9879\u76ee\uff0c\u8bd5\u7528\u5176\u4e2dPaddleOCR\u65f6\uff0c\u53d1\u73b0\u5b83\u5728\u6539\u4e3aweb api\u8c03\u7528\u65f6\u4f1a\u62a5\u9519\uff0c\u5927\u6982\u610f\u601d\u662fOCR\u5b9e\u4f8b\u7684\u5185\u5b58\u53ea\u80fd\u7531\u5176\u521b\u5efa\u7684\u7ebf\u7a0b\u624d\u5177\u6709\u8bbf\u95ee\u6743\u9650\uff0c\u4e8e\u662f\u5c31\u6709\u4e86\u672c\u9879\u76ee\u7684\u96cf\u5f62\u3002 <\/p>\n<p>\u6f5c\u4f0f\u4e8e\u5927\u4f6cQ\u7fa4\u4e2d\u5f88\u957f\u65f6\u95f4\uff0c\u8fd9\u4e2a\u95ee\u9898\u66f4\u662f\u8001\u751f\u5e38\u8c08\u3002\u867d\u7136\u540e\u6765\u5927\u4f6c\u5b9e\u73b0\u4e86\u57fa\u4e8e<code>BlockingCollection<\/code>\u7684\u7ebf\u7a0b\u5b89\u5168\u793a\u4f8b\uff0c\u4e0d\u8fc7\u4f30\u8ba1\u56e0\u4e3aREADME\u5168\u662f\u82f1\u6587\uff0c\u8fd8\u662f\u51fa\u73b0\u4e86\u5f88\u591a\u661f\u9645\u73a9\u5bb6\u3002<\/p>\n<h2>\u98df\u7528\u65b9\u5f0f<\/h2>\n<p>\u9879\u76ee\u4e2d\u7684SafeThreadRunner\uff0c\u4e3a\u4e86\u5b9e\u73b0\u66f4\u76f4\u89c2\u7684\u8c03\u7528\u65b9\u5f0f\uff08<code>var res = ocr.run(mat)<\/code>\uff09\uff0c\u4f7f\u7528\u4e863\u4e2a\u4fe1\u53f7\u91cf<code>SemaphoreSlim<\/code>\u5b9e\u73b0\u4e86\u7ebf\u7a0b\u5b89\u5168\u7684\u8f6e\u8be2\u65b9\u6cd5\uff0c\u5b83\u4eec\u7684\u4f5c\u7528\u5206\u522b\u662f\u5426\u7a7a\u95f2\uff0c\u5524\u9192\u7ebf\u7a0b\uff0c\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p><code>SafeThreadRunner&lt;Cls, In, Out&gt;<\/code>\uff0c\u53ef\u4ee5\u4ece\u6cdb\u578b\u7684\u540d\u5b57\u731c\u6d4b\uff0cCls\u5bf9\u5e94OCR\u7684\u5b9e\u4f8b\uff08\u5982All\u3001Rec\u3001Det\u7b49\u4efb\u52a1\uff09\uff0c<code>In<\/code>\u4e3a\u8f93\u5165\u5373Mat\uff0c<code>Out<\/code>\u4e3a\u8f93\u51fa\u5373Restful\u89c4\u8303\u7684\u8fd4\u56de\u7ed3\u679c<code>RestResult&lt;Out&gt;<\/code>\u3002<\/p>\n<h3>\u6838\u5fc3\u4ee3\u7801<\/h3>\n<p>\u4ee3\u7801\u5f88\u7b80\u5355\uff0c\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff0c\u901a\u8fc7\u4fe1\u53f7\u91cf\u8d1f\u8d23\u68c0\u67e5\u7ebf\u7a0b\u662f\u5426\u7a7a\u95f2\u3002\u5982\u679c\u7a7a\u95f2\uff0c \u5219\u8bbe\u7f6e\u5165\u53c2\uff0c\u5524\u9192\u7ebf\u7a0b\u3002  <\/p>\n<pre><code class=\"language-C#\">public RestResult&lt;Out&gt; Run(In src)\n{\n    \/\/\u662f\u5426\u7a7a\u95f2\n    safeSrcSlim.Wait();\n    \/\/\u8bbe\u7f6eSource\n    Source = src;\n    \/\/\u6062\u590d\u7ebf\u7a0b\uff0c\u8fd0\u884crunFunc\n    safeRunSlim.Release();\n    \/\/\u7b49\u5f85runFunc\u7ed3\u679c\n    safeResSlim.Wait();\n    \/\/\u91ca\u653e\u4fe1\u53f7\u91cf\uff0c\u8bbe\u4e3a\u7a7a\u95f2\n    safeSrcSlim.Release();\n    return Result;\n}<\/code><\/pre>\n<p>\u5524\u9192\u540e\u5219\u6267\u884c\u8bc6\u522b\uff0c\u544a\u8bc9\u8c03\u7528\u8005\u8bc6\u522b\u5b8c\u6210\uff0c\u8f93\u51fa\u7ed3\u679c\u3002\uff08Dispose\u540c\u7406\uff09  <\/p>\n<pre><code class=\"language-C#\">private void RunByThread()\n{\n    using Cls cls = initFunc();\n    while (true)\n    {\n        safeRunSlim.Wait();\n        if (IsDisposed)\n            return;\n        try\n        {\n            Result = runFunc(cls, Source);\n        }\n        catch (Exception ex)\n        {\n            Result = new RestResult&lt;Out&gt;()\n            {\n                code = &quot;500&quot;,\n                msg = ex.Message\n            };\n        }\n        finally\n        {\n            safeResSlim.Release();\n        }\n    }\n}<\/code><\/pre>\n<h3>nuget\u5b89\u88c5\u53c2\u8003\u547d\u4ee4<\/h3>\n<pre><code class=\"language-powershell\"># \u65b0\u5efa\u4e00\u4e2aconsole\u9879\u76ee\ndotnet new console\n# \u6dfb\u52a0nuget\u5305\ndotnet add package Wlkr.SafePaddleOCR<\/code><\/pre>\n<h3>CPU\u52a0\u901f\u793a\u4f8b<\/h3>\n<p>\u672c\u9879\u76ee\u5b9e\u73b0\u7684SafePaddleOCR\u4e3aPaddleOcrAll\u5f00\u542fMkldnn\u7684\u5b9e\u4f8b\uff0c\u4f7f\u7528\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-C#\">\/\/Warmup\nSafePaddleOCR safePaddleOCR = new SafePaddleOCR();\nstring imgPath = @&quot;..\/..\/..\/..\/vx_images\/DimTechStudio-Logo.png&quot;;\nvar res = safePaddleOCR.Run(imgPath);\nConsole.Write(@&quot;res: {res.data.Text}&quot;);<\/code><\/pre>\n<h3>\u5b9a\u5236\u793a\u4f8b<\/h3>\n<p>\u5982\u9700\u8981\u5b9a\u5236\u81ea\u5df1\u7684\u7ebf\u7a0b\u5b89\u5168\u5b9e\u4f8b\uff0c\u53ef\u53c2\u8003\uff1a<\/p>\n<pre><code class=\"language-C#\">\/\/\u5b9e\u4f8b\u7684\u521d\u59cb\u5316\u65b9\u6cd5\nFunc&lt;PaddleOcrAll&gt; initFuc = () =&gt;\n{\n    Action&lt;PaddleConfig&gt; device = PaddleDevice.Mkldnn();\n    var poa = new PaddleOcrAll(LocalFullModels.ChineseV3, device)\n    {\n        Enable180Classification = true,\n        AllowRotateDetection = true,\n    };\n    return poa;\n};\n\/\/\u5b9e\u4f8b\u7684\u6267\u884c\u65b9\u6cd5\nFunc&lt;PaddleOcrAll, Mat, RestResult&lt;PaddleOcrResult&gt;&gt; mthdFunc = (cls, source) =&gt;\n{\n    var res = cls.Run(source);\n    return new RestResult&lt;PaddleOcrResult&gt;(res);\n};\n\/\/\u58f0\u660e\nSafeThreadRunner&lt;PaddleOcrAll, Mat, PaddleOcrResult&gt; safeThreadRunner = new SafeThreadRunner&lt;PaddleOcrAll, Mat, PaddleOcrResult&gt;(OCRFactory.BuildAllWithMkldnn, OCRFactory.RunAll);\n\/\/\u8fd0\u884c\nstring imgPath = @&quot;..\/..\/..\/..\/vx_images\/DimTechStudio-Logo.png&quot;;\nusing var mat = Cv2.ImRead(filePath, ImreadModes.AnyColor);\nvar res = safeThreadRunner.Run(mat);<\/code><\/pre>\n<h2><code>SemaphoreSlim<\/code>\u4e0e<code>BlockingCollection<\/code>\u5bf9\u6bd4<\/h2>\n<ul>\n<li>\u5355\u5b9e\u4f8b\u6d4b\u8bd5\uff1a\u6027\u80fd\u51e0\u4e4e\u4e00\u6837\uff0c\u6ca1\u6709\u660e\u663e\u5dee\u5f02  <\/li>\n<li>\u591a\u5b9e\u4f8b\u6d4b\u8bd5\uff1a\u62a5\u9519\uff01\uff01\uff01<br \/>\n<blockquote>\n<p>\u6d4b\u8bd5\u7528\u7684\u673a\u5668\u662f\u7b14\u8bb0\u672c CPU  R7 5800H\uff0c\u5185\u5b5832G\u3002<br \/>\n\u4e24\u79cd\u65b9\u5f0f\u5747\u4f1a\u62a5\u9519\uff0c\u5b9e\u4f8b\u6570\u8d8a\u591a\uff0c\u62a5\u9519\u6982\u7387\u8d8a\u9ad8\uff0c\u9519\u8bef\u63d0\u793a\u4f9d\u7136\u5185\u5b58\u9519\u8bef\u7684\u95ee\u9898\u3002<br \/>\nSystem.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.<br \/>\n\u53e6\u5916SemaphoreSlim\u7684\u65b9\u5f0f\u6bd4BlockingCollection\u7684\u65b9\u5f0f\u51fa\u73b0\u7684\u66f4\u9891\u7e41\uff0c\u5c24\u5176\u57284\u5b9e\u4f8b\u65f6\u57fa\u672c\u65e0\u6cd5\u5b8c\u621010240\u6b21OCR\u6d4b\u8bd5\u3002<br \/>\n\u4e24\u8005\u5728\u51fa\u73b0\u4ee3\u7801\u4f4d\u7f6e\u4e5f\u4e0d\u7ecf\u76f8\u540c\uff0cDet\u3001Cls\u3001Rec\u4e09\u79cd\u6a21\u578b\u9884\u6d4b\u65f6\u5747\u53ef\u80fd\u9519\u8bef\u3002  <\/p>\n<\/blockquote>\n<\/li>\n<li>\u5468\u6770\u5927\u4f6c\u7684\u9879\u76ee\u4f18\u52bf\uff1a\u5b9e\u73b0\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u5f0f  <\/li>\n<li>\u672c\u9879\u76ee\u4f18\u52bf\uff1a\u5355\u5b9e\u4f8bDispose<br \/>\n<blockquote>\n<p>\u7531\u4e8e\u6211\u4e5f\u91cd\u6784\u8fc7\u5468\u6770\u5927\u4f6c\u7684<a href=\"https:\/\/github.com\/sdcb\/PaddleSharp\/blob\/master\/src\/Sdcb.PaddleOCR\/QueuedPaddleOcrAll.cs\">QueuedPaddleOcrAll.cs<\/a>\uff0c\u5176Dispose\u65b9\u5f0f\u53ea\u80fd\u91ca\u653e\u6240\u6709\u5b9e\u4f8b\u3002\u867d\u7136\u6211\u589e\u52a0\u4e86\u52a8\u6001\u6dfb\u52a0\/\u5220\u9664\u5b9e\u4f8b\u7684\u529f\u80fd\uff0c\u4f46\u5176\u4f7f\u7528\u4e86Task\u4f5c\u4e3a\u8f6e\u8be2\u7684\u8f7d\u4f53\uff0cTask\u4e0d\u80fd\u50cfThread\u90a3\u6837\u6709\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u53d6\u6d88\u52a8\u4f5c\u3002<code>CancellationToken<\/code>\u5b9e\u73b0\u7684\u53d6\u6d88\u6700\u5927\u7f3a\u9677\u662f\u5728\u963b\u585e\u65f6\u662f\u65e0\u6548\u7684\u3002\u5373\u4fbf\u6211\u5b9e\u73b0\u4e86\u53d6\u6d88\uff0c\u5b83\u4e5f\u5fc5\u987b\u4eceblockingCollection.GetConsumingEnumerable()\u83b7\u53d6\u5230\u6d88\u606f\u6267\u884c\u4e00\u6b21OCR\u8bc6\u522b\uff0c\u624d\u80fd\u91ca\u653eOCR\u5b9e\u4f8b\uff0c\u6781\u7aef\u60c5\u51b5\u4e0b\u7b49\u4e8e\u65e0\u6cd5\u662f\u91ca\u653e\u3002<br \/>\n\u800c\u672c\u9879\u76ee\u4f7f\u7528\u4e86<code>SemaphoreSlim<\/code>\uff0c\u6267\u884cDispose\u65f6\u53ea\u8981\u7ebf\u7a0b\u662f\u7a7a\u95f2\u5373\u53ef\u89e6\u53d1OCR\u5b9e\u4f8b\u7684\u91ca\u653e\u3002  <\/p>\n<\/blockquote>\n<\/li>\n<\/ul>\n<h2>\u6d4b\u8bd5\u6570\u636e<\/h2>\n<ul>\n<li>\u786c\u4ef6\u914d\u7f6e\uff1a CPU  R7 5800H\uff088\u683816\u7ebf\u7a0b\u4e3b\u98913.2GHz\uff09\uff0c\u5185\u5b5832G<\/li>\n<li>\u6d4b\u8bd5\u56fe\u7247\uff1a10\u5f20\uff0c\u6570\u5b570000~0009\uff0c\u5bbd\u9ad8160*80\uff0c\u7c7b\u578bpng<\/li>\n<li>\u98ce\u6247\u8f6c\u901f\u5e38\u5f00\u6700\u5927\uff0c\u6392\u9664CPU\u6e29\u5ea6\u5f71\u54cd<\/li>\n<li>OCR\u5b9e\u4f8b\u53c2\u6570\uff1aAll\uff0cCPU\uff0cMkldnn<br \/>\n<blockquote>\n<p>\u7531\u4e8e10240\u6b21\u5927\u6982\u7387\u62a5\u9519\uff0c\u65e0\u6cd5\u5b8c\u6210\u6d4b\u8bd5\uff0c\u8fd9\u91cc\u6539\u4e3a256\u6b21\u3002  <\/p>\n<\/blockquote>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: right;\">\u5e73\u5747\u6beb\u79d2<\/th>\n<th style=\"text-align: right;\">\u5e73\u5747\u6beb\u79d2<\/th>\n<th style=\"text-align: right;\">\u5e73\u5747\u6beb\u79d2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">OCR\u6b21\u6570<\/td>\n<td style=\"text-align: right;\">256<\/td>\n<td style=\"text-align: right;\">256<\/td>\n<td style=\"text-align: right;\">256<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u5b9e\u4f8b\u6570<\/td>\n<td style=\"text-align: right;\">1<\/td>\n<td style=\"text-align: right;\">2<\/td>\n<td style=\"text-align: right;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">SemaphoreSlim<\/td>\n<td style=\"text-align: right;\">27.36328125<\/td>\n<td style=\"text-align: right;\">17.640625<\/td>\n<td style=\"text-align: right;\">12.6328125<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">BlockingCollection<\/td>\n<td style=\"text-align: right;\">27.74609375<\/td>\n<td style=\"text-align: right;\">17.8984375<\/td>\n<td style=\"text-align: right;\">12.640625<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\u601d\u8def\u8f6c\u6362<br \/>\n<blockquote>\n<p>\u4ece\u5355\u8fdb\u7a0b4\u5b9e\u4f8b\uff0c\u6539\u4e3a4\u8fdb\u7a0b1\u5b9e\u4f8b\u6d4b\u8bd5\uff0c\u6d4b\u8bd5\u4e861\u6b21\u6ca1\u6709\u62a5\u9519\uff0c\u6bcf\u4e2a\u8fdb\u7a0b10240\u6b21\uff0c\u5e73\u574750ms\u3002  <\/p>\n<\/blockquote>\n<\/li>\n<li>\u6d4b\u8bd5\u7f3a\u9677\uff1a\n<ul>\n<li>\u5c45\u7136\u6ca1\u7528web api\u6765\u6d4b\u8bd5\u800c\u662f\u7528\u4e86console\u6d4b\u8bd5\uff0c\u4e0e\u9879\u76ee\u80cc\u666f\u80cc\u9053\u800c\u9a70\u2026\u2026<\/li>\n<li>\u7531\u4e8e\u7528\u7684\u56fe\u7247\u8f83\u5c11\uff0c\u6ca1\u6cd5\u4f5c\u4e3a\u5185\u5b58\u538b\u529b\u6d4b\u8bd5\u7684\u53c2\u8003<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u57fa\u4e8e\u601d\u8def\u8f6c\u6362\u7684\u6d4b\u8bd5\uff0c\u867d\u7136\u6d4b\u8bd5\u6b21\u6570\u5c11\u4e86\u70b9\uff0c\u4e0d\u8fc7\u76ee\u524d\u6765\u770b\uff0c\u5f53\u4f5c\u4e3aweb api\u65f6\uff0c1\u8fdb\u7a0b1\u5b9e\u4f8b\uff0c\u591a\u5f00\u8fdb\u7a0b\uff0c\u5229\u7528\u8d1f\u8f7d\u5747\u8861\u6765\u63d0\u9ad8\u5e76\u53d1\u548c\u670d\u52a1\u5668\u5229\u7528\u7387\uff0c\u4e3a\u6700\u4f18\u65b9\u6848\u3002<\/p>\n<h2>Author Info<\/h2>\n<p>DimWalker<br \/>\n\u00a92023 \u5e7f\u5dde\u5e02\u589e\u57ce\u533a\u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8<br \/>\n<a href=\"https:\/\/www.dimtechstudio.com\/\">https:\/\/www.dimtechstudio.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Wlkr.Core.ThreadUtils \u9879\u76ee\u80cc\u666f \u65e9\u5728PaddleOCR 2.2\u7248\u672c\u65f6\u671f\uff0c\u8ba4\u8bc6\u4e86\u5468\u6770\u5927\u4f6c\u7684PaddleSharp\u9879\u76ee\uff0c\u8bd5\u7528\u5176\u4e2dPaddleOCR\u65f6\uff0c\u53d1\u73b0\u5b83\u5728\u6539\u4e3aweb api\u8c03\u7528\u65f6 &#8230;","protected":false},"author":1,"featured_media":14,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[15,14,18,16,17,19],"class_list":["post-34","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-3","tag-ocr","tag-paddleocr","tag-18","tag-16","tag-17","tag-19"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/\u5229\u7528\u4fe1\u53f7\u91cfsemaphoreslim\u5b9e\u73b0paddleocr\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8\" \/>\n<meta property=\"og:description\" content=\"Wlkr.Core.ThreadUtils \u9879\u76ee\u80cc\u666f \u65e9\u5728PaddleOCR 2.2\u7248\u672c\u65f6\u671f\uff0c\u8ba4\u8bc6\u4e86\u5468\u6770\u5927\u4f6c\u7684PaddleSharp\u9879\u76ee\uff0c\u8bd5\u7528\u5176\u4e2dPaddleOCR\u65f6\uff0c\u53d1\u73b0\u5b83\u5728\u6539\u4e3aweb api\u8c03\u7528\u65f6 ...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/\u5229\u7528\u4fe1\u53f7\u91cfsemaphoreslim\u5b9e\u73b0paddleocr\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\/\" \/>\n<meta property=\"og:site_name\" content=\"\u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-24T06:30:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-25T10:38:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Logo-220x150-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"220\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"DimWalker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"DimWalker\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/\"},\"author\":{\"name\":\"DimWalker\",\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8\"},\"headline\":\"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\",\"datePublished\":\"2023-11-24T06:30:17+00:00\",\"dateModified\":\"2023-11-25T10:38:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/\"},\"wordCount\":96,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8\"},\"keywords\":[\"OCR\",\"PaddleOCR\",\"\u4eba\u5de5\u667a\u80fd\",\"\u591a\u7ebf\u7a0b\",\"\u6df1\u5ea6\u5b66\u4e60\",\"\u7ebf\u7a0b\u5b89\u5168\"],\"articleSection\":[\"\u4eba\u5de5\u667a\u80fd\",\"\u539f\u521b\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/\",\"url\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/\",\"name\":\"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8\",\"isPartOf\":{\"@id\":\"https:\/\/dimtechstudio.com\/#website\"},\"datePublished\":\"2023-11-24T06:30:17+00:00\",\"dateModified\":\"2023-11-25T10:38:00+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/dimtechstudio.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dimtechstudio.com\/#website\",\"url\":\"https:\/\/dimtechstudio.com\/\",\"name\":\"\u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8\",\"description\":\"DimTechStudio\",\"publisher\":{\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dimtechstudio.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8\",\"name\":\"DimWalker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Icon-128x128-1.png\",\"contentUrl\":\"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Icon-128x128-1.png\",\"width\":128,\"height\":128,\"caption\":\"DimWalker\"},\"logo\":{\"@id\":\"https:\/\/dimtechstudio.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/dimtechstudio.com\"],\"url\":\"http:\/\/dimtechstudio.com\/index.php\/author\/walker\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/\u5229\u7528\u4fe1\u53f7\u91cfsemaphoreslim\u5b9e\u73b0paddleocr\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8","og_description":"Wlkr.Core.ThreadUtils \u9879\u76ee\u80cc\u666f \u65e9\u5728PaddleOCR 2.2\u7248\u672c\u65f6\u671f\uff0c\u8ba4\u8bc6\u4e86\u5468\u6770\u5927\u4f6c\u7684PaddleSharp\u9879\u76ee\uff0c\u8bd5\u7528\u5176\u4e2dPaddleOCR\u65f6\uff0c\u53d1\u73b0\u5b83\u5728\u6539\u4e3aweb api\u8c03\u7528\u65f6 ...","og_url":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/\u5229\u7528\u4fe1\u53f7\u91cfsemaphoreslim\u5b9e\u73b0paddleocr\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee\/","og_site_name":"\u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8","article_published_time":"2023-11-24T06:30:17+00:00","article_modified_time":"2023-11-25T10:38:00+00:00","og_image":[{"width":220,"height":150,"url":"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Logo-220x150-1.png","type":"image\/png"}],"author":"DimWalker","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"DimWalker","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#article","isPartOf":{"@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/"},"author":{"name":"DimWalker","@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8"},"headline":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee","datePublished":"2023-11-24T06:30:17+00:00","dateModified":"2023-11-25T10:38:00+00:00","mainEntityOfPage":{"@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/"},"wordCount":96,"commentCount":0,"publisher":{"@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8"},"keywords":["OCR","PaddleOCR","\u4eba\u5de5\u667a\u80fd","\u591a\u7ebf\u7a0b","\u6df1\u5ea6\u5b66\u4e60","\u7ebf\u7a0b\u5b89\u5168"],"articleSection":["\u4eba\u5de5\u667a\u80fd","\u539f\u521b"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/","url":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/","name":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee - \u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8","isPartOf":{"@id":"https:\/\/dimtechstudio.com\/#website"},"datePublished":"2023-11-24T06:30:17+00:00","dateModified":"2023-11-25T10:38:00+00:00","breadcrumb":{"@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/dimtechstudio.com\/index.php\/2023\/11\/24\/%e5%88%a9%e7%94%a8%e4%bf%a1%e5%8f%b7%e9%87%8fsemaphoreslim%e5%ae%9e%e7%8e%b0paddleocr%e7%9a%84%e7%ba%bf%e7%a8%8b%e5%ae%89%e5%85%a8%e8%ae%bf%e9%97%ae\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/dimtechstudio.com\/"},{"@type":"ListItem","position":2,"name":"\u5229\u7528\u4fe1\u53f7\u91cfSemaphoreSlim\u5b9e\u73b0PaddleOCR\u7684\u7ebf\u7a0b\u5b89\u5168\u8bbf\u95ee"}]},{"@type":"WebSite","@id":"https:\/\/dimtechstudio.com\/#website","url":"https:\/\/dimtechstudio.com\/","name":"\u9eef\u5f71\u4fe1\u606f\u79d1\u6280\u90e8","description":"DimTechStudio","publisher":{"@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dimtechstudio.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/7f8c70f133a3ce4b0c308884bbbd83a8","name":"DimWalker","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/image\/","url":"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Icon-128x128-1.png","contentUrl":"http:\/\/dimtechstudio.com\/wp-content\/uploads\/2023\/11\/DimTechStudio-Icon-128x128-1.png","width":128,"height":128,"caption":"DimWalker"},"logo":{"@id":"https:\/\/dimtechstudio.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/dimtechstudio.com"],"url":"http:\/\/dimtechstudio.com\/index.php\/author\/walker\/"}]}},"_links":{"self":[{"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/media\/14"}],"wp:attachment":[{"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dimtechstudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}