Skip to content

Commit

Permalink
update kitti eval, test seg
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhett98 committed Jan 30, 2024
1 parent ee406df commit 9a7cf4a
Show file tree
Hide file tree
Showing 21 changed files with 23,611 additions and 419 deletions.
6 changes: 3 additions & 3 deletions configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def dynamic_seg_args():
parser.add_argument('--gpu', type=int, default=0, help='GPU to use [default: GPU 3]')
parser.add_argument('--multi_gpu', type=str, default=None, help='The gpu [default : null]')
parser.add_argument('--limit_or_filter', type=bool, default=True, help='if False, filter will reserve 40m~50m points')
parser.add_argument('--batch_size', type=int, default=1, help='Batch Size during training [default: 16]')
parser.add_argument('--batch_size', type=int, default=2, help='Batch Size during training [default: 16]')
parser.add_argument('--eval_batch_size', type=int, default=2, help='Batch Size during evaling [default: 64]')
parser.add_argument('--eval_before', type=int, default=0, help='if 1, eval before train')

Expand Down Expand Up @@ -56,7 +56,7 @@ def dynamic_seg_school_args():
parser.add_argument('--gpu', type=int, default=0, help='GPU to use [default: GPU 3]')
parser.add_argument('--multi_gpu', type=str, default=None, help='The gpu [default : null]')
parser.add_argument('--limit_or_filter', type=bool, default=True, help='if False, filter will reserve 40m~50m points')
parser.add_argument('--batch_size', type=int, default=1, help='Batch Size during training [default: 16]')
parser.add_argument('--batch_size', type=int, default=2, help='Batch Size during training [default: 16]')
parser.add_argument('--eval_batch_size', type=int, default=2, help='Batch Size during evaling [default: 64]')
parser.add_argument('--eval_before', type=int, default=0, help='if 1, eval before train')

Expand Down Expand Up @@ -178,7 +178,7 @@ def odometry_school_args():
parser.add_argument('--gpu', type=int, default=0, help='GPU to use [default: GPU 3]')
parser.add_argument('--multi_gpu', type=str, default=None, help='The gpu [default : null]')
parser.add_argument('--limit_or_filter', type=bool, default=True, help='if False, filter will reserve 40m~50m points')
parser.add_argument('--batch_size', type=int, default=1, help='Batch Size during training [default: 16]')
parser.add_argument('--batch_size', type=int, default=2, help='Batch Size during training [default: 16]')
parser.add_argument('--eval_batch_size', type=int, default=1, help='Batch Size during evaling [default: 64]')
parser.add_argument('--eval_before', type=int, default=1, help='if 1, eval before train')

Expand Down
413 changes: 210 additions & 203 deletions evaluation.py

Large diffs are not rendered by default.

4,541 changes: 4,541 additions & 0 deletions ground_truth_pose/00.txt

Large diffs are not rendered by default.

1,101 changes: 1,101 additions & 0 deletions ground_truth_pose/01.txt

Large diffs are not rendered by default.

4,661 changes: 4,661 additions & 0 deletions ground_truth_pose/02.txt

Large diffs are not rendered by default.

801 changes: 801 additions & 0 deletions ground_truth_pose/03.txt

Large diffs are not rendered by default.

271 changes: 271 additions & 0 deletions ground_truth_pose/04.txt

Large diffs are not rendered by default.

2,761 changes: 2,761 additions & 0 deletions ground_truth_pose/05.txt

Large diffs are not rendered by default.

1,101 changes: 1,101 additions & 0 deletions ground_truth_pose/06.txt

Large diffs are not rendered by default.

1,101 changes: 1,101 additions & 0 deletions ground_truth_pose/07.txt

Large diffs are not rendered by default.

4,071 changes: 4,071 additions & 0 deletions ground_truth_pose/08.txt

Large diffs are not rendered by default.

1,591 changes: 1,591 additions & 0 deletions ground_truth_pose/09.txt

Large diffs are not rendered by default.

1,201 changes: 1,201 additions & 0 deletions ground_truth_pose/10.txt

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions infer_pwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def main():

global args

eval_list = [0,1, 2,3,4, 5, 6, 7, 8,9,10]#[0, 1, 2, 3, 4, 5, 6]
# eval_list = [0,1, 2,3,4, 5, 6, 7, 8,9,10]
eval_list = [3]

logger = creat_logger(log_dir, args.model_name)
logger.info('----------------------------------------TRAINING----------------------------------')
Expand Down Expand Up @@ -173,7 +174,7 @@ def main():
os.makedirs(data_dir)
np.save(fname_file, T)
np.savetxt(fname_txt, T)
os.system('cp %s %s' % (fname_file, data_dir)) ###SAVE THE txt FILE
os.system('cp %s %s' % (fname_txt, data_dir)) ###SAVE THE txt FILE
# print('python evaluation.py --result_dir ' + data_dir + ' --eva_seqs ' + str(item).zfill(2) + '_pred')
os.system('python evaluation.py --result_dir ' + data_dir + ' --eva_seqs ' + str(item).zfill(2) + '_pred')

