|
| 1 | +# ============================================================================== |
| 2 | +# Binaries and/or source for the following packages or projects |
| 3 | +# are presented under one or more of the following open source licenses: |
| 4 | +# preprocess.py The OpenLane-V2 Dataset Authors Apache License, Version 2.0 |
| 5 | +# |
| 6 | +# Contact wanghuijie@pjlab.org.cn if you have any issue. |
| 7 | +# |
| 8 | +# Copyright (c) 2023 The OpenLane-v2 Dataset Authors. All Rights Reserved. |
| 9 | +# |
| 10 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 11 | +# you may not use this file except in compliance with the License. |
| 12 | +# You may obtain a copy of the License at |
| 13 | +# |
| 14 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | +# |
| 16 | +# Unless required by applicable law or agreed to in writing, software |
| 17 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | +# See the License for the specific language governing permissions and |
| 20 | +# limitations under the License. |
| 21 | +# ==============================================================================' |
| 22 | + |
| 23 | +from openlanev2.centerline.io import io |
| 24 | +from openlanev2.lanesegment.preprocessing import collect |
| 25 | + |
| 26 | + |
| 27 | +with_sd_map = False # TODO: include SD Maps as sensor inputs or not |
| 28 | + |
| 29 | +root_path = './OpenLane-V2' |
| 30 | +for file in io.os_listdir(root_path): |
| 31 | + if file.endswith('json'): |
| 32 | + subset = file.split('.')[0] |
| 33 | + for split, segments in io.json_load(f'{root_path}/{file}').items(): |
| 34 | + collect( |
| 35 | + root_path, |
| 36 | + {split: segments}, |
| 37 | + f'{subset}_{split}_ls' if not with_sd_map else f'{subset}_{split}_ls_sd', |
| 38 | + with_sd_map = with_sd_map, |
| 39 | + n_points={ |
| 40 | + 'area': 20, |
| 41 | + 'centerline': 10, |
| 42 | + 'left_laneline': 20, |
| 43 | + 'right_laneline': 20, |
| 44 | + }, |
| 45 | + ) |
0 commit comments