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.

Main.cs 1.6 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using Tensorflow;
  6. using Tensorflow.Models.ObjectDetection;
  7. using static Tensorflow.Binding;
  8. namespace TensorFlowNET.Examples.ImageProcessing.ObjectDetection
  9. {
  10. public class Main : IExample
  11. {
  12. public bool Enabled { get; set; } = true;
  13. public bool IsImportingGraph { get; set; } = true;
  14. public string Name => "Object Detection API";
  15. dynamic FLAGS = new
  16. {
  17. model_dir = "D:/Projects/PythonLab/tf-models/research/object_detection/models/model"
  18. };
  19. ModelLib model_lib = new ModelLib();
  20. public bool Run()
  21. {
  22. var config = tf.estimator.RunConfig(model_dir: FLAGS.model_dir);
  23. model_lib.create_estimator_and_inputs(run_config: config);
  24. // Currently only a single Eval Spec is allowed.
  25. tf.estimator.train_and_evaluate();
  26. return true;
  27. }
  28. public Graph BuildGraph()
  29. {
  30. throw new NotImplementedException();
  31. }
  32. public Graph ImportGraph()
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public void Predict(Session sess)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. public void PrepareData()
  41. {
  42. throw new NotImplementedException();
  43. }
  44. public void Train(Session sess)
  45. {
  46. throw new NotImplementedException();
  47. }
  48. void IExample.Test(Session sess)
  49. {
  50. throw new NotImplementedException();
  51. }
  52. }
  53. }