Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about FCOS3D and PGD model 3D box #1024

Closed
Gewaihir opened this issue Nov 3, 2021 · 31 comments
Closed

Questions about FCOS3D and PGD model 3D box #1024

Gewaihir opened this issue Nov 3, 2021 · 31 comments
Assignees

Comments

@Gewaihir
Copy link

Gewaihir commented Nov 3, 2021

Dear author:
Hello,Thank you very much for the framework and model you published!
I trained the FCOS3D algorithm using KITTI data set as described in issue #865. The profile is the same as issue #865, training 72 epochs. After the training, I tested the trained weight model and PGD weight model respectively, and encountered two problems:
1、I ran into this on both models: too many 3D boxes:
FCOS3D:
000008_pred
PGD:
000008_pred
As you can see. They all detect too many 3D boxes. PGD even has a bunch of 3D boxes that shouldn't be there. What causes this problem? How to solve it?
2、I wrote test instructions to test according to the official documents and git instructions. Unfortunately, it can only be viewed and saved one by one. Batch tests cannot be completed, saved, and then viewed. Is there any solution to this problem? Maybe I'm not doing it right? I enclose mine here:
python tools/test.py configs/fcos3d/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_kitti-mono3d.py /media/lee/DATA/project/FCOS3D/latest.pth --show --show-dir /media/lee/DATA/project/dataset/FCOS
python tools/test.py configs/pgd/pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py checkpoints/pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d_20211022_102608-8a97533b.pth --show --show-dir /media/lee/DATA/project/dataset/PGD
I look forward to your early reply! Thank you very much.

@Tai-Wang
Copy link
Member

Tai-Wang commented Nov 3, 2021

  1. What nms_thr and score_thr do you set? This threshold can be tuned a little lower to suppress those low-quality predictions.
  2. The result of PGD is really strange. Maybe you can first try to tune that threshold, and we can further have a closer look at what happens (maybe you can also print the predicted boxes). From the visualization result, I guess it is due to terrible detection performance for cyclists and pedestrians. We can try to only visualize the result for cars.
  3. You can remove the option --show and the results will be saved automatically. After finishing the inference, you can then observe those results from your saving path.

@Tai-Wang Tai-Wang self-assigned this Nov 3, 2021
@Gewaihir
Copy link
Author

Gewaihir commented Nov 3, 2021

Thank you very much for your busy response. I'll retest as you say. I will give you timely feedback on the results.

@Gewaihir
Copy link
Author

Gewaihir commented Nov 4, 2021

Hello author:
I have modified the nms_thr and score_thr parameters as you suggested. Effective results have been achieved in FCOS3D and PGD. However, PGD still has additional 3D boxes. I'll show it below:
FCOS3D:
Origin nms_thr is 0.8 and score_thr is 0.05:
000008_pred
After the adjustment nms_thr is 0.7 and score_thr is 0.3:
000008_pred
PGD:
Origin nms_thr is 0.8 and score_thr is 0.01:
000008_pred
After the adjustment nms_thr is 0.8 and score_thr is 0.2:
000008_pred
Even more extreme adjustments nms_thr is 5 and score_thr is 0.2:
000008_pred
As you can see, no matter how PGD is tuned, there are always extra 3D boxes. Is there any solution to this situation?
The second problem is that I removed the --show option as you suggested. The test worked fine but the folder I specified with --show-dir didn't store any data. See the following figure for details:
2021-11-04 15-26-43
Is there any solution to this situation?
I look forward to your early reply! Thank you very much.

@Tai-Wang
Copy link
Member

Tai-Wang commented Nov 5, 2021

  1. Could please check which classes these false predictions are from? I guess they are cyclists/pedestrians predictions. If yes, just filter them because the training for these two classes is really unstable for mono3D on KITTI, and also I do not pay much attention to it.
  2. You can try with python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}' according to the documentation for visualization. It seems your command only supports LiDAR-based methods. If it can not work, I will have my colleagues further check the details carefully.

@Gewaihir
Copy link
Author

Gewaihir commented Nov 5, 2021

I see. I'll try again. Thank you very much! I will timely feedback the results.

@Gewaihir
Copy link
Author

Gewaihir commented Nov 9, 2021

Hello author:
I acted as you suggested. For the first question, I filtered the Pedestrian and Cyclist tags in PGD, leaving only the Car tags. But the extra boxes still exist, and adjusting nms_thr and score_thr has no effect. The result is shown below:
000008_pred
000028_pred

----------- AP11 Results ------------

Car AP11@0.70, 0.70, 0.70:
bbox AP11:3.7567, 13.6954, 13.6954
bev  AP11:2.0669, 3.5100, 3.5100
3d   AP11:2.0459, 2.2684, 2.2684
aos  AP11:3.76, 13.69, 13.69
Car AP11@0.70, 0.50, 0.50:
bbox AP11:3.7567, 13.6954, 13.6954
bev  AP11:3.7567, 13.6954, 13.6954
3d   AP11:3.7567, 13.6954, 13.6954
aos  AP11:3.76, 13.69, 13.69

----------- AP40 Results ------------

Car AP40@0.70, 0.70, 0.70:
bbox AP40:2.7031, 5.6306, 5.6306
bev  AP40:1.2588, 2.4493, 2.4493
3d   AP40:1.2414, 1.9583, 1.9583
aos  AP40:2.70, 5.63, 5.63
Car AP40@0.70, 0.50, 0.50:
bbox AP40:2.7031, 5.6306, 5.6306
bev  AP40:2.5015, 5.3571, 5.3571
3d   AP40:2.5015, 5.3571, 5.3571
aos  AP40:2.70, 5.63, 5.63

Results of img_bbox2d:

----------- AP11 Results ------------

Car AP11@0.70, 0.70, 0.70:
bbox AP11:3.7567, 13.6954, 13.6954
Car AP11@0.70, 0.50, 0.50:
bbox AP11:3.7567, 13.6954, 13.6954

----------- AP40 Results ------------

Car AP40@0.70, 0.70, 0.70:
bbox AP40:2.7031, 5.6306, 5.6306
Car AP40@0.70, 0.50, 0.50:
bbox AP40:2.7031, 5.6306, 5.6306

