CntkDetect.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using Emgu.CV;
  5. using Emgu.CV.Structure;
  6. using WingServerCommon.Log;
  7. namespace WingAIDiagnosisService.Carotid.Utilities.CntkSeg
  8. {
  9. // public class CntkDetect:IDisposable
  10. // {
  11. // private CntkCpu _cntkDtect = null;
  12. // private static CntkDetect _instance;
  13. // /// <summary>
  14. // /// Instance of CntkDetect detector.
  15. // /// </summary>
  16. // public static CntkDetect Instance
  17. // {
  18. // get => _instance ?? (_instance = new CntkDetect());
  19. // }
  20. // public bool Initialization(string modelFilePath, int detectObjectNum)
  21. // {
  22. // try
  23. // {
  24. // _cntkDtect?.Dispose();
  25. // _cntkDtect = new CntkCpu();
  26. // // 读入
  27. // byte[] fileDataEncrypted = AESUtility.AESDecrypt(File.ReadAllBytes(modelFilePath));
  28. // _cntkDtect.Initialization(fileDataEncrypted, detectObjectNum);
  29. // return true;
  30. // }
  31. // catch (Exception e)
  32. // {
  33. // Logger.WriteLineError($"CntkDetect Initialization have an error{e}");
  34. // return false;
  35. // }
  36. // }
  37. // public List<List<CntkDetectResult>> DetectImage(Image<Gray, byte>[] images)
  38. // {
  39. // var result = _cntkDtect.EvaluationBatchOfImages(images);
  40. // return result;
  41. // }
  42. // public void Dispose()
  43. // {
  44. // _cntkDtect.Dispose();
  45. // _instance = null;
  46. // }
  47. // }
  48. }