29 Commits

Author SHA1 Message Date
Jeremy Reizenstein
34f648ede0 move targets
Summary: Move testing targets from pytorch3d/tests/TARGETS to pytorch3d/TARGETS.

Reviewed By: shapovalov

Differential Revision: D36186940

fbshipit-source-id: a4c52c4d99351f885e2b0bf870532d530324039b
2022-05-25 06:16:03 -07:00
Jeremy Reizenstein
ec9580a1d4 test runner for eval_demo
Summary:
Create a test runner for the eval_demo code.  Debugging this is useful for understanding datasets.

Introduces an environment variable INTERACTIVE_TESTING for ignoring tests which are not intended for use in regular test runs.

Reviewed By: shapovalov

Differential Revision: D35964016

fbshipit-source-id: ab0f93aff66b6cfeca942b14466cf81f7feb2224
2022-05-06 08:31:19 -07:00
Jeremy Reizenstein
78fd5af1a6 make points2volumes feature rescaling optional
Summary: Add option to not rescale the features, giving more control. https://github.com/facebookresearch/pytorch3d/issues/1137

Reviewed By: nikhilaravi

Differential Revision: D35219577

fbshipit-source-id: cbbb643b91b71bc908cedc6dac0f63f6d1355c85
2022-04-13 04:39:47 -07:00
Jeremy Reizenstein
3eb4233844 New raysamplers
Summary: New MultinomialRaysampler succeeds GridRaysampler bringing masking and subsampling. Correspondingly, NDCMultinomialRaysampler succeeds NDCGridRaysampler.

Reviewed By: nikhilaravi, shapovalov

Differential Revision: D33256897

fbshipit-source-id: cd80ec6f35b110d1d20a75c62f4e889ba8fa5d45
2022-01-24 10:52:23 -08:00
Jeremy Reizenstein
741777b5b5 More company name & License
Summary: Manual adjustments for license changes.

Reviewed By: patricklabatut

Differential Revision: D33405657

fbshipit-source-id: 8a21735726f3aece9f9164da9e3b272b27db8032
2022-01-04 11:43:38 -08:00
Jeremy Reizenstein
9eeb456e82 Update license for company name
Summary: Update all FB license strings to the new format.

Reviewed By: patricklabatut

Differential Revision: D33403538

fbshipit-source-id: 97a4596c5c888f3c54f44456dc07e718a387a02c
2022-01-04 11:43:38 -08:00
Roman Shapovalov
a6508ac3df Fix: Pointclouds.inside_box reducing over spatial dimensions.
Summary: As subj. Tests corrected accordingly. Also changed the test to provide a bit better diagnostics.

Reviewed By: bottler

Differential Revision: D32879498

fbshipit-source-id: 0a852e4a13dcb4ca3e54d71c6b263c5d2eeaf4eb
2021-12-06 07:45:46 -08:00
Jeremy Reizenstein
ae1387b523 let build tests run in conda
Summary: Much of the code is actually available during the conda tests, as long as we look in the right place. We enable some of them.

Reviewed By: nikhilaravi

Differential Revision: D30249357

fbshipit-source-id: 01c57b6b8c04442237965f23eded594aeb90abfb
2021-08-17 04:26:27 -07:00
Nikhila Ravi
542e2e7c07 Save UV texture with obj mesh
Summary: Add functionality to to save an `.obj` file with associated UV textures: `.png` image and `.mtl` file as well as saving verts_uvs and faces_uvs to the `.obj` file.

Reviewed By: bottler

Differential Revision: D29337562

fbshipit-source-id: 86829b40dae9224088b328e7f5a16eacf8582eb5
2021-06-24 15:56:01 -07:00
Patrick Labatut
af93f34834 License lint codebase
Summary: License lint codebase

Reviewed By: theschnitz

Differential Revision: D29001799

fbshipit-source-id: 5c59869911785b0181b1663bbf430bc8b7fb2909
2021-06-22 03:45:27 -07:00
Patrick Labatut
7e43f29d52 Lint codebase
Summary: Lint codebase

Reviewed By: bottler

Differential Revision: D29263057