And as you can see, the detection accuracy is also very low. What are the reasons for these two situations? What's the solution?

For the second question, I conducted the test according to the format you provided. Unfortunately, there is still no way to save the result file. Here's an example:
2021-11-05 14-46-36
And the test program runs to the end, will appear the following error:
2021-11-08 11-47-34
Below is the error report and error source code:

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 230, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 217, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 260, in evaluate
    self.show(results, out_dir)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 630, in show
    img = img.numpy().transpose(1, 2, 0)
AttributeError: 'numpy.ndarray' object has no attribute 'numpy'

Error source code:

    def show(self, results, out_dir, show=True, pipeline=None):
        """Results visualization.

        Args:
            results (list[dict]): List of bounding boxes results.
            out_dir (str): Output directory of visualization result.
            show (bool): Visualize the results online.
            pipeline (list[dict], optional): raw data loading for showing.
                Default: None.
        """
        assert out_dir is not None, 'Expect out_dir, got none.'
        pipeline = self._get_pipeline(pipeline)
        for i, result in enumerate(results):
            if 'img_bbox' in result.keys():
                result = result['img_bbox']
            data_info = self.data_infos[i]
            img_path = data_info['file_name']
            file_name = osp.split(img_path)[-1].split('.')[0]
            img, img_metas = self._extract_data(i, pipeline,
                                                ['img', 'img_metas'])
            # need to transpose channel to first dim
            img = img.numpy().transpose(1, 2, 0)
            gt_bboxes = self.get_ann_info(i)['gt_bboxes_3d']
            pred_bboxes = result['boxes_3d']
            show_multi_modality_result(
                img,
                gt_bboxes,
                pred_bboxes,
                img_metas['cam2img'],
                out_dir,
                file_name,
                box_mode='camera',
                show=show)

The source code is in themmdet3d/datasets/nuscenes_mono_dataset.py path.
Because variable img is in numpy. ndarray format. So I tried to change img = img.numpy().transpose(1, 2, 0) to img = img.transpose(1, 2, 0), but reported a new error:

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 230, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 217, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 260, in evaluate
    self.show(results, out_dir)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 637, in show
    img_metas['cam2img'],
TypeError: 'NoneType' object is not subscriptable

The same data key as variable img_metas was not found in the KITTI dataset. So does variable img_metas represent the predicted data of the model? Or does variable img_metas represent data that is not in KITTI format (possibly Nuscenes data)?
Attached here is the data shown by variable img_metas:
2021-11-09 16-02-15

For comparison, I have attached the same contents of the 000001 image from the Calib and Label_2 files in the KITTI dataset.
Calib:
2021-11-09 19-09-52
Label_2:
2021-11-09 19-10-08

I tried a lot of things. I hope I can try my best to solve the problem myself before bothering you. But my capacity is limited. I'm really hope you can help me solve the above problems.
I look forward to your early reply! Thank you very much.

@Gewaihir
Copy link
Author

Follow the comments below. Similarly, when I tested the SMOKE model, I also had an error similar to problem 2. This seems to be a common bug. The following is an error message:

loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
Use load_from_local loader
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 21/21, 12.3 task/s, elapsed: 2s, ETA:     0s
Converting prediction to KITTI format
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 21/21, 141.6 task/s, elapsed: 0s, ETA:     0s
Result is saved to /tmp/tmpdbaz2ckk/resultsimg_bbox.pkl
Results of img_bbox:

----------- AP11 Results ------------

Pedestrian AP11@0.50, 0.50, 0.50:
bbox AP11:6.0606, 6.8182, 6.8182
bev  AP11:0.0000, 0.0000, 0.0000
3d   AP11:0.0000, 0.0000, 0.0000
aos  AP11:3.29, 5.20, 5.20
Pedestrian AP11@0.50, 0.25, 0.25:
bbox AP11:6.0606, 6.8182, 6.8182
bev  AP11:9.0909, 9.0909, 9.0909
3d   AP11:9.0909, 9.0909, 9.0909
aos  AP11:3.29, 5.20, 5.20
Cyclist AP11@0.50, 0.50, 0.50:
bbox AP11:9.0909, 9.0909, 9.0909
bev  AP11:0.0000, 0.0000, 0.0000
3d   AP11:0.0000, 0.0000, 0.0000
aos  AP11:3.28, 3.28, 3.28
Cyclist AP11@0.50, 0.25, 0.25:
bbox AP11:9.0909, 9.0909, 9.0909
bev  AP11:0.0000, 0.0000, 0.0000
3d   AP11:0.0000, 0.0000, 0.0000
aos  AP11:3.28, 3.28, 3.28
Car AP11@0.70, 0.70, 0.70:
bbox AP11:35.7955, 79.9175, 80.1428
bev  AP11:7.0707, 10.9984, 10.9984
3d   AP11:2.2727, 6.4935, 6.4935
aos  AP11:35.76, 79.82, 80.05
Car AP11@0.70, 0.50, 0.50:
bbox AP11:35.7955, 79.9175, 80.1428
bev  AP11:30.9188, 45.0568, 45.0568
3d   AP11:29.8760, 44.7059, 44.7059
aos  AP11:35.76, 79.82, 80.05

Overall AP11@easy, moderate, hard:
bbox AP11:16.9823, 31.9422, 32.0173
bev  AP11:2.3569, 3.6661, 3.6661
3d   AP11:0.7576, 2.1645, 2.1645
aos  AP11:14.11, 29.43, 29.51

----------- AP40 Results ------------

