WeijingShi / Point-GNN

Point-GNN: Graph Neural Network for 3D Object Detection in a Point Cloud, CVPR 2020.
MIT License
523 stars 114 forks source link

Visualization of Results #44

Open ddannylee opened 3 years ago

ddannylee commented 3 years ago

Hi, I have some questions regard as your code. First, how can i obtain BEV's results? i just got the 3D of results ( -level 1 ) Second, because of my GPU capability, i tried to resize the Image in order to test. will it affect my results?

Thank you

WeijingShi commented 3 years ago

Hi @ddannylee,

The code visualizes results in 3D. The viewpoint can be changed in the following line: https://github.com/WeijingShi/Point-GNN/blob/48f3d79d5b101d3a4b8439ba74c92fcad4f7cab0/run.py#L532 You can change the rotation to get a BEV visualization. Meanwhile, the code also writes out the results in KITTI label format under --output_dir, you can load it to other visualization code.

ddannylee commented 3 years ago

Thank you for your answer!

Can i ask more question?

  1. During the training kitti dataset, i used default value in configs 'max step' : 1400000, max_epoch 1718 except batch_size :2
    Then, total epoch ( "*for epoch_idx in range((previous_stepbatch_size)//NUM_TEST_SAMPLE,train_config['max_epoch']**):" is 964? (754 ~ 1718)

  2. And i wanna confirm my training results in every epochs in your code :

Screenshot from 2020-10-08 13-52-02

In order to confirm training in each epoch, i think results['step'] should more lower than 'max step'. is it right? How can i change fixed value of results['step'] or global step ?

  1. Can you teach me exact training process?

Thank you

WeijingShi commented 3 years ago

Hi @ddannylee,

  1. The training stops when the "step" reaches "max step" or ("step" * "batch_size") reaches the "max epoch". In your case, since your change the batch size by half. The "max step"=1400000 will be reached first.

  2. Yes, if results["step"] is larger than "max_step" the training ends. The results["step"] is returned by session.run() which runs the Tensorflow computational graph and get the value of the tensor global_step. Within the computational graph, global_step is incremented by the optimizer when we apply the gradient to the weights: https://github.com/WeijingShi/Point-GNN/blob/48f3d79d5b101d3a4b8439ba74c92fcad4f7cab0/train.py#L405 You can find the doc here. So the "step" is counting the number of SGD iterations. You can add operations to modify global_step if you want. But it might be better to leave it alone.

  3. Tensorflow 1X is mostly about building a computational graph and then run the graph. This guide provides the basic concepts. The train.py Line173-411 are building the computational graph which contains the GNN and the gradient update operations. It needs points and edges as input. Therefore in Line51-71, we construct the edges and use a multiprocessing dataloader to speed things up. After Line411, we just get the points and edges from dataloader and feed them to the Tensorflow computational graph.
    Hope it helps. Thank you.

ddannylee commented 3 years ago

Thank you for the answer!

I exactly understand your explanation

Finally, how can i evaluate my test results? It should use the source "kitti native_evaluation" for my result? If i want use your code "eval.py", just change the 'training dir' to 'test dir?

dataset = KittiDataset( os.path.join(DATASET_DIR, 'image/testing/image_2'), os.path.join(DATASET_DIR, 'velodyne/testing/velodyne/'), os.path.join(DATASET_DIR, 'calib/testing/calib/'), os.path.join(DATASET_DIR, 'labels/training/label_2'), DATASET_SPLIT_FILE, num_classes=config['num_classes'])

like this!

And! How can i evaluate 'BEV' detection performance in your eval.py code?

Thank you so much

WeijingShi commented 3 years ago

Hi @ddannylee, Sorry for the late reply. The eval.py only monitors the losses and some simple metrics such as mAP for point classification. For kitti type of metrics, we get the prediction results by run.py and use the native_evaluation instead. Thanks.