fbshipit-source-id: ac97f01d2a79fead3b09c2cbb21b50ce688a577d
2021-06-22 03:45:27 -07:00
Jeremy Reizenstein
36b451a49b Test failures print message in assertNormsClose
Summary: Restore assertNormsClose's printing of its message on failure which I broke in D26233419 (cd9786e787).

Reviewed By: nikhilaravi

Differential Revision: D28799743

fbshipit-source-id: e7a24b2558b68991c731bbd55fb3ca6c1df98f69
2021-06-03 18:30:54 -07:00
Jeremy Reizenstein
070ec550d3 Always print message on test failure
Summary: make assertClose print its failure information even if a message is supplied.

Reviewed By: nikhilaravi

Differential Revision: D28799745

fbshipit-source-id: 787c8c356342420cd8f40fdc0b2aba036142298e
2021-06-03 18:30:54 -07:00
Jeremy Reizenstein
ed6983ea84 Experimental glTF reading
Summary: Experimental data loader for taking the default scene from a GLB file and converting it to a single mesh in PyTorch3D.

Reviewed By: nikhilaravi

Differential Revision: D25900167

fbshipit-source-id: bff22ac00298b83a0bd071ae5c8923561e1d81d7
2021-05-26 04:54:19 -07:00
Rong Rong (AI Infra)
c2e62a5087 Allow tests to be run on GPU with remote execution
Summary: Test path special case

Reviewed By: bottler

Differential Revision: D27566817

fbshipit-source-id: c7b3ac839908c071f1378a37b7013b91ca4e8b18
2021-04-08 20:03:04 -07:00
Rong Rong (AI Infra)
1216b5765a Extract finding directories for test data
Summary: Make common functions for finding directories where test data is found, instead of lots of tests using their own `__file__`  while trying to get ./tests/data and the tutorials data.

Reviewed By: nikhilaravi

Differential Revision: D27633701

fbshipit-source-id: 1467bb6018cea16eba3cab097d713116d51071e9
2021-04-08 20:03:04 -07:00
Jeremy Reizenstein
cd9786e787 Disable random-dependent tests
Summary:
These two tests fail (with non-small differences) when the seed is changed or if certain environmental changes are made. We disable them pending investigation.

A small change to the tolerance at the failing assertion doesn't help. The change in common_testing helps diagnose this.

Reviewed By: shapovalov

Differential Revision: D26233419

fbshipit-source-id: 357afc1786825256c9bade101fb15707e4dea5ed
2021-02-03 18:24:27 -08:00
Jeremy Reizenstein
232e4a7e3d Driver update for ci, easier diagnosing
Summary: Bump the nvidia driver used in the conda tests. Add an environment variable (unused) to allow building without ninja. Print relative error on assertClose failure.

Reviewed By: nikhilaravi

Differential Revision: D21227373

fbshipit-source-id: 5dd8eb097151da27d3632daa755a1e7b9ac97845
2020-04-25 16:03:42 -07:00
Nikhila Ravi
cf84dacf2e fix get cuda device test error
Summary:
Cuda test failing on circle with the error `random_ expects 'from' to be less than 'to', but got from=0 >= to=0`

This is because the `high` value in `torch.randint` is 1 more than the highest value in the distribution from which a value is drawn. So if there is only 1 cuda device available then the low and high are 0.

Reviewed By: gkioxari

Differential Revision: D21236669

fbshipit-source-id: 46c312d431c474f1f2c50747b1d5e7afbd7df3a9
2020-04-24 16:12:49 -07:00
Nikhila Ravi
c3d636dc8c Cuda updates
Summary:
Updates to:
- enable cuda kernel launches on any GPU (not just the default)
- cuda and contiguous checks for all kernels
- checks to ensure all tensors are on the same device
- error reporting in the cuda kernels
- cuda tests now run on a random device not just the default

Reviewed By: jcjohnson, gkioxari

Differential Revision: D21215280

fbshipit-source-id: 1bedc9fe6c35e9e920bdc4d78ed12865b1005519
2020-04-24 09:11:04 -07:00
Jeremy Reizenstein
9e4bd2e5e0 chamfer test consistency
Summary:
Modify test_chamfer for more robustness. Avoid empty pointclouds, including where point_reduction is mean, for which we currently return nan (*), and so that we aren't looking at an empty gradient. Make sure we aren't using padding as points in the homogenous cases in the tests, which will lead to a tie between closest points and therefore a potential instability in the gradient - see https://github.com/pytorch/pytorch/issues/35699.