Expand Down
2 changes: 1 addition & 1 deletion infer_pwc_school_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main():

global args

eval_list = [0]
eval_list = [3]

logger = creat_logger(log_dir, args.model_name)
logger.info('----------------------------------------TRAINING----------------------------------')
Expand Down
6 changes: 5 additions & 1 deletion kitti_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def __init__(self, is_training: int = 1, num_point: int = 24000, data_dir_list:

self.data_list = data_dir_list
self.lidar_root = config.lidar_root
self.data_len_sequence = [5836,4814]
self.data_len_sequence = [5836,4814,3736,5448]
# self.mean = [0.485, 0.456, 0.406]
# self.std = [0.229, 0.224, 0.225]

Expand Down Expand Up @@ -671,6 +671,10 @@ def get_index(self, value, mylist):
cb+=1
if i == 2:
cc+=1
# if cb == 0:
# print("no static:",sample_id)
# if cc == 0:
# print("no dynamic:",sample_id)
total_static_p+=cb
total_moving_p+=cc
# print("num of point: ", ca, cb, cc)
Expand Down
127 changes: 122 additions & 5 deletions tools/dataset_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,149 @@ labels:
1 : "outlier"
9 : "static" # for lidar-mos static
10: "car"
11: "bicycle"
13: "bus"
15: "motorcycle"
16: "on-rails"
18: "truck"
20: "other-vehicle"
30: "person"
31: "bicyclist"
32: "motorcyclist"
40: "road"
44: "parking"
48: "sidewalk"
49: "other-ground"
50: "building"
51: "fence"
52: "other-structure"
60: "lane-marking"
70: "vegetation"
71: "trunk"
72: "terrain"
80: "pole"
81: "traffic-sign"
99: "other-object"
251: "moving" # lidar-mos moving
252: "moving-car"
253: "moving-bicyclist"
254: "moving-person"
255: "moving-motorcyclist"
256: "moving-on-rails"
257: "moving-bus"
258: "moving-truck"
259: "moving-other-vehicle"
color_map: # bgr
0 : [0, 0, 0]
1 : [0, 0, 0] # [0, 0, 255]
9 : [0, 0, 0] # for lidar-mos static
10: [245, 150, 100]
11: [245, 230, 100]
13: [250, 80, 100]
15: [150, 60, 30]
16: [255, 0, 0]
18: [180, 30, 80]
20: [255, 0, 0]
30: [30, 30, 255]
31: [200, 40, 255]
32: [90, 30, 150]
40: [255, 0, 255]
44: [255, 150, 255]
48: [75, 0, 75]
49: [75, 0, 175]
50: [0, 200, 255]
51: [50, 120, 255]
52: [0, 150, 255]
60: [170, 255, 150]
70: [0, 175, 0]
71: [0, 60, 135]
72: [80, 240, 150]
80: [150, 240, 255]
81: [0, 0, 255]
99: [255, 255, 50]
251: [0, 0, 255] # lidar-mos moving
252: [245, 150, 100]
256: [255, 0, 0]
253: [200, 40, 255]
254: [30, 30, 255]
255: [90, 30, 150]
257: [250, 80, 100]
258: [180, 30, 80]
259: [255, 0, 0]
content: # as a ratio with the total number of points
0: 0
10: 0
99: 0.987640703
252: 0.01235929297
0: 0.018889854628292943
1: 0.0002937197336781505
10: 0.040818519255974316
11: 0.00016609538710764618
13: 2.7879693665067774e-05
15: 0.00039838616015114444
16: 0.0
18: 0.0020633612104619787
20: 0.0016218197275284021
30: 0.00017698551338515307
31: 1.1065903904919655e-08
32: 5.532951952459828e-09
40: 0.1987493871255525
44: 0.014717169549888214
48: 0.14392298360372
49: 0.0039048553037472045
50: 0.1326861944777486
51: 0.0723592229456223
52: 0.002395131480328884
60: 4.7084144280367186e-05
70: 0.26681502148037506
71: 0.006035012012626033
72: 0.07814222006271769
80: 0.002855498193863172
81: 0.0006155958086189918
99: 0.009923127583046915
252: 0.001789309418528068
253: 0.00012709999297008662
254: 0.00016059776092534436
255: 3.745553104802113e-05
256: 0.0
257: 0.00011351574470342043
258: 0.00010157861367183268
259: 4.3840131989471124e-05
# classes that are indistinguishable from single scan or inconsistent in
# ground truth are mapped to their closest equivalent
learning_map:
0 : 0 # "unlabeled" mapped to "unlabeled" ------------------------mapped
1 : 0 # "outlier" mapped to "unlabeled" ------------------------mapped
9 : 1 # "static" mapped to "static" ---------------------------mapped
10: 1 # "car" mapped to "static" ---------------------------mapped
10: 2 # "car" mapped to "static" ---------------------------mapped
11: 1 # "bicycle" mapped to "static" ---------------------------mapped
13: 1 # "bus" mapped to "static" ---------------------------mapped
15: 1 # "motorcycle" mapped to "static" ---------------------------mapped
16: 1 # "on-rails" mapped to "static" ---------------------------mapped
18: 1 # "truck" mapped to "static" ---------------------------mapped
20: 1 # "other-vehicle" mapped to "static" ---------------------------mapped
30: 1 # "person" mapped to "static" ---------------------------mapped
31: 1 # "bicyclist" mapped to "static" ---------------------------mapped
32: 1 # "motorcyclist" mapped to "static" ---------------------------mapped
40: 1 # "road" mapped to "static" ---------------------------mapped
44: 1 # "parking" mapped to "static" ---------------------------mapped
48: 1 # "sidewalk" mapped to "static" ---------------------------mapped
49: 1 # "other-ground" mapped to "static" ---------------------------mapped
50: 1 # "building" mapped to "static" ---------------------------mapped
51: 1 # "fence" mapped to "static" ---------------------------mapped
52: 1 # "other-structure" mapped to "static" ---------------------------mapped
60: 1 # "lane-marking" mapped to "static" ---------------------------mapped
70: 1 # "vegetation" mapped to "static" ---------------------------mapped
71: 1 # "trunk" mapped to "static" ---------------------------mapped
72: 1 # "terrain" mapped to "static" ---------------------------mapped
80: 1 # "pole" mapped to "static" ---------------------------mapped
81: 1 # "traffic-sign" mapped to "static" ---------------------------mapped
99: 1 # "other-object" mapped to "static" ---------------------------mapped
251: 2 # "moving" mapped to "moving" ---------------------------mapped
252: 2 # "moving-car" mapped to "moving" ---------------------------mapped
253: 2 # "moving-bicyclist" mapped to "moving" ---------------------------mapped
254: 2 # "moving-person" mapped to "moving" ---------------------------mapped
255: 2 # "moving-motorcyclist" mapped to "moving" ---------------------------mapped
256: 2 # "moving-on-rails" mapped to "moving" ---------------------------mapped
257: 2 # "moving-bus" mapped to "moving" ---------------------------mapped
258: 2 # "moving-truck" mapped to "moving" ---------------------------mapped
259: 2 # "moving-other" mapped to "moving" ---------------------------mapped
learning_map_inv: # inverse of previous map
0: 0 # "unlabeled", and others ignored
1: 9 # "static"
Expand Down
125 changes: 4 additions & 121 deletions tools/dataset_config_school.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,149 +5,32 @@ labels:
1 : "outlier"
9 : "static" # for lidar-mos static
10: "car"
11: "bicycle"
13: "bus"
15: "motorcycle"
16: "on-rails"
18: "truck"
20: "other-vehicle"
30: "person"
31: "bicyclist"
32: "motorcyclist"
40: "road"
44: "parking"
48: "sidewalk"
49: "other-ground"
50: "building"
51: "fence"
52: "other-structure"
60: "lane-marking"
70: "vegetation"
71: "trunk"
72: "terrain"
80: "pole"
81: "traffic-sign"
99: "other-object"
251: "moving" # lidar-mos moving
252: "moving-car"
253: "moving-bicyclist"
254: "moving-person"
255: "moving-motorcyclist"
256: "moving-on-rails"
257: "moving-bus"
258: "moving-truck"
259: "moving-other-vehicle"
color_map: # bgr
0 : [0, 0, 0]
1 : [0, 0, 0] # [0, 0, 255]
9 : [0, 0, 0] # for lidar-mos static
10: [245, 150, 100]
11: [245, 230, 100]
13: [250, 80, 100]
15: [150, 60, 30]
16: [255, 0, 0]
18: [180, 30, 80]
20: [255, 0, 0]
30: [30, 30, 255]
31: [200, 40, 255]
32: [90, 30, 150]
40: [255, 0, 255]
44: [255, 150, 255]
48: [75, 0, 75]
49: [75, 0, 175]
50: [0, 200, 255]
51: [50, 120, 255]
52: [0, 150, 255]
60: [170, 255, 150]
70: [0, 175, 0]
71: [0, 60, 135]
72: [80, 240, 150]
80: [150, 240, 255]
81: [0, 0, 255]
99: [255, 255, 50]
251: [0, 0, 255] # lidar-mos moving
252: [245, 150, 100]
256: [255, 0, 0]
253: [200, 40, 255]
254: [30, 30, 255]
255: [90, 30, 150]
257: [250, 80, 100]
258: [180, 30, 80]
259: [255, 0, 0]
content: # as a ratio with the total number of points
0: 0.018889854628292943
1: 0.0002937197336781505
10: 0.040818519255974316
11: 0.00016609538710764618
13: 2.7879693665067774e-05
15: 0.00039838616015114444
16: 0.0
18: 0.0020633612104619787
20: 0.0016218197275284021
30: 0.00017698551338515307
31: 1.1065903904919655e-08
32: 5.532951952459828e-09
40: 0.1987493871255525
44: 0.014717169549888214
48: 0.14392298360372
49: 0.0039048553037472045
50: 0.1326861944777486
51: 0.0723592229456223
52: 0.002395131480328884
60: 4.7084144280367186e-05
70: 0.26681502148037506
71: 0.006035012012626033
72: 0.07814222006271769
80: 0.002855498193863172
81: 0.0006155958086189918
99: 0.009923127583046915
252: 0.001789309418528068
253: 0.00012709999297008662
254: 0.00016059776092534436
255: 3.745553104802113e-05
256: 0.0
257: 0.00011351574470342043
258: 0.00010157861367183268
259: 4.3840131989471124e-05
0: 0
10: 0
99: 0.992517993
252: 0.0074820062
# classes that are indistinguishable from single scan or inconsistent in
# ground truth are mapped to their closest equivalent
learning_map:
0 : 0 # "unlabeled" mapped to "unlabeled" ------------------------mapped
1 : 0 # "outlier" mapped to "unlabeled" ------------------------mapped
9 : 1 # "static" mapped to "static" ---------------------------mapped
10: 2 # "car" mapped to "static" ---------------------------mapped
11: 1 # "bicycle" mapped to "static" ---------------------------mapped
13: 1 # "bus" mapped to "static" ---------------------------mapped
15: 1 # "motorcycle" mapped to "static" ---------------------------mapped
16: 1 # "on-rails" mapped to "static" ---------------------------mapped
18: 1 # "truck" mapped to "static" ---------------------------mapped
20: 1 # "other-vehicle" mapped to "static" ---------------------------mapped
30: 1 # "person" mapped to "static" ---------------------------mapped
31: 1 # "bicyclist" mapped to "static" ---------------------------mapped
32: 1 # "motorcyclist" mapped to "static" ---------------------------mapped
40: 1 # "road" mapped to "static" ---------------------------mapped
44: 1 # "parking" mapped to "static" ---------------------------mapped
48: 1 # "sidewalk" mapped to "static" ---------------------------mapped
49: 1 # "other-ground" mapped to "static" ---------------------------mapped
50: 1 # "building" mapped to "static" ---------------------------mapped
51: 1 # "fence" mapped to "static" ---------------------------mapped
52: 1 # "other-structure" mapped to "static" ---------------------------mapped
60: 1 # "lane-marking" mapped to "static" ---------------------------mapped
70: 1 # "vegetation" mapped to "static" ---------------------------mapped
71: 1 # "trunk" mapped to "static" ---------------------------mapped
72: 1 # "terrain" mapped to "static" ---------------------------mapped
80: 1 # "pole" mapped to "static" ---------------------------mapped
81: 1 # "traffic-sign" mapped to "static" ---------------------------mapped
99: 1 # "other-object" mapped to "static" ---------------------------mapped
251: 2 # "moving" mapped to "moving" ---------------------------mapped
252: 2 # "moving-car" mapped to "moving" ---------------------------mapped
253: 2 # "moving-bicyclist" mapped to "moving" ---------------------------mapped
254: 2 # "moving-person" mapped to "moving" ---------------------------mapped
255: 2 # "moving-motorcyclist" mapped to "moving" ---------------------------mapped
256: 2 # "moving-on-rails" mapped to "moving" ---------------------------mapped
257: 2 # "moving-bus" mapped to "moving" ---------------------------mapped
258: 2 # "moving-truck" mapped to "moving" ---------------------------mapped
259: 2 # "moving-other" mapped to "moving" ---------------------------mapped
learning_map_inv: # inverse of previous map
0: 0 # "unlabeled", and others ignored
1: 9 # "static"
Expand Down
2 changes: 1 addition & 1 deletion train_pillar_raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ioueval import iouEval
from pointpillar_encoder import PillarLayer

f = open('dataset_config.yaml')
f = open('tools/ataset_config.yaml')
dataset_config = yaml.load(f, Loader=yaml.FullLoader)

args = dynamic_seg_args()
Expand Down
Loading

0 comments on commit 9a7cf4a

Please sign in to comment.