Pedestrian AP40@0.50, 0.50, 0.50:
bbox AP40:1.6667, 3.7500, 3.7500
bev  AP40:0.0000, 0.0000, 0.0000
3d   AP40:0.0000, 0.0000, 0.0000
aos  AP40:0.60, 2.50, 2.50
Pedestrian AP40@0.50, 0.25, 0.25:
bbox AP40:1.6667, 3.7500, 3.7500
bev  AP40:0.0000, 0.0000, 0.0000
3d   AP40:0.0000, 0.0000, 0.0000
aos  AP40:0.60, 2.50, 2.50
Cyclist AP40@0.50, 0.50, 0.50:
bbox AP40:0.0000, 0.0000, 0.0000
bev  AP40:0.0000, 0.0000, 0.0000
3d   AP40:0.0000, 0.0000, 0.0000
aos  AP40:0.00, 0.00, 0.00
Cyclist AP40@0.50, 0.25, 0.25:
bbox AP40:0.0000, 0.0000, 0.0000
bev  AP40:0.0000, 0.0000, 0.0000
3d   AP40:0.0000, 0.0000, 0.0000
aos  AP40:0.00, 0.00, 0.00
Car AP40@0.70, 0.70, 0.70:
bbox AP40:36.5972, 78.4238, 80.7344
bev  AP40:3.3333, 8.6104, 8.6104
3d   AP40:0.7895, 4.7539, 4.7539
aos  AP40:36.56, 78.32, 80.63
Car AP40@0.70, 0.50, 0.50:
bbox AP40:36.5972, 78.4238, 80.7344
bev  AP40:27.1243, 45.9101, 45.9101
3d   AP40:24.6674, 43.9253, 43.9253
aos  AP40:36.56, 78.32, 80.63

Overall AP40@easy, moderate, hard:
bbox AP40:12.7546, 27.3913, 28.1615
bev  AP40:1.1111, 2.8701, 2.8701
3d   AP40:0.2632, 1.5846, 1.5846
aos  AP40:12.39, 26.94, 27.71

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 234, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 217, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 260, in evaluate
    self.show(results, out_dir)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 630, in show
    img = img.np.transpose(1, 2, 0)
AttributeError: 'numpy.ndarray' object has no attribute 'np'

@Tai-Wang
Copy link
Member

It's really strange. Please check your prepared data and training log for the reason of the much lower performance than expected. You can take our provided logs for reference.

@Gewaihir
Copy link
Author

I didn't do training. It was tested directly using the weighting model you provided. I prepared the dataset by strictly following the tutorial in the documentation, downloaded the full KITTI dataset, organized the format as required, and generated the training and test files. As for the low accuracy of the test I think it is caused by the fact that I only left 20 images in the validation set. I will rerun the test with the full validation set and submit test feedback. Until then, could you please arrange a colleague to see how to fix the bugs I've reported. Thank you very much!

@Gewaihir
Copy link
Author

This is the result of a test using the full validation set. I annotated '--eval-options', 'show=Ture' in the test command to get this result.

loading annotations into memory...
Done (t=0.39s)
creating index...
index created!
Use load_from_local loader
[>>>>>>>>>>>>>>>>>>>>>>>>>>] 3769/3769, 16.9 task/s, elapsed: 224s, ETA:     0s
Converting prediction to KITTI format
[>>>>>>>>>>>>>>>>>>>>>>>>>>] 3769/3769, 1086.9 task/s, elapsed: 3s, ETA:     0s
Result is saved to /tmp/tmppc4by2jp/resultsimg_bbox.pkl
Results of img_bbox:

----------- AP11 Results ------------

Pedestrian AP11@0.50, 0.50, 0.50:
bbox AP11:59.8406, 52.3057, 45.1352
bev  AP11:12.6096, 11.3220, 11.1394
3d   AP11:11.1251, 11.1034, 10.6742
aos  AP11:44.82, 39.25, 34.08
Pedestrian AP11@0.50, 0.25, 0.25:
bbox AP11:59.8406, 52.3057, 45.1352
bev  AP11:25.2484, 22.0332, 18.2620
3d   AP11:24.8671, 21.6255, 18.0478
aos  AP11:44.82, 39.25, 34.08
Cyclist AP11@0.50, 0.50, 0.50:
bbox AP11:40.9906, 28.3271, 23.8503
bev  AP11:1.4753, 0.6461, 0.6717
3d   AP11:0.9894, 0.5439, 0.5455
aos  AP11:32.75, 22.47, 18.69
Cyclist AP11@0.50, 0.25, 0.25:
bbox AP11:40.9906, 28.3271, 23.8503
bev  AP11:8.5934, 6.0036, 4.6030
3d   AP11:7.9763, 4.1958, 4.1958
aos  AP11:32.75, 22.47, 18.69
Car AP11@0.70, 0.70, 0.70:
bbox AP11:87.6541, 77.7924, 69.0280
bev  AP11:22.9668, 18.3199, 15.8833
3d   AP11:16.9175, 13.8476, 11.9007
aos  AP11:87.44, 77.32, 68.51
Car AP11@0.70, 0.50, 0.50:
bbox AP11:87.6541, 77.7924, 69.0280
bev  AP11:52.7447, 38.3183, 32.7254
3d   AP11:45.8373, 35.0161, 30.4342
aos  AP11:87.44, 77.32, 68.51

Overall AP11@easy, moderate, hard:
bbox AP11:62.8285, 52.8084, 46.0045
bev  AP11:12.3506, 10.0960, 9.2315
3d   AP11:9.6773, 8.4983, 7.7068
aos  AP11:55.00, 46.35, 40.43

----------- AP40 Results ------------

Pedestrian AP40@0.50, 0.50, 0.50:
bbox AP40:57.0051, 48.7086, 40.5941
bev  AP40:4.4656, 3.5759, 2.9343
3d   AP40:3.5639, 3.1789, 2.5917
aos  AP40:40.48, 34.48, 28.58
Pedestrian AP40@0.50, 0.25, 0.25:
bbox AP40:57.0051, 48.7086, 40.5941
bev  AP40:18.6084, 15.9231, 13.3324
3d   AP40:18.2765, 15.4530, 12.9673
aos  AP40:40.48, 34.48, 28.58
Cyclist AP40@0.50, 0.50, 0.50:
bbox AP40:40.0515, 26.1384, 23.3971
bev  AP40:0.9974, 0.4804, 0.4633
3d   AP40:0.5679, 0.2487, 0.2492
aos  AP40:31.74, 20.34, 17.99
Cyclist AP40@0.50, 0.25, 0.25:
bbox AP40:40.0515, 26.1384, 23.3971
bev  AP40:7.6811, 4.3548, 3.9548
3d   AP40:6.6491, 3.6494, 3.5552
aos  AP40:31.74, 20.34, 17.99
Car AP40@0.70, 0.70, 0.70:
bbox AP40:90.8583, 81.9671, 72.5637
bev  AP40:17.6140, 12.0386, 10.0905
3d   AP40:10.4279, 7.0909, 5.5719
aos  AP40:90.61, 81.39, 71.89
Car AP40@0.70, 0.50, 0.50:
bbox AP40:90.8583, 81.9671, 72.5637
bev  AP40:51.3922, 35.7193, 31.0015
3d   AP40:45.2503, 30.7241, 26.2357
aos  AP40:90.61, 81.39, 71.89

