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.

config.cs 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. namespace TensorFlowNET.Examples.ImageProcessing.YOLO
  6. {
  7. public class Config
  8. {
  9. public YoloConfig YOLO;
  10. public TrainConfig TRAIN;
  11. public TrainConfig TEST;
  12. public Config(string root)
  13. {
  14. YOLO = new YoloConfig(root);
  15. TRAIN = new TrainConfig(root);
  16. }
  17. public class YoloConfig
  18. {
  19. string _root;
  20. public string CLASSES;
  21. public float MOVING_AVE_DECAY = 0.9995f;
  22. public int[] STRIDES = new int[] { 8, 16, 32 };
  23. public YoloConfig(string root)
  24. {
  25. _root = root;
  26. CLASSES = Path.Combine(_root, "data", "classes", "coco.names");
  27. }
  28. }
  29. public class TrainConfig
  30. {
  31. string _root;
  32. public int BATCH_SIZE = 6;
  33. public int[] INPUT_SIZE = new int[] { 320, 352, 384, 416, 448, 480, 512, 544, 576, 608 };
  34. public bool DATA_AUG = true;
  35. public float LEARN_RATE_INIT = 1e-4f;
  36. public float LEARN_RATE_END = 1e-6f;
  37. public int WARMUP_EPOCHS = 2;
  38. public int FISRT_STAGE_EPOCHS = 20;
  39. public int SECOND_STAGE_EPOCHS = 30;
  40. public string INITIAL_WEIGHT;
  41. public string ANNOT_PATH;
  42. public TrainConfig(string root)
  43. {
  44. _root = root;
  45. INITIAL_WEIGHT = Path.Combine(_root, "data", "checkpoint", "yolov3_coco_demo.ckpt");
  46. ANNOT_PATH = Path.Combine(_root, "data", "dataset", "voc_train.txt");
  47. }
  48. }
  49. }
  50. }