Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

cfg.py 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  1. # -*- coding: utf-8 -*-
  2. '''
  3. @Time : 2020/05/06 21:05
  4. @Author : Tianxiaomo
  5. @File : Cfg.py
  6. @Noice :
  7. @Modificattion :
  8. @Author :
  9. @Time :
  10. @Detail :
  11. '''
  12. import os
  13. from easydict import EasyDict
  14. _BASE_DIR = os.path.dirname(os.path.abspath(__file__))
  15. Cfg = EasyDict()
  16. Cfg.use_darknet_cfg = False
  17. Cfg.cfgfile = os.path.join(_BASE_DIR, 'cfg', 'yolov4-custom.cfg')
  18. Cfg.batch = 1
  19. Cfg.subdivisions = 1
  20. Cfg.width = 608
  21. Cfg.height = 608
  22. Cfg.channels = 3
  23. Cfg.momentum = 0.949
  24. Cfg.decay = 0.0005
  25. Cfg.angle = 0
  26. Cfg.saturation = 1.5
  27. Cfg.exposure = 1.5
  28. Cfg.hue = .1
  29. Cfg.learning_rate = 0.00261
  30. Cfg.burn_in = 1000
  31. Cfg.max_batches = 500500
  32. Cfg.steps = [400000, 450000]
  33. Cfg.policy = Cfg.steps
  34. Cfg.scales = .1, .1
  35. Cfg.cutmix = 0
  36. Cfg.mosaic = 1
  37. Cfg.letter_box = 0
  38. Cfg.jitter = 0.2
  39. Cfg.classes = 2
  40. Cfg.track = 0
  41. Cfg.w = Cfg.width
  42. Cfg.h = Cfg.height
  43. Cfg.flip = 1
  44. Cfg.blur = 0
  45. Cfg.gaussian = 0
  46. Cfg.boxes = 60 # box num
  47. Cfg.TRAIN_EPOCHS = 300
  48. Cfg.train_label = os.path.join(_BASE_DIR, 'baby-yoda/train', 'train.txt')
  49. Cfg.val_label = os.path.join(_BASE_DIR, 'baby-yoda/train', 'val.txt')
  50. Cfg.TRAIN_OPTIMIZER = 'adam'
  51. '''
  52. image_path1 x1,y1,x2,y2,id x1,y1,x2,y2,id x1,y1,x2,y2,id ...
  53. image_path2 x1,y1,x2,y2,id x1,y1,x2,y2,id x1,y1,x2,y2,id ...
  54. ...
  55. '''
  56. if Cfg.mosaic and Cfg.cutmix:
  57. Cfg.mixup = 4
  58. elif Cfg.cutmix:
  59. Cfg.mixup = 2
  60. elif Cfg.mosaic:
  61. Cfg.mixup = 3
  62. Cfg.checkpoints = os.path.join(_BASE_DIR, 'checkpoints')
  63. Cfg.TRAIN_TENSORBOARD_DIR = os.path.join(_BASE_DIR, 'log')
  64. Cfg.iou_type = 'iou' # 'giou', 'diou', 'ciou'
  65. Cfg.keep_checkpoint_max = 10
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...