Overall AP40@easy, moderate, hard:
bbox AP40:62.6383, 52.2714, 45.5183
bev  AP40:7.6923, 5.3649, 4.4960
3d   AP40:4.8532, 3.5062, 2.8042
aos  AP40:54.28, 45.40, 39.49

{'img_bbox/KITTI/Pedestrian_3D_AP11_easy_strict': 11.1251, 'img_bbox/KITTI/Pedestrian_BEV_AP11_easy_strict': 12.6096, 'img_bbox/KITTI/Pedestrian_2D_AP11_easy_strict': 59.8406, 'img_bbox/KITTI/Pedestrian_3D_AP11_moderate_strict': 11.1034, 'img_bbox/KITTI/Pedestrian_BEV_AP11_moderate_strict': 11.322, 'img_bbox/KITTI/Pedestrian_2D_AP11_moderate_strict': 52.3057, 'img_bbox/KITTI/Pedestrian_3D_AP11_hard_strict': 10.6742, 'img_bbox/KITTI/Pedestrian_BEV_AP11_hard_strict': 11.1394, 'img_bbox/KITTI/Pedestrian_2D_AP11_hard_strict': 45.1352, 'img_bbox/KITTI/Pedestrian_3D_AP11_easy_loose': 24.8671, 'img_bbox/KITTI/Pedestrian_BEV_AP11_easy_loose': 25.2484, 'img_bbox/KITTI/Pedestrian_2D_AP11_easy_loose': 59.8406, 'img_bbox/KITTI/Pedestrian_3D_AP11_moderate_loose': 21.6255, 'img_bbox/KITTI/Pedestrian_BEV_AP11_moderate_loose': 22.0332, 'img_bbox/KITTI/Pedestrian_2D_AP11_moderate_loose': 52.3057, 'img_bbox/KITTI/Pedestrian_3D_AP11_hard_loose': 18.0478, 'img_bbox/KITTI/Pedestrian_BEV_AP11_hard_loose': 18.262, 'img_bbox/KITTI/Pedestrian_2D_AP11_hard_loose': 45.1352, 'img_bbox/KITTI/Cyclist_3D_AP11_easy_strict': 0.9894, 'img_bbox/KITTI/Cyclist_BEV_AP11_easy_strict': 1.4753, 'img_bbox/KITTI/Cyclist_2D_AP11_easy_strict': 40.9906, 'img_bbox/KITTI/Cyclist_3D_AP11_moderate_strict': 0.5439, 'img_bbox/KITTI/Cyclist_BEV_AP11_moderate_strict': 0.6461, 'img_bbox/KITTI/Cyclist_2D_AP11_moderate_strict': 28.3271, 'img_bbox/KITTI/Cyclist_3D_AP11_hard_strict': 0.5455, 'img_bbox/KITTI/Cyclist_BEV_AP11_hard_strict': 0.6717, 'img_bbox/KITTI/Cyclist_2D_AP11_hard_strict': 23.8503, 'img_bbox/KITTI/Cyclist_3D_AP11_easy_loose': 7.9763, 'img_bbox/KITTI/Cyclist_BEV_AP11_easy_loose': 8.5934, 'img_bbox/KITTI/Cyclist_2D_AP11_easy_loose': 40.9906, 'img_bbox/KITTI/Cyclist_3D_AP11_moderate_loose': 4.1958, 'img_bbox/KITTI/Cyclist_BEV_AP11_moderate_loose': 6.0036, 'img_bbox/KITTI/Cyclist_2D_AP11_moderate_loose': 28.3271, 'img_bbox/KITTI/Cyclist_3D_AP11_hard_loose': 4.1958, 'img_bbox/KITTI/Cyclist_BEV_AP11_hard_loose': 4.603, 'img_bbox/KITTI/Cyclist_2D_AP11_hard_loose': 23.8503, 'img_bbox/KITTI/Car_3D_AP11_easy_strict': 16.9175, 'img_bbox/KITTI/Car_BEV_AP11_easy_strict': 22.9668, 'img_bbox/KITTI/Car_2D_AP11_easy_strict': 87.6541, 'img_bbox/KITTI/Car_3D_AP11_moderate_strict': 13.8476, 'img_bbox/KITTI/Car_BEV_AP11_moderate_strict': 18.3199, 'img_bbox/KITTI/Car_2D_AP11_moderate_strict': 77.7924, 'img_bbox/KITTI/Car_3D_AP11_hard_strict': 11.9007, 'img_bbox/KITTI/Car_BEV_AP11_hard_strict': 15.8833, 'img_bbox/KITTI/Car_2D_AP11_hard_strict': 69.028, 'img_bbox/KITTI/Car_3D_AP11_easy_loose': 45.8373, 'img_bbox/KITTI/Car_BEV_AP11_easy_loose': 52.7447, 'img_bbox/KITTI/Car_2D_AP11_easy_loose': 87.6541, 'img_bbox/KITTI/Car_3D_AP11_moderate_loose': 35.0161, 'img_bbox/KITTI/Car_BEV_AP11_moderate_loose': 38.3183, 'img_bbox/KITTI/Car_2D_AP11_moderate_loose': 77.7924, 'img_bbox/KITTI/Car_3D_AP11_hard_loose': 30.4342, 'img_bbox/KITTI/Car_BEV_AP11_hard_loose': 32.7254, 'img_bbox/KITTI/Car_2D_AP11_hard_loose': 69.028, 'img_bbox/KITTI/Overall_3D_AP11_easy': 9.6773, 'img_bbox/KITTI/Overall_BEV_AP11_easy': 12.3506, 'img_bbox/KITTI/Overall_2D_AP11_easy': 62.8285, 'img_bbox/KITTI/Overall_3D_AP11_moderate': 8.4983, 'img_bbox/KITTI/Overall_BEV_AP11_moderate': 10.096, 'img_bbox/KITTI/Overall_2D_AP11_moderate': 52.8084, 'img_bbox/KITTI/Overall_3D_AP11_hard': 7.7068, 'img_bbox/KITTI/Overall_BEV_AP11_hard': 9.2315, 'img_bbox/KITTI/Overall_2D_AP11_hard': 46.0045, 'img_bbox/KITTI/Pedestrian_3D_AP40_easy_strict': 3.5639, 'img_bbox/KITTI/Pedestrian_BEV_AP40_easy_strict': 4.4656, 'img_bbox/KITTI/Pedestrian_2D_AP40_easy_strict': 57.0051, 'img_bbox/KITTI/Pedestrian_3D_AP40_moderate_strict': 3.1789, 'img_bbox/KITTI/Pedestrian_BEV_AP40_moderate_strict': 3.5759, 'img_bbox/KITTI/Pedestrian_2D_AP40_moderate_strict': 48.7086, 'img_bbox/KITTI/Pedestrian_3D_AP40_hard_strict': 2.5917, 'img_bbox/KITTI/Pedestrian_BEV_AP40_hard_strict': 2.9343, 'img_bbox/KITTI/Pedestrian_2D_AP40_hard_strict': 40.5941, 'img_bbox/KITTI/Pedestrian_3D_AP40_easy_loose': 18.2765, 'img_bbox/KITTI/Pedestrian_BEV_AP40_easy_loose': 18.6084, 'img_bbox/KITTI/Pedestrian_2D_AP40_easy_loose': 57.0051, 'img_bbox/KITTI/Pedestrian_3D_AP40_moderate_loose': 15.453, 'img_bbox/KITTI/Pedestrian_BEV_AP40_moderate_loose': 15.9231, 'img_bbox/KITTI/Pedestrian_2D_AP40_moderate_loose': 48.7086, 'img_bbox/KITTI/Pedestrian_3D_AP40_hard_loose': 12.9673, 'img_bbox/KITTI/Pedestrian_BEV_AP40_hard_loose': 13.3324, 'img_bbox/KITTI/Pedestrian_2D_AP40_hard_loose': 40.5941, 'img_bbox/KITTI/Cyclist_3D_AP40_easy_strict': 0.5679, 'img_bbox/KITTI/Cyclist_BEV_AP40_easy_strict': 0.9974, 'img_bbox/KITTI/Cyclist_2D_AP40_easy_strict': 40.0515, 'img_bbox/KITTI/Cyclist_3D_AP40_moderate_strict': 0.2487, 'img_bbox/KITTI/Cyclist_BEV_AP40_moderate_strict': 0.4804, 'img_bbox/KITTI/Cyclist_2D_AP40_moderate_strict': 26.1384, 'img_bbox/KITTI/Cyclist_3D_AP40_hard_strict': 0.2492, 'img_bbox/KITTI/Cyclist_BEV_AP40_hard_strict': 0.4633, 'img_bbox/KITTI/Cyclist_2D_AP40_hard_strict': 23.3971, 'img_bbox/KITTI/Cyclist_3D_AP40_easy_loose': 6.6491, 'img_bbox/KITTI/Cyclist_BEV_AP40_easy_loose': 7.6811, 'img_bbox/KITTI/Cyclist_2D_AP40_easy_loose': 40.0515, 'img_bbox/KITTI/Cyclist_3D_AP40_moderate_loose': 3.6494, 'img_bbox/KITTI/Cyclist_BEV_AP40_moderate_loose': 4.3548, 'img_bbox/KITTI/Cyclist_2D_AP40_moderate_loose': 26.1384, 'img_bbox/KITTI/Cyclist_3D_AP40_hard_loose': 3.5552, 'img_bbox/KITTI/Cyclist_BEV_AP40_hard_loose': 3.9548, 'img_bbox/KITTI/Cyclist_2D_AP40_hard_loose': 23.3971, 'img_bbox/KITTI/Car_3D_AP40_easy_strict': 10.4279, 'img_bbox/KITTI/Car_BEV_AP40_easy_strict': 17.614, 'img_bbox/KITTI/Car_2D_AP40_easy_strict': 90.8583, 'img_bbox/KITTI/Car_3D_AP40_moderate_strict': 7.0909, 'img_bbox/KITTI/Car_BEV_AP40_moderate_strict': 12.0386, 'img_bbox/KITTI/Car_2D_AP40_moderate_strict': 81.9671, 'img_bbox/KITTI/Car_3D_AP40_hard_strict': 5.5719, 'img_bbox/KITTI/Car_BEV_AP40_hard_strict': 10.0905, 'img_bbox/KITTI/Car_2D_AP40_hard_strict': 72.5637, 'img_bbox/KITTI/Car_3D_AP40_easy_loose': 45.2503, 'img_bbox/KITTI/Car_BEV_AP40_easy_loose': 51.3922, 'img_bbox/KITTI/Car_2D_AP40_easy_loose': 90.8583, 'img_bbox/KITTI/Car_3D_AP40_moderate_loose': 30.7241, 'img_bbox/KITTI/Car_BEV_AP40_moderate_loose': 35.7193, 'img_bbox/KITTI/Car_2D_AP40_moderate_loose': 81.9671, 'img_bbox/KITTI/Car_3D_AP40_hard_loose': 26.2357, 'img_bbox/KITTI/Car_BEV_AP40_hard_loose': 31.0015, 'img_bbox/KITTI/Car_2D_AP40_hard_loose': 72.5637, 'img_bbox/KITTI/Overall_3D_AP40_easy': 4.8532, 'img_bbox/KITTI/Overall_BEV_AP40_easy': 7.6923, 'img_bbox/KITTI/Overall_2D_AP40_easy': 62.6383, 'img_bbox/KITTI/Overall_3D_AP40_moderate': 3.5062, 'img_bbox/KITTI/Overall_BEV_AP40_moderate': 5.3649, 'img_bbox/KITTI/Overall_2D_AP40_moderate': 52.2714, 'img_bbox/KITTI/Overall_3D_AP40_hard': 2.8042, 'img_bbox/KITTI/Overall_BEV_AP40_hard': 4.496, 'img_bbox/KITTI/Overall_2D_AP40_hard': 45.5183}

