-
Notifications
You must be signed in to change notification settings - Fork 0
/
configs.py
47 lines (45 loc) · 2.44 KB
/
configs.py
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
YOLO_TYPE = "yolov4" # yolov4 or yolov3
YOLO_FRAMEWORK = "tf" # "tf" or "trt"
YOLO_V3_WEIGHTS = "model_data/yolov3.weights"
YOLO_V4_WEIGHTS = "model_data/yolov4.weights"
YOLO_V3_TINY_WEIGHTS = "model_data/yolov3-tiny.weights"
YOLO_V4_TINY_WEIGHTS = "model_data/yolov4-tiny.weights"
YOLO_TRT_QUANTIZE_MODE = "INT8" # INT8, FP16, FP32
YOLO_CUSTOM_WEIGHTS = True # "checkpoints/yolov3_custom" # used in evaluate_mAP.py and custom model detection, if not using leave False
YOLO_COCO_CLASSES = "model_data/coco/coco.names"
YOLO_STRIDES = [8, 16, 32]
YOLO_IOU_LOSS_THRESH = 0.6
YOLO_ANCHOR_PER_SCALE = 3
YOLO_MAX_BBOX_PER_SCALE = 100
YOLO_INPUT_SIZE = 832
YOLO_ANCHORS = [[[12, 16], [19, 36], [40, 28]],
[[36, 75], [76, 55], [72, 146]],
[[142, 110], [192, 243], [459, 401]]]
# Train options
# TRAIN_YOLO_TINY = False
# TRAIN_SAVE_BEST_ONLY = True # saves only best model according validation loss (True recommended)
# TRAIN_SAVE_CHECKPOINT = False # saves all best validated checkpoints in training process (may require a lot disk space) (False recommended)
TRAIN_CLASSES = "classes.txt"
# TRAIN_ANNOT_PATH = "model_data/kaggle/traffic_drum_train.txt"
TRAIN_LOGDIR = "log"
TRAIN_CHECKPOINTS_FOLDER = "/home/aaryaman_bhardwaj/Documents/ML/Yolo-v3/checkpoints"
TRAIN_MODEL_NAME = f"{YOLO_TYPE}_cone_1"
WEIGHTS_FILE = "/home/aaryaman_bhardwaj/Documents/ML/Yolo-v3/checkpoints/yolov4_cone_1"
# TRAIN_LOAD_IMAGES_TO_RAM = True # With True faster training, but need more RAM
# TRAIN_BATCH_SIZE = 2
# TRAIN_INPUT_SIZE = 832
# TRAIN_DATA_AUG = True
# TRAIN_TRANSFER = False
# TRAIN_FROM_CHECKPOINT = True # "checkpoints/yolov3_custom"
# TRAIN_LR_INIT = 1e-4
# TRAIN_LR_END = 1e-6
# TRAIN_WARMUP_EPOCHS = 2
# TRAIN_EPOCHS = 2
# TEST options
# TEST_ANNOT_PATH = "model_data/kaggle/traffic_drum_test.txt"
# TEST_BATCH_SIZE = TRAIN_BATCH_SIZE #2
# TEST_INPUT_SIZE = TRAIN_INPUT_SIZE #832
# TEST_DATA_AUG = True
TEST_DECTECTED_IMAGE_PATH = "IMAGES/temp_test_detected"
# TEST_SCORE_THRESHOLD = 0.55
# TEST_IOU_THRESHOLD = 0.6