Files
Photovoltaic_Fault_Detector/train_ssd.py

35 lines
943 B
Python
Raw Normal View History

2020-02-06 16:47:03 -03:00
import os
2020-02-19 20:05:14 -03:00
import argparse
2020-02-06 16:47:03 -03:00
def makedirs(path):
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
def _main_(args):
config_path = args.conf
output_path = args.output
makedirs(output_path)
print ('Training ssd')
2020-02-25 22:18:56 -03:00
os.system('python ssd_keras-master/train.py -c ' + config_path + ' > ' + output_path + '/ssd.output 2> ' + output_path +'/ssd.err')
2020-02-06 16:47:03 -03:00
print ('Testing ssd')
2020-02-25 22:18:56 -03:00
os.system('python ssd_keras-master/evaluate.py -c ' + config_path + ' > ' + output_path + '/ssd_test.output 2> ' + output_path +'/ssd_test.err')
2020-02-06 16:47:03 -03:00
if __name__ == '__main__':
argparser = argparse.ArgumentParser(description='train and evaluate ssd model on any dataset')
argparser.add_argument('-c', '--conf', help='path to configuration file')
argparser.add_argument('-o', '--output', help='path to save the experiment')
args = argparser.parse_args()
_main_(args)