@Tai-Wang
Copy link
Member

The error should be related to the compatibility of the function show in the Mono3D KITTI dataset, because previously we only support it on the nuScenes dataset. We will check it ASAP.

@Gewaihir
Copy link
Author

Thanks for your hard work! Looking forward to hearing from you guys!

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 18, 2021

Hi! @Gewaihir , In PGD model, the score for each object is combined with object's uncertainty. If you print the scores:

tensor([1303.7736,  488.0242,  367.1842,   93.2382,   42.8337,   41.1439,
          26.1720,   21.4874,   15.8451,   14.6057,   13.8399,   12.4595,
           9.6357,    8.7701,    8.5532,    6.6126,    6.5322,    6.3516,
           5.9160,    5.8083], device='cuda:0')

So you will find that they are not typically in range [0,1]. I recommend you to set a higher score threshold while visualization.
May be you can set it as 10.

@Tai-Wang
Copy link
Member

Tai-Wang commented Nov 18, 2021

@Gewaihir Another supplemental note is that a lower score threshold can empirically yield a little better (very little that can be ignored) quantitative results. So when I did the ablation I did not set it to a higher one. As for the compatibility of visualization API, we will fix it ASAP.

@Gewaihir
Copy link
Author

Thank you both so much for your work! I will follow the suggestions and give it a try. Looking forward to the perfect code!

