😎优化PaddleOCRSharp初始化
This commit is contained in:
parent
d76cde34c6
commit
d9ece804fb
@ -17,14 +17,14 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Remove="Configuration\App.*.json"/>
|
||||
<Content Remove="Configuration\App.*.json" />
|
||||
<Content Include="Configuration\App.*.json">
|
||||
<DependentUpon>App.json</DependentUpon>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Remove="Configuration\Database.*.json"/>
|
||||
<Content Remove="Configuration\Database.*.json" />
|
||||
<Content Include="Configuration\Database.*.json">
|
||||
<DependentUpon>Database.json</DependentUpon>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
|
||||
@ -18,6 +18,7 @@ namespace Admin.NET.Plugin.PaddleOCR.Service;
|
||||
public class PaddleOCRService : IDynamicApiController, ISingleton
|
||||
{
|
||||
private readonly PaddleOCREngine _engine;
|
||||
private readonly PaddleStructureEngine _structengine;
|
||||
|
||||
public PaddleOCRService()
|
||||
{
|
||||
@ -56,13 +57,19 @@ public class PaddleOCRService : IDynamicApiController, ISingleton
|
||||
//config.rec_infer = modelPathroot + @"\ch_PP-OCRv4_rec_server_infer";
|
||||
//config.keys = modelPathroot + @"\ppocr_keys.txt";
|
||||
|
||||
// 参数
|
||||
OCRParameter oCRParameter = new OCRParameter();
|
||||
//// 参数
|
||||
//OCRParameter oCRParameter = new OCRParameter();
|
||||
// oCRParameter.use_gpu=true; // 当使用GPU版本的预测库时,该参数打开才有效果
|
||||
// oCRParameter.enable_mkldnn = false;
|
||||
|
||||
// 初始化OCR引擎
|
||||
_engine = new PaddleOCREngine(config, oCRParameter);
|
||||
_engine = new PaddleOCREngine(config, "");
|
||||
|
||||
// 模型配置,使用默认值
|
||||
StructureModelConfig structureModelConfig = null;
|
||||
// 表格识别参数配置,使用默认值
|
||||
StructureParameter structureParameter = new();
|
||||
_structengine = new PaddleStructureEngine(structureModelConfig, structureParameter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user