"docs/vscode:/vscode.git/clone" did not exist on "282681b8a15affd7f7d9e16584c38954ba4e8413"
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): ...@@ -51,9 +51,9 @@ def plot_curve(log_dicts, args):
for j, metric in enumerate(metrics): for j, metric in enumerate(metrics):
print('plot curve of {}, metric is {}'.format( print('plot curve of {}, metric is {}'.format(
args.json_logs[i], metric)) args.json_logs[i], metric))
assert metric in log_dict[epochs[ if metric not in log_dict[epochs[0]]:
0]], '{} does not contain metric {}'.format( raise KeyError('{} does not contain metric {}'.format(
args.json_logs[i], metric) args.json_logs[i], metric))
if 'mAP' in metric: if 'mAP' in metric:
xs = np.arange(1, max(epochs) + 1) xs = np.arange(1, max(epochs) + 1)
......
...@@ -69,16 +69,17 @@ def cvt_annotations(devkit_path, years, split, out_file): ...@@ -69,16 +69,17 @@ def cvt_annotations(devkit_path, years, split, out_file):
years = [years] years = [years]
annotations = [] annotations = []
for year in years: for year in years:
filelist = osp.join(devkit_path, 'VOC{}/ImageSets/Main/{}.txt'.format( filelist = osp.join(devkit_path,
year, split)) 'VOC{}/ImageSets/Main/{}.txt'.format(year, split))
if not osp.isfile(filelist): if not osp.isfile(filelist):
print('filelist does not exist: {}, skip voc{} {}'.format( print('filelist does not exist: {}, skip voc{} {}'.format(
filelist, year, split)) filelist, year, split))
return return
img_names = mmcv.list_from_file(filelist) img_names = mmcv.list_from_file(filelist)
xml_paths = [ xml_paths = [
osp.join(devkit_path, 'VOC{}/Annotations/{}.xml'.format( osp.join(devkit_path,
year, img_name)) for img_name in img_names 'VOC{}/Annotations/{}.xml'.format(year, img_name))
for img_name in img_names
] ]
img_paths = [ img_paths = [
'VOC{}/JPEGImages/{}.jpg'.format(year, img_name) '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