@Gewaihir
Copy link
Author

Hello Author! I set the corresponding nms_thr and score_thr values as suggested by @ZCMax and found that the test came out with no change in the results. Here are the tests with different settings.
nms_thr=10, score_thr=0.01
000004_pred
nms_thr=500, score_thr=0.01
000004_pred
nms_thr=1000, score_thr=0.01
000004_pred
This is very strange. It looks like there are still problems with the model. Looking forward to your solutions.

@Tai-Wang
Copy link
Member

@Gewaihir You need to set the param score_thr to be higher instead of the nms_thr. nms_thr is the threshold for judging whether two overlapped boxes should be filtered with nms.

@Gewaihir
Copy link
Author

@Tai-Wang I tried your suggestion and set different and even extreme score_thr parameters. But this still didn't change the test. Here is an example showing.
nms_thr=0.8, score_thr=10
000008_pred
nms_thr=0.8, score_thr=500
000008_pred
nms_thr=0.8, score_thr=1000
000008_pred
At the extreme some,nms_thr=1000, score_thr=1000
000008_pred
You can see that no change has occurred. Looking forward to your solutions.

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 22, 2021

@Gewaihir Did you change score threshold in pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py config? And for another problem about saving image results, a PR provided by us will fix the problems soon.

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 22, 2021

@Gewaihir We suggest you to change the code like #1066 for a quick solution, or wait until the code is merged into our codebase. After code changing, the command for saving results should be like this:

python tools/test.py configs/pgd/pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py checkpoints/pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d_20211022_102608-8a97533b.pth --eval 'mAP' --eval-options 'show=False' 'out_dir=./pgd_results' 

Actually, the problem is caused by inference model on multi-gpu testing scheme, Saving results while inference is only applicable to single GPU testing and mainly used for debugging and simple visualization.

@Gewaihir
Copy link
Author

@ZCMax I changed the parameter of score_thr in pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py as you suggested. And set a few more different sets of parameters for comparison. It seems to work well. The following examples are all set with the parameters nms_thr=0.8 and score_thr=0.01 within pgd.py.
pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py nms_thr=0.05 and score_thr=5
000008_pred
pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py nms_thr=0.8 and score_thr=5
000008_pred
pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py nms_thr=0.2 and score_thr=5
000008_pred
pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py nms_thr=0.2 and score_thr=10
000008_pred
pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py nms_thr=0.5 and score_thr=10
000008_pred
It seems that modifying the parameters in pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py works. What is puzzling is that shouldn't the parameters in pgd.py be able to override the parameters in pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py ?
Secondly I updated the code with the new changes you submitted. The updated code runs with an error that does not affect the runtime. The error is reported as follows.

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 244, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 219, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 266, in evaluate
    self.show(results, out_dir, show=show, pipeline=pipeline)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 620, in show
    pipeline = self._get_pipeline(pipeline)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 593, in _get_pipeline
    loading_pipeline = get_loading_pipeline(self.pipeline.transforms)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/utils.py", line 103, in get_loading_pipeline
    is_loading = is_loading_function(transform)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/utils.py", line 51, in is_loading_function
    if isinstance(transform, MultiScaleFlipAug3D, MultiScaleFlipAug):
TypeError: isinstance expected 2 arguments, got 3

The entire terminal output is as follows.

loading annotations into memory...
Done (t=0.27s)
creating index...
index created!
Use load_from_local loader
2021-11-22 18:18:57,314 - root - INFO - ModulatedDeformConvPack bbox_head.cls_convs.1.conv is upgraded to version 2.
2021-11-22 18:18:57,315 - root - INFO - ModulatedDeformConvPack bbox_head.reg_convs.1.conv is upgraded to version 2.
[>>>>>>>>>>>>>>>>>>>>>>>>>>>] 3769/3769, 5.3 task/s, elapsed: 713s, ETA:     0s
Converting prediction to KITTI format
[>>>>>>>>>>>>>>>>>>>>>>>>>>] 3769/3769, 1017.5 task/s, elapsed: 4s, ETA:     0s
Result is saved to /tmp/tmprxop69se/resultsimg_bbox.pkl

