Unverified Commit ba5fa548 authored by twang's avatar twang Committed by GitHub
Browse files

Fix a minor bug in json2csv of lyft dataset (#78)

* Fix a minor bug in json2csv of lyft dataset

* Fix variable names and minor hard code
parent f6a7d78c
...@@ -425,18 +425,16 @@ class LyftDataset(Custom3DDataset): ...@@ -425,18 +425,16 @@ class LyftDataset(Custom3DDataset):
pred_bboxes[..., 2] += pred_bboxes[..., 5] / 2 pred_bboxes[..., 2] += pred_bboxes[..., 5] / 2
show_result(points, gt_bboxes, pred_bboxes, out_dir, file_name) show_result(points, gt_bboxes, pred_bboxes, out_dir, file_name)
@staticmethod def json2csv(self, json_path, csv_savepath):
def json2csv(json_path, csv_savepath):
"""Convert the json file to csv format for submission. """Convert the json file to csv format for submission.
Args: Args:
json_path (str): Path of the result json file. json_path (str): Path of the result json file.
csv_savepath (str): Path to save the csv file. csv_savepath (str): Path to save the csv file.
""" """
with open(json_path, 'r') as f: results = mmcv.load(json_path)['results']
results = mmcv.load(f)['results'] sample_list_path = osp.join(self.data_root, 'sample_submission.csv')
csv_nopred = 'data/lyft/sample_submission.csv' data = pd.read_csv(sample_list_path)
data = pd.read_csv(csv_nopred)
Id_list = list(data['Id']) Id_list = list(data['Id'])
pred_list = list(data['PredictionString']) pred_list = list(data['PredictionString'])
cnt = 0 cnt = 0
......
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