-
Notifications
You must be signed in to change notification settings - Fork 2
/
train.py
36 lines (30 loc) · 1.25 KB
/
train.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
import shutil, os
from os import listdir
from os.path import isfile, join
import json
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--settings-path', type=str, default='SETTINGS.json', help='image size to create')
parser.add_argument('--clsbs-path', type=str, default='classification/cls_bs.json', help='classification batch size info for different models')
parser.add_argument('--detbs-path', type=str, default='detection/det_bs.json', help='detection batch size info for different models')
parser.add_argument('--debug', action='store_true', help='process only 100 images in debug mode')
opt = parser.parse_args()
print('\n\n')
print('#'*100)
print('#'*30, ' CLASSIFICATION ', '#'*52)
print('#'*100)
print('\n\n')
command = f'python train_cls.py --settings-path {opt.settings_path} --bs-path {opt.clsbs_path}'
if opt.debug:
command += ' --debug'
os.system(command)
print('\n\n')
print('#'*100)
print('#'*30, ' DETECTION ', '#'*52)
print('#'*100)
print('\n\n')
command = f'python train_det.py --settings-path {opt.settings_path} --bs-path {opt.detbs_path}'
if opt.debug:
command += ' --debug'
os.system(command)