Converting prediction to KITTI format
[>>>>>>>>>>>>>>>>>>>>>>>>>>] 3769/3769, 8005.3 task/s, elapsed: 0s, ETA:     0s
Result is saved to /tmp/tmprxop69se/resultsimg_bbox2d.pkl
Results of img_bbox:

----------- AP11 Results ------------

Pedestrian AP11@0.50, 0.50, 0.50:
bbox AP11:60.5382, 50.8523, 43.8061
bev  AP11:5.9303, 5.0150, 4.7442
3d   AP11:4.9901, 4.7131, 4.2165
aos  AP11:50.66, 41.87, 36.03
Pedestrian AP11@0.50, 0.25, 0.25:
bbox AP11:60.5382, 50.8523, 43.8061
bev  AP11:29.3821, 25.1919, 22.3654
3d   AP11:28.4081, 24.4285, 21.6380
aos  AP11:50.66, 41.87, 36.03
Cyclist AP11@0.50, 0.50, 0.50:
bbox AP11:33.1469, 21.3790, 21.2673
bev  AP11:11.2900, 9.6947, 9.5859
3d   AP11:10.4609, 9.3370, 9.3414
aos  AP11:26.58, 17.80, 17.68
Cyclist AP11@0.50, 0.25, 0.25:
bbox AP11:33.1469, 21.3790, 21.2673
bev  AP11:19.8410, 13.4393, 13.0573
3d   AP11:19.7245, 13.3082, 12.9519
aos  AP11:26.58, 17.80, 17.68
Car AP11@0.70, 0.70, 0.70:
bbox AP11:90.2953, 80.2002, 71.0076
bev  AP11:30.1130, 23.4541, 19.3242
3d   AP11:24.7254, 18.3290, 16.8798
aos  AP11:89.40, 78.78, 69.41
Car AP11@0.70, 0.50, 0.50:
bbox AP11:90.2953, 80.2002, 71.0076
bev  AP11:61.6286, 45.5171, 38.2089
3d   AP11:56.7955, 42.6317, 36.2314
aos  AP11:89.40, 78.78, 69.41

Overall AP11@easy, moderate, hard:
bbox AP11:61.3268, 50.8105, 45.3603
bev  AP11:15.7778, 12.7213, 11.2181
3d   AP11:13.3921, 10.7930, 10.1459
aos  AP11:55.54, 46.15, 41.04

----------- AP40 Results ------------

Pedestrian AP40@0.50, 0.50, 0.50:
bbox AP40:60.5920, 48.5055, 41.5453
bev  AP40:4.4606, 3.5650, 2.9825
3d   AP40:3.4750, 2.8608, 2.2876
aos  AP40:49.32, 38.69, 32.81
Pedestrian AP40@0.50, 0.25, 0.25:
bbox AP40:60.5920, 48.5055, 41.5453
bev  AP40:25.3144, 20.8319, 17.5321
3d   AP40:24.4363, 20.0587, 16.2912
aos  AP40:49.32, 38.69, 32.81
Cyclist AP40@0.50, 0.50, 0.50:
bbox AP40:29.5595, 16.0317, 15.8611
bev  AP40:4.6236, 1.9053, 1.8235
3d   AP40:3.6031, 1.1803, 1.1889
aos  AP40:22.07, 11.96, 11.81
Cyclist AP40@0.50, 0.25, 0.25:
bbox AP40:29.5595, 16.0317, 15.8611
bev  AP40:14.5821, 7.4671, 6.9711
3d   AP40:14.3430, 7.3643, 6.8760
aos  AP40:22.07, 11.96, 11.81
Car AP40@0.70, 0.70, 0.70:
bbox AP40:95.8790, 84.9067, 72.8449
bev  AP40:26.9398, 18.5883, 15.3906
3d   AP40:19.4497, 13.5134, 10.9605
aos  AP40:94.83, 83.25, 71.01
Car AP40@0.70, 0.50, 0.50:
bbox AP40:95.8790, 84.9067, 72.8449
bev  AP40:61.5092, 44.1024, 37.7061
3d   AP40:55.1299, 39.9826, 33.9913
aos  AP40:94.83, 83.25, 71.01

Overall AP40@easy, moderate, hard:
bbox AP40:62.0102, 49.8146, 43.4171
bev  AP40:12.0080, 8.0195, 6.7322
3d   AP40:8.8426, 5.8515, 4.8124
aos  AP40:55.41, 44.63, 38.54

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 244, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 219, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 266, in evaluate
    self.show(results, out_dir, show=show, pipeline=pipeline)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 620, in show
    pipeline = self._get_pipeline(pipeline)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 593, in _get_pipeline
    loading_pipeline = get_loading_pipeline(self.pipeline.transforms)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/utils.py", line 103, in get_loading_pipeline
    is_loading = is_loading_function(transform)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/utils.py", line 51, in is_loading_function
    if isinstance(transform, MultiScaleFlipAug3D, MultiScaleFlipAug):
TypeError: isinstance expected 2 arguments, got 3
Results of img_bbox2d:

----------- AP11 Results ------------

Pedestrian AP11@0.50, 0.50, 0.50:
bbox AP11:60.5774, 50.7689, 43.9143
Pedestrian AP11@0.50, 0.25, 0.25:
bbox AP11:60.5774, 50.7689, 43.9143
Cyclist AP11@0.50, 0.50, 0.50:
bbox AP11:35.3694, 22.4179, 22.3332
Cyclist AP11@0.50, 0.25, 0.25:
bbox AP11:35.3694, 22.4179, 22.3332
Car AP11@0.70, 0.70, 0.70:
bbox AP11:97.1444, 80.8651, 71.6386
Car AP11@0.70, 0.50, 0.50:
bbox AP11:97.1444, 80.8651, 71.6386

Overall AP11@easy, moderate, hard:
bbox AP11:64.3637, 51.3506, 45.9621

----------- AP40 Results ------------

