"tests/vscode:/vscode.git/clone" did not exist on "ecfbc8f952fb20b47d2f85695e98d64c2f5b219a"
Unverified Commit b84111d8 authored by Yezhen Cong's avatar Yezhen Cong Committed by GitHub
Browse files

[Fix] Add a file and instructions to fix the Lyft dataset (#546)

* Add Lyft fixer file and instructions

* Restore Lyft split files
parent eb77ff16
...@@ -115,9 +115,10 @@ Download Lyft 3D detection data [HERE](https://www.kaggle.com/c/3d-object-detect ...@@ -115,9 +115,10 @@ Download Lyft 3D detection data [HERE](https://www.kaggle.com/c/3d-object-detect
```bash ```bash
python tools/create_data.py lyft --root-path ./data/lyft --out-dir ./data/lyft --extra-tag lyft --version v1.01 python tools/create_data.py lyft --root-path ./data/lyft --out-dir ./data/lyft --extra-tag lyft --version v1.01
python tools/data_converter/lyft_data_fixer.py --version v1.01 --root-folder ./data/lyft
``` ```
Note that we follow the original folder names for clear organization. Please rename the raw folders as shown above. Note that we follow the original folder names for clear organization. Please rename the raw folders as shown above. Also note that the second command serves the purpose of fixing a corrupted lidar data file. Please refer to the discussion [here](https://www.kaggle.com/c/3d-object-detection-for-autonomous-vehicles/discussion/110000) for more details.
### S3DIS, ScanNet and SUN RGB-D ### S3DIS, ScanNet and SUN RGB-D
......
import argparse
import numpy as np
import os
def fix_lyft(root_folder='./data/lyft', version='v1.01'):
# refer to https://www.kaggle.com/c/3d-object-detection-for-autonomous-vehicles/discussion/110000 # noqa
lidar_path = 'lidar/host-a011_lidar1_1233090652702363606.bin'
root_folder = os.path.join(root_folder, f'{version}-train')
lidar_path = os.path.join(root_folder, lidar_path)
assert os.path.isfile(lidar_path), f'Please download the complete Lyft ' \
f'dataset and make sure {lidar_path} is present.'
points = np.fromfile(lidar_path, dtype=np.float32, count=-1)
try:
points.reshape([-1, 5])
print(f'This fix is not required for version {version}.')
except ValueError:
new_points = np.array(list(points) + [100.0, 1.0], dtype='float32')
new_points.tofile(lidar_path)
print(f'Appended 100.0 and 1.0 to the end of {lidar_path}.')
parser = argparse.ArgumentParser(description='Lyft dataset fixer arg parser')
parser.add_argument(
'--root-folder',
type=str,
default='./data/lyft',
help='specify the root path of Lyft dataset')
parser.add_argument(
'--version',
type=str,
default='v1.01',
help='specify Lyft dataset version')
args = parser.parse_args()
if __name__ == '__main__':
fix_lyft(root_folder=args.root_folder, version=args.version)
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