1. Data Preprocessing
- https://www.nuscenes.org/nuscenes#download 에서 nuscenes raw data 다운(panoptic, all data)
- nuscenes_preprocess.sh
$raw_data_dir : 다운받은 nuscenes raw data폴더 지정. 이때 폴더 안에 maps, panoptic, samples, sweeps, v1.0-trainval있고, v1.0trainval 안에는 다음과 같은 json 파일 포함되어야 함.
$data_folder 에는 결과를 저장할 새로운 dir 경로를 지정하면 된다. 이 때, mode에 따라 구분하여 생성할 것.
3. detection
# for 2Hz detection file
python detection.py --raw_data_folder ${raw_data_dir} --data_folder ${data_dir_2hz} --det_name ${name} --file_path ${file_path} --mode 2hz --velo
# for 20Hz detection file
python detection.py --raw_data_folder ${raw_data_dir} --data_folder ${data_dir_20hz} --det_name ${name} --file_path ${file_path} --mode 20hz --velo
$data_folder : preprocess.sh에서 생성한 결과 폴더
$det_name : 결과 name(name으로 설정)
$file_path : detection 결과 저장할 path
python detection.py --raw_data_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes --data_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes\20hz --det_name name --file_path C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes\validation_10hz\detection_file.json --mode 20hz
2. Inference
$python main_nuscenes_10hz.py --name SimpleTrack10Hz --det_name name --config_path configs\nu_configs\giou.yaml --result_folder result --data_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes\20hz --process 1
$python main_nuscenes.py --name SimpleTrack2Hz --det_name name --config_path configs\nu_configs\giou.yaml --result_folder result --data_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes\2hz --process 1
3. Output Format
convert the output results in the SimpleTrack format into the .json format specified by the nuScenes officials.
$python nuscenes_result_creation.py --name SimpleTrack2Hz --result_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\SimpleTrack\result --data_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes\2hz
$python nuscenes_type_merge.py --name SimpleTrack2Hz --result_folder C:\Users\rosha\OneDrive\Desktop\AVE_Lab\SimpleTrack\result
4. Evaluation
https://github.com/nutonomy/nuscenes-devkit/tree/master/python-sdk/nuscenes/eval/tracking
prediction -> result_path
gt -> eval_path
parser.add_argument('result_path', type=str, help='The submission as a JSON file.')
parser.add_argument('--output_dir', type=str, default='~/nuscenes-metrics',
help='Folder to store result metrics, graphs and example visualizations.')
parser.add_argument('--eval_set', type=str, default='val',
help='Which dataset split to evaluate on, train, val or test.')
parser.add_argument('--dataroot', type=str, default='/data/sets/nuscenes',
help='Default nuScenes data directory.')
parser.add_argument('--version', type=str, default='v1.0-trainval',
help='Which version of the nuScenes dataset to evaluate on, e.g. v1.0-trainval.')
parser.add_argument('--config_path', type=str, default='',
help='Path to the configuration file.'
'If no path given, the NIPS 2019 configuration will be used.')
parser.add_argument('--render_curves', type=int, default=1,
help='Whether to render statistic curves to disk.')
parser.add_argument('--verbose', type=int, default=1,
help='Whether to print to stdout.')
parser.add_argument('--render_classes', type=str, default='', nargs='+',
help='For which classes we render tracking results to disk.')
(ab3dmot) C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes-devkit\python-sdk\nuscenes\eval\tracking>python evaluate.py --result_path C:\Users\rosha\OneDrive\Desktop\AVE_Lab\SimpleTrack\result\SimpleTrack2Hz\results\results.json --output_dir C:\Users\rosha\OneDrive\Desktop\AVE_Lab\evaluation --eval_set val --dataroot C:\Users\rosha\OneDrive\Desktop\AVE_Lab\nuscenes
오류 1.
ValueError: names2, nlevels5 Length of names must match number of levels in MultiIndex.
방안 : multi.py안의 self.nlevels를 2로 바꾸어주었음.
오류 2.
ValueError: Shape of passed values is (31, 4), indices imply (2, 4)
방안 : motmetrics 버전을 1.1.3으로 downgrade
'Code > 3D tracking' 카테고리의 다른 글
Simple Track Preprocessing (0) | 2023.10.04 |
---|---|
nuScenes tracking data (0) | 2023.10.03 |
Evaluation code (0) | 2023.09.18 |
Simple Track demo (0) | 2023.09.16 |
AB3DMOT evaluation code (0) | 2023.09.15 |