Pedestrian AP40@0.50, 0.50, 0.50:
bbox AP40:60.7576, 48.4249, 41.5158
Pedestrian AP40@0.50, 0.25, 0.25:
bbox AP40:60.7576, 48.4249, 41.5158
Cyclist AP40@0.50, 0.50, 0.50:
bbox AP40:32.6655, 17.7604, 17.7796
Cyclist AP40@0.50, 0.25, 0.25:
bbox AP40:32.6655, 17.7604, 17.7796
Car AP40@0.70, 0.70, 0.70:
bbox AP40:98.5597, 85.8037, 75.6706
Car AP40@0.70, 0.50, 0.50:
bbox AP40:98.5597, 85.8037, 75.6706

Overall AP40@easy, moderate, hard:
bbox AP40:63.9943, 50.6630, 44.9887

There are no saved files in the specified folder except for the error report.
2021-11-22 18-34-41
Anyway, thank you very much for solving the problem. Looking forward to your new version! Thanks for your hard work!

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 22, 2021

  1. the parameters in pgd_r101_caffe_fpn_gn-head_3x4_4x_kitti-mono3d.py will override the parameters in pgd.py, It's quitely natural for the config design, the user should change the parameters in the final model config.
  2. Please check your code carefully for modification:
    It's:
    if isinstance(transform, (MultiScaleFlipAug3D, MultiScaleFlipAug)):
    not
    if isinstance(transform, MultiScaleFlipAug3D, MultiScaleFlipAug):

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 22, 2021

@Gewaihir the PR has been merged into our v1.0.0.dev0 branch, you can update your code via git pull.

@Gewaihir
Copy link
Author

@ZCMax To avoid the problem in 2 again. I double checked and modified the code. It still didn't save any files after re-running. The new error reported is as follows.

Traceback (most recent call last):
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 244, in <module>
    main()
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/tools/test.py", line 219, in main
    print(dataset.evaluate(outputs, **eval_kwargs))
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/kitti_mono_dataset.py", line 266, in evaluate
    self.show(results, out_dir, show=show, pipeline=pipeline)
  File "/home/lee/Project/mmdetection3d-1.0.0.dev0/mmdet3d/datasets/nuscenes_mono_dataset.py", line 630, in show
    img = img.np.transpose(1, 2, 0)
AttributeError: 'Tensor' object has no attribute 'np'

I added the following code at the beginning of the file that reports the error where the module is imported.

import tensorflow as tf
tf.enable_eager_execution() 

Re-run test.py. The terminal displays the following message.

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Although no error was reported, it did not solve the problem.

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 22, 2021

@Gewaihir I have no idea about where is the img.np.transpose(1, 2, 0) code from, check here. I suggest you just update your code via git pull since the modification has been merged into our codebase.

@Gewaihir
Copy link
Author

Hello @ZCMax I git pull the latest branch. Re-running the test resulted in the following error.

Traceback (most recent call last):
  File "/home/lee/Project/gitproject/mmdetection3d/tools/test.py", line 13, in <module>
    from mmdet3d.apis import single_gpu_test
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/apis/__init__.py", line 2, in <module>
    from .inference import (convert_SyncBN, inference_detector,
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/apis/inference.py", line 11, in <module>
    from mmdet3d.core import (Box3DMode, CameraInstance3DBoxes, Coord3DMode,
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/__init__.py", line 3, in <module>
    from .bbox import *  # noqa: F401, F403
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/bbox/__init__.py", line 3, in <module>
    from .coders import DeltaXYZWLHRBBoxCoder
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/bbox/coders/__init__.py", line 6, in <module>
    from .fcos3d_bbox_coder import FCOS3DBBoxCoder
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/bbox/coders/fcos3d_bbox_coder.py", line 6, in <module>
    from ..structures import limit_period
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/bbox/structures/__init__.py", line 2, in <module>
    from .base_box3d import BaseInstance3DBoxes
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/core/bbox/structures/base_box3d.py", line 7, in <module>
    from mmdet3d.ops import points_in_boxes_all, points_in_boxes_part
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/ops/__init__.py", line 6, in <module>
    from .ball_query import ball_query
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/ops/ball_query/__init__.py", line 1, in <module>
    from .ball_query import ball_query
  File "/home/lee/Project/gitproject/mmdetection3d/mmdet3d/ops/ball_query/ball_query.py", line 4, in <module>
    from . import ball_query_ext
ImportError: cannot import name 'ball_query_ext' from 'mmdet3d.ops.ball_query' (/home/lee/Project/gitproject/mmdetection3d/mmdet3d/ops/ball_query/__init__.py)

The code file for this error is located in the mmdetection3d/mmdet3d/ops/ball_query/ path. I did a search within the file and didn't find the module ball_query_ext that I needed to import. Where is the module ball_query_ext located?

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 23, 2021

@Gewaihir It seems you git clone a new repo, change from /home/lee/Project/mmdetection3d-1.0.0.dev0 to /home/lee/Project/gitproject/mmdetection3d, you can just use git pull in your original repo, or you can create a new conda environment, and reinstall mmdetection3d in your new repo.

@Gewaihir
Copy link
Author

@Tai-Wang @ZCMax The problem has been solved. Fantastic, thank you for all your hard work!

@Gewaihir
Copy link
Author

Results Show.
Original image
000008_img

Prediction Chart
000008_gt
000008_pred

Three files are generated by inference. The file names are 000008_img.png, 000008_pred.png and 000008_gt.png. Where 000008_img.png is the original image. 000008_pred.png is the prediction graph. What is 000008_gt.png the graph? 000008_gt.png is the image that shows the orange box.

@ZCMax
Copy link
Collaborator

ZCMax commented Nov 24, 2021

Results Show. Original image 000008_img

Prediction Chart 000008_gt 000008_pred

Three files are generated by inference. The file names are 000008_img.png, 000008_pred.png and 000008_gt.png. Where 000008_img.png is the original image. 000008_pred.png is the prediction graph. What is 000008_gt.png the graph? 000008_gt.png is the image that shows the orange box.

gt.png represents the image with ground truth label.

@Gewaihir
Copy link
Author

@ZCMax Understood. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants