Owen-Liuyuxuan / visualDet3D

Official Repo for Ground-aware Monocular 3D Object Detection for Autonomous Driving / YOLOStereo3D: A Step Back to 2D for Efficient Stereo 3D Detection
https://owen-liuyuxuan.github.io/papers_reading_sharing.github.io/3dDetection/GroundAwareConvultion/
Apache License 2.0
362 stars 77 forks source link

Model settings for pedestrian and cyclist. #17

Closed gujiaqivadin closed 3 years ago

gujiaqivadin commented 3 years ago

Hello, LYX! Thanks for your great work in mono3d detection. As in your paper, your work also gets competitative performance in ped/cyc classes. Can you release the config setting file of these two kind categories? Or can you tell me what should i rectify in your yolo3d_example to fit ped/cyc class? Thanks a lot!

Owen-Liuyuxuan commented 3 years ago
cfg.obj_types = ['Car', 'Pedestrian', 'Cyclist'] # line6
balance_weight   = [20.0, 40.0, 40.0], # line 129
'ratios': np.array([0.5, 1, 2.0]),  #line 145

You could also fine-tune the learning rate according to the changes in anchor number.

The result I get: for car type the result will be lower, for ped type the result is quite good, for cyclist the result is not good.

shliang0603 commented 2 years ago

@Owen-Liuyuxuan 你好,我在测试只有Car一个类别的时候没有问题,然后我想测试3个类别,就按照你上面的提示,在Yolo3D_example.py文件中修改了对应的三行代码,然后报错如下:

(yolov4) shl@zhihui-mint:~/Disk2/3_proj/visualDet3D$ ./launchers/eval.sh config/Yolo3D_example.py 0 workdirs/Mono3D/checkpoint/GroundAware_pretrained.pth test
CUDA available: True
Traceback (most recent call last):
  File "scripts/eval.py", line 55, in <module>
    fire.Fire(main)
  File "/home/shl/anaconda3/envs/yolov4/lib/python3.6/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/shl/anaconda3/envs/yolov4/lib/python3.6/site-packages/fire/core.py", line 471, in _Fire
    target=component.__name__)
  File "/home/shl/anaconda3/envs/yolov4/lib/python3.6/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "scripts/eval.py", line 37, in main
    detector = DETECTOR_DICT[cfg.detector.name](cfg.detector)
  File "/media/shl/2b7567a9-ed41-40af-8673-4d47b46a0f32/home/zhihui/Disk2/3_proj/visualDet3D/visualDet3D/networks/detectors/yolomono3d_detector.py", line 65, in __init__
    self.build_head(network_cfg)
  File "/media/shl/2b7567a9-ed41-40af-8673-4d47b46a0f32/home/zhihui/Disk2/3_proj/visualDet3D/visualDet3D/networks/detectors/yolomono3d_detector.py", line 137, in build_head
    **(network_cfg.head)
  File "/media/shl/2b7567a9-ed41-40af-8673-4d47b46a0f32/home/zhihui/Disk2/3_proj/visualDet3D/visualDet3D/networks/heads/detection_3d_head.py", line 32, in __init__
    self.anchors = Anchors(preprocessed_path=preprocessed_path, readConfigFile=read_precompute_anchor, **anchors_cfg)
  File "/media/shl/2b7567a9-ed41-40af-8673-4d47b46a0f32/home/zhihui/Disk2/3_proj/visualDet3D/visualDet3D/networks/heads/anchors.py", line 36, in __init__
    self.anchors_mean_original[i]  = np.load(npy_file) #[30, 2, 6] #[z,  sinalpha, cosalpha, w, h, l,]
ValueError: could not broadcast input array from shape (16,2,6) into shape (16,3,6)
(yolov4) shl@zhihui-mint:~/Disk2/3_proj/visualDet3D$ 

请问这个错误是需要修改anchor_mean_Car.npyanchor_std_Car.npy 这两个文件吗,我目前不知道怎么解决这个问题,还希望你可以抽空帮忙一下,谢谢啦