(*) This doesn't attempt to fix the nan.

Reviewed By: nikhilaravi, gkioxari

Differential Revision: D21157322

fbshipit-source-id: a609e84e25a24379c8928ff645d587552526e4af
2020-04-22 09:28:51 -07:00
Nikhila Ravi
9ef1ee8455 coarse rasterization bug fix
Summary:
Fix a bug which resulted in a rendering artifacts if the image size was not a multiple of 16.
Fix: Revert coarse rasterization to original implementation and only update fine rasterization to reverse the ordering of Y and X axis. This is much simpler than the previous approach!

Additional changes:
- updated mesh rendering end-end tests to check outputs from both naive and coarse to fine rasterization.
- added pointcloud rendering end-end tests

Reviewed By: gkioxari

Differential Revision: D21102725

fbshipit-source-id: 2e7e1b013dd6dd12b3a00b79eb8167deddb2e89a
2020-04-20 14:54:16 -07:00
Roman Shapovalov
04d8bf6a43 Efficient PnP.
Summary:
Efficient PnP algorithm to fit 2D to 3D correspondences under perspective assumption.

Benchmarked both variants of nullspace and pick one; SVD takes 7 times longer in the 100K points case.

Reviewed By: davnov134, gkioxari

Differential Revision: D20095754

fbshipit-source-id: 2b4519729630e6373820880272f674829eaed073
2020-04-17 07:44:16 -07:00
Jeremy Reizenstein
b87058c62a fix recent lint
Summary: lint clean again

Reviewed By: patricklabatut

Differential Revision: D20868775

fbshipit-source-id: ade4301c1012c5c6943186432465215701d635a9
2020-04-06 06:41:00 -07:00
Roman Shapovalov
e37085d999 Weighted Umeyama.
Summary:
1. Introduced weights to Umeyama implementation. This will be needed for weighted ePnP but is useful on its own.
2. Refactored to use the same code for the Pointclouds mask and passed weights.
3. Added test cases with random weights.
4. Fixed a bug in tests that calls the function with 0 points (fails randomly in Pytorch 1.3, will be fixed in the next release: https://github.com/pytorch/pytorch/issues/31421 ).

Reviewed By: gkioxari

Differential Revision: D20070293

fbshipit-source-id: e9f549507ef6dcaa0688a0f17342e6d7a9a4336c
2020-04-03 02:59:11 -07:00
Patrick Labatut
d57daa6f85 Address black + isort fbsource linter warnings
Summary: Address black + isort fbsource linter warnings from D20558374 (previous diff)

Reviewed By: nikhilaravi

Differential Revision: D20558373

fbshipit-source-id: d3607de4a01fb24c0d5269634563a7914bddf1c8
2020-03-29 14:51:02 -07:00
Patrick Labatut
3c71ab64cc Remove shebang line when not strictly required
Summary: The shebang line `#!<path to interpreter>` is only required for Python scripts, so remove it on source files for class or function definitions. Additionally explicitly mark as executable the actual Python scripts in the codebase.

Reviewed By: nikhilaravi

Differential Revision: D20095778

fbshipit-source-id: d312599fba485e978a243292f88a180d71e1b55a
2020-03-12 10:39:44 -07:00
Georgia Gkioxari
767d68a3af pointcloud structure
Summary:
Revisions to Poincloud data structure with added normals

The biggest changes form the previous version include:
a) If the user provides tensor inputs, we make no assumption about padding. Padding is only for internal use for us to convert from list to padded
b) If features are not provided or if the poincloud is empty, all forms of features are None. This is so that we don't waste memory on holding dummy tensors.

Reviewed By: nikhilaravi

Differential Revision: D19791851

fbshipit-source-id: 7e182f7bb14395cb966531653f6dd6b328fd999c
2020-03-04 13:16:43 -08:00
facebook-github-bot
dbf06b504b Initial commit
fbshipit-source-id: ad58e416e3ceeca85fae0583308968d04e78fe0d
2020-01-23 11:53:46 -08:00