You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImageBackgroundRemoval.cs 1.0 kB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using TensorFlowNET.Examples.Utility;
  5. namespace TensorFlowNET.Examples.ImageProcess
  6. {
  7. /// <summary>
  8. /// This example removes the background from an input image.
  9. ///
  10. /// https://github.com/susheelsk/image-background-removal
  11. /// </summary>
  12. public class ImageBackgroundRemoval : IExample
  13. {
  14. public int Priority => 15;
  15. public bool Enabled { get; set; } = true;
  16. public bool ImportGraph { get; set; } = true;
  17. public string Name => "Image Background Removal";
  18. string modelDir = "deeplabv3";
  19. public bool Run()
  20. {
  21. return false;
  22. }
  23. public void PrepareData()
  24. {
  25. // get model file
  26. string url = "http://download.tensorflow.org/models/deeplabv3_mnv2_pascal_train_aug_2018_01_29.tar.gz";
  27. Web.Download(url, modelDir, "deeplabv3_mnv2_pascal_train_aug_2018_01_29.tar.gz");
  28. }
  29. }
  30. }

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。