For any test, if it's unittest class, you can run
python -m unittest tests.xxx.test_file.pyorpython -m unittest discover tests.xxx.test_dir
to auto run all unittest for checking.
Test a single func, use
python -m unittest tests.xxx.test_file.TestDict.tests_method.
Some tests do not use check but give visual results in tests/xxx/results
We set default cfg file path at __init__.py. You can change it and tests will read the config from it.
Many of the tests on geometry or model will save visible results in the result dir.
Tests for common class. Directly obtained from common_trainer project.
Tests for all nerf/3d related functions.
Tests for datasets. Including showing cameras, avg cams and test cam trajectory.
It will read datasets from default.yaml, save related visual results into results folder.
Change the config file in tests_datasets.__init__ to other dataset cfg in dataset_dir.
Test geometry function.
Test mesh function, like cal normals, getting face centers.
Test mesh function, like point cloud io.
Test the sphere representation and circle/spiral line creation
Test the poses creation and modification functions.
Test projection functions. Make pixels and transform them to points, then project points back to pixels. Check the difference.
Test function in transform, like normalization, rotation
Test function in triangle, like getting norm, getting circumcircle, etc.
Test function in ray, like getting sphere-ray-intersection, point-ray distance, etc.
Test function in volume, like volume pts/line/faces generation and visualization, ray-volume intersection with coarse structure, etc.
Test camera creation, get_rays and project rays into pixel, visualize ray and ray points Also check when we rescale camera and image, whether rays get projected correctly.
Test func for ray sampling, resample cdf/pdf, etc.
Test all the models and components for correctness and time.
Test activation functions.
Test all kinds of encoder. Some encoders have different backend(torch/cuda/tcnn), will check correctness.
Test encoders speed and time.
Test linear layers
Test implicit/radiance function with encoder and linear network.
Test implicit/radiance function with encoder and tcnn_fusemlp network. Much faster that torch linear.
Test all the model and get the speed/time.
Test fg model for ray sampling and forward.
Test each bkg model like nerf++.
Test NeRF model.
Test MipNeRF model.
Test NeRF model with nerf++ as bkg model.
Test Neus model and its sdf_to_alpha method with sampling.
Test VolSDF model and its sdf_to_sigma method with sampling.
Tests of the customized operations in CUDA extension.
Tests for loss functions. Including geo_loss, img_loss, mask_loss.
Tests for eval metric functions. Including img_metric