Skip to content

Commit

Permalink
update infos
Browse files Browse the repository at this point in the history
  • Loading branch information
wudongming committed Oct 11, 2023
1 parent b50e94b commit 346bedc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 53 deletions.
32 changes: 0 additions & 32 deletions projects/topomlp/datasets/openlane_v2_dataset_subset_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,38 +184,6 @@ def get_ann_info(self, index):
'gt_topology_lclc': gt_topology_lclc,
'gt_topology_lcte': gt_topology_lcte,
}

def get_ann_info_resample(self, index, data_infos):

split, segment_id, timestamp = data_infos[index]
frame = self.collection.get_frame_via_identifier((split, segment_id, timestamp))

gt_lc = np.array([lc['points'] for lc in frame.get_annotations_lane_centerlines()], dtype=np.float32)
gt_lc_labels = np.zeros((len(gt_lc), ), dtype=np.int64)

gt_te = np.array([element['points'].flatten() for element in frame.get_annotations_traffic_elements()], dtype=np.float32).reshape(-1, 4)
gt_te_labels = np.array([element['attribute']for element in frame.get_annotations_traffic_elements()], dtype=np.int64)

gt_topology_lclc = frame.get_annotations_topology_lclc()
gt_topology_lcte = frame.get_annotations_topology_lcte()

# if str(segment_id) == '10003':
# print(split)
# print(segment_id)
# print(timestamp)
# print(gt_topology_lcte)

assert gt_lc.shape[0] == gt_topology_lclc.shape[0] == gt_topology_lclc.shape[1] == gt_topology_lcte.shape[0]
assert gt_te.shape[0] == gt_topology_lcte.shape[1]

return {
'gt_lc': gt_lc,
'gt_lc_labels': gt_lc_labels,
'gt_te': gt_te,
'gt_te_labels': gt_te_labels,
'gt_topology_lclc': gt_topology_lclc,
'gt_topology_lcte': gt_topology_lcte,
}

def pre_pipeline(self, results):
pass
Expand Down
20 changes: 1 addition & 19 deletions projects/topomlp/models/detectors/topomlp.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
# ==============================================================================
# Binaries and/or source for the following packages or projects
# are presented under one or more of the following open source licenses:
# baseline.py The OpenLane-V2 Dataset Authors Apache License, Version 2.0
#
# Contact [email protected] if you have any issue.
#
# Copyright (c) 2023 The OpenLane-v2 Dataset Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This module is for the implementation of TopoMLP.
# ==============================================================================

import torch
Expand Down
8 changes: 7 additions & 1 deletion projects/topomlp/models/heads/lane_head.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Copyright (c) OpenMMLab. All rights reserved.
# ------------------------------------------------------------------------
# Modified from PETRv2 (https://github.com/megvii-research/PETR)
# Copyright (c) 2022 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from OpenLane-V2 (https://github.com/OpenDriveLab/OpenLane-V2)
# Copyright (c) The OpenLane-V2 Dataset Authors. All rights reserved.
# ------------------------------------------------------------------------
import torch
import torch.nn as nn
import torch.nn.functional as F
Expand Down
2 changes: 1 addition & 1 deletion projects/topomlp/models/heads/traffic_head.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Modified from OpenLane-v2 Dataset
# Modified from OpenLane-V2 (https://github.com/OpenDriveLab/OpenLane-V2)
# ==============================================================================

import copy
Expand Down

0 comments on commit 346bedc

Please sign in to comment.