Unverified Commit 699cb914 authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

Format the code and add yapf to travis (#1079)

* format the codebase with yapf

* add yapf to travis
parent 86cc430a
......@@ -51,9 +51,9 @@ def plot_curve(log_dicts, args):
for j, metric in enumerate(metrics):
print('plot curve of {}, metric is {}'.format(
args.json_logs[i], metric))
assert metric in log_dict[epochs[
0]], '{} does not contain metric {}'.format(
args.json_logs[i], metric)
if metric not in log_dict[epochs[0]]:
raise KeyError('{} does not contain metric {}'.format(
args.json_logs[i], metric))
if 'mAP' in metric:
xs = np.arange(1, max(epochs) + 1)
......
......@@ -69,16 +69,17 @@ def cvt_annotations(devkit_path, years, split, out_file):
years = [years]
annotations = []
for year in years:
filelist = osp.join(devkit_path, 'VOC{}/ImageSets/Main/{}.txt'.format(
year, split))
filelist = osp.join(devkit_path,
'VOC{}/ImageSets/Main/{}.txt'.format(year, split))
if not osp.isfile(filelist):
print('filelist does not exist: {}, skip voc{} {}'.format(
filelist, year, split))
return
img_names = mmcv.list_from_file(filelist)
xml_paths = [
osp.join(devkit_path, 'VOC{}/Annotations/{}.xml'.format(
year, img_name)) for img_name in img_names
osp.join(devkit_path,
'VOC{}/Annotations/{}.xml'.format(year, img_name))
for img_name in img_names
]
img_paths = [
'VOC{}/JPEGImages/{}.jpg'.format(year, img_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment