278 Commits

Author SHA1 Message Date
Jeremy Reizenstein
3145dd4d16 version 0.7.2
Summary: version number

Reviewed By: davidsonic

Differential Revision: D42072729

fbshipit-source-id: 50adaac4daca7786479d33e218d15e941a725bb6
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
6c053a6cea Update notebooks for 0.7.2
Summary: Expect pytorch 1.13

Reviewed By: davidsonic

Differential Revision: D42072731

fbshipit-source-id: 13ba4e7de18060dc4e5c0e10f850f17a88750fc9
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
3bbe26124a README.md and INSTALL.md updates
Summary: misc updates

Reviewed By: davidsonic

Differential Revision: D42072730

fbshipit-source-id: fc885d14346083bd6493f18e9d965b35a8d4bdfd
2022-12-15 16:15:45 -08:00
Jeremy Reizenstein
c773830b88 fix and pythonify conda build (#1394)
Summary:
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1394

The bash logic for building conda packages became fiddly to edit. We need to switch cuda-toolkit to pytorch-cuda when PyTorch>=1.12 which was going to be a pain, so here I rewrite the code in python and do it.

Reviewed By: shapovalov

Differential Revision: D42036406

fbshipit-source-id: 8bb80c2f7545477182b23fc97c8514dcafcee176
2022-12-15 03:22:07 -08:00
Jeremy Reizenstein
b7a316232a fix saved glb length
Summary: Make GLB files report their own length correctly. They were off by 28.

Reviewed By: davidsonic

Differential Revision: D41838340

fbshipit-source-id: 9cd66e8337c142298d5ae1d7c27e51fd812d5c7b
2022-12-13 05:34:45 -08:00
generatedunixname89002005307016
de3a474d2b suppress errors in vision/fair/pytorch3d
Differential Revision: D41897914

fbshipit-source-id: 675f4ad6938bc12d295bbb63a69e3ff98b319a9a
2022-12-09 18:50:58 -08:00
Jeremy Reizenstein
a4a29b013b remove python 3.7 builds
Summary: Python 3.7 not needed any more

Reviewed By: shapovalov

Differential Revision: D41841033

fbshipit-source-id: c0cfd048c70e6b9e47224ab8cddcd6b5f4fc5597
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
e7851f7c79 Mac builds: python 3.10, pytorch 1.13
Summary: All mac builds now pytorch 1.13

Reviewed By: shapovalov

Differential Revision: D41841035

fbshipit-source-id: b932eb2fefed77ae22f9757f9bd628ce12b11fad
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
20a774e266 builds for PyTorch 1.13.0
Summary: Add builds for current pytorch

Reviewed By: shapovalov

Differential Revision: D41841034

fbshipit-source-id: 4a58515bd5c83b26f14763a3cec9279e905391d2
2022-12-09 07:31:39 -08:00
Jeremy Reizenstein
91b4c04c64 small readme update
Summary: followup D41534315 (5add065f8a)

Reviewed By: shapovalov

Differential Revision: D41842250

fbshipit-source-id: 54413e30880717f083fdc7acbce2eb3e646ffb94
2022-12-08 09:46:09 -08:00
Jiali Duan
cc2840eb44 Write meshes to GLB
Summary: Write the amalgamated mesh from the Mesh module to glb. In this version, the json header and the binary data specified by the buffer are merged into glb. The image texture attributes are added.

Reviewed By: bottler

Differential Revision: D41489778

fbshipit-source-id: 3af0e9a8f9e9098e73737a254177802e0fb6bd3c
2022-12-05 01:25:43 -08:00
David Novotny
dba48fb410 Add tutorial links to main README.md
Summary: <See title>

Reviewed By: bottler

Differential Revision: D41534604

fbshipit-source-id: 20111db87083b2cce7374cc2bd223ae220d7b010
2022-11-30 07:02:01 -08:00
David Novotny
5add065f8a Readme updates
Summary:
Running:
- clearly points users to experiment.py/visualize_reconstruction.py
Reproducing:
- Adds NeRF training on Blender
- Adds CO3Dv2 configs

Reviewed By: bottler

Differential Revision: D41534315

fbshipit-source-id: e85f5f1eafed8c35c9e91d748a04f238509cf8ec
2022-11-30 07:02:01 -08:00
Jeremy Reizenstein
a2c6af9250 more code blocks for readthedocs
Summary: More rst syntax fixes

Reviewed By: davidsonic

Differential Revision: D40977328

fbshipit-source-id: a3a3accbf2ba7cd9c84a0a82d0265010764a9d61
2022-11-29 03:13:40 -08:00
David Novotny
94f321fa3d render_flyaround bugfix
Summary: Fixes a bug which would crash render_flyaround anytime  visualize_preds_keys is adjusted

Reviewed By: shapovalov

Differential Revision: D41124462

fbshipit-source-id: 127045a91a055909f8bd56c8af81afac02c00f60
2022-11-28 04:36:41 -08:00
David Novotny
35f8cb9430 Downgrade "Assigning param_group " msg to DEBUG
Summary: <See title>

Reviewed By: bottler

Differential Revision: D41534524

fbshipit-source-id: 9c39198b9b8d5fc95f857b03ad39bfe0bd720cbb
2022-11-28 02:58:15 -08:00
David Novotny
c3a6ab02da Bug-fix visualize reconstruction
Summary:
Addresses the following issue:
https://github.com/facebookresearch/pytorch3d/issues/1345#issuecomment-1272881244

I.e., when installed from conda, `pytorch3d_implicitron_visualizer` crashes since it invokes `main()` while `main` requires a single positional arg `argv`.

Reviewed By: shapovalov

Differential Revision: D41533497

fbshipit-source-id: e53a923eb8b2f0f9c0e92e9c0866d9cb310c4799
2022-11-25 10:30:01 -08:00
Jeremy Reizenstein
60ab1cdb72 make x_enabled compulsory
Summary: Optional[some_configurable] won't autogenerate the enabled flag

Reviewed By: shapovalov

Differential Revision: D41522104

fbshipit-source-id: 555ff6b343faf6f18aad2f92fbb7c341f5e991c6
2022-11-24 09:38:02 -08:00
Jiali Duan
1706eb8216 Simplify MC C++ hashing logic
Summary: To be consistent with CUDA hashing, the diff replaces boost hasher with a simplified hasher for storing unique global edge_ids.

Reviewed By: kjchalup

Differential Revision: D41140382

fbshipit-source-id: 2ce598e5edcf6369fe13bd15d1f5e014b252027b
2022-11-15 19:42:04 -08:00
Jiali Duan
8b8291830e Marching Cubes cuda extension
Summary:
Torch CUDA extension for Marching Cubes
- MC involving 3 steps:
  - 1st forward pass to collect vertices and occupied state for each voxel
  - Compute compactVoxelArray to skip non-empty voxels
  - 2nd pass to genereate interpolated vertex positions and faces by marching through the grid
- In contrast to existing MC:
   - Bind each interpolated vertex with a global edge_id to address floating-point precision
   - Added deduplication process to remove redundant vertices and faces

Benchmarks (ms):

| N / V(^3)      | python          | C++             |   CUDA   | Speedup |
| 2 / 20          |    12176873  |       24338     |     4363   | 2790x/5x|
| 1 / 100          |     -             |    3070511     |   27126   |    113x    |
| 2 / 100          |     -             |    5968934     |   53129   |    112x    |
| 1 / 256          |     -             |  61278092     | 430900   |    142x    |
| 2 / 256          |     -             |125687930     | 856941   |    146x   |

Reviewed By: kjchalup

Differential Revision: D39644248

fbshipit-source-id: d679c0c79d67b98b235d12296f383d760a00042a
2022-11-15 19:42:04 -08:00
Jeremy Reizenstein
9a0b0c2e74 renderer and vis readthedocs #1363
Summary: Autogenerate docs for the renderer too. This will be helpful but make a slightly ugly TOC

Reviewed By: kjchalup

Differential Revision: D40977315

fbshipit-source-id: 10831de3ced68080cb5671c5dc31d4da8500f761
2022-11-15 14:10:22 -08:00
Daniel L. Lu
d0fbe2cb63 fix typo pucuda.gl --> pycuda.gl (#1379)
Summary:
Every time I try to run code, I get this warning:

```
  warnings.warn("Can't import pucuda.gl, not importing MeshRasterizerOpenGL.")
```

Of course, `pucuda` is a typo of `pycuda`.

This PR fixes the typo

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1379

Reviewed By: kjchalup

Differential Revision: D41295562

Pulled By: bottler

fbshipit-source-id: 2bfa2a2dbe20a5347861d36fbff5094994c1253d
2022-11-15 12:02:44 -08:00
Roman Shapovalov
719c33a7f9 Fix: visualisation with Enums fields in Configurables
Summary:
Enum fields cause the following to crash since they are loaded as strings:
```
config = OmegaConf.load(autodumped_cfg_file)
Experiment(**config)
```

It would be good to come up with the general solution but for now just fixing the visualisation script.

Reviewed By: bottler

Differential Revision: D41140426

fbshipit-source-id: 71c1c6b1fffe3b5ab1ca0114cfa3f0d81160278f
2022-11-08 15:58:41 -08:00
Roman Shapovalov
f3c1e0837c MC rasterize supports heterogeneous bundle; refactoring of bundle-to-padded
Summary:
Rasterize MC was not adapted to heterogeneous bundles.

There are some caveats though:
1) on CO3D, we get up to 18 points per image, which is too few for a reasonable visualisation (see below);
2) rasterising for a batch of 100 is slow.

I also moved the unpacking code close to the bundle to be able to reuse it.

{F789678778}

Reviewed By: bottler, davnov134

Differential Revision: D41008600

fbshipit-source-id: 9f10f1f9f9a174cf8c534b9b9859587d69832b71
2022-11-07 13:43:31 -08:00
Jeremy Reizenstein
7be49bf46f allow dots in param_groups
Summary:
Allow a module's param_group member to specify overrides to the param groups of its members or their members.
Also logging for param group assignments.

This allows defining `params.basis_matrix` in the param_groups of a voxel_grid.

Reviewed By: shapovalov

Differential Revision: D41080667

fbshipit-source-id: 49f3b0e5b36e496f78701db0699cbb8a7e20c51e
2022-11-07 06:41:40 -08:00
Jeremy Reizenstein
a1f2ded58a voxel_grid_implicit_function scaffold fixes
Summary: Fix indexing of directions after filtering of points by scaffold.

Reviewed By: shapovalov

Differential Revision: D40853482

fbshipit-source-id: 9cfdb981e97cb82edcd27632c5848537ed2c6837
2022-11-03 05:46:31 -07:00
David Novotny
e4a3298149 CO3Dv2 multi-category extension
Summary:
Allows loading of multiple categories.
Multiple categories are provided in a comma-separated list of category names.

Reviewed By: bottler, shapovalov

Differential Revision: D40803297

fbshipit-source-id: 863938be3aa6ffefe9e563aede4a2e9e66aeeaa8
2022-11-02 13:55:25 -07:00
Jeremy Reizenstein
c54e048666 more readthedocs
Summary: Quote formats, spelling

Reviewed By: shapovalov

Differential Revision: D40913734

fbshipit-source-id: d6dea65d5204b3c463c656a07ef9b447b7be6a0a
2022-11-02 05:19:15 -07:00
David Novotny
f7ac7b604a readthedocs fixes
Summary: Fixes readthedocs. Sphinx build looks good.

Reviewed By: bottler

Differential Revision: D40893196

fbshipit-source-id: bf00384b921d4ef54e64745ed39172358c2f9bb3
2022-11-01 05:46:13 -07:00
Jeremy Reizenstein
cd113efd98 Add implicitron to readthedocs
Summary: Try to document implicitron. Most of this is autogenerated.

Reviewed By: shapovalov

Differential Revision: D40623742

fbshipit-source-id: 453508277903b7d987b1703656ba1ee09bc2c570
2022-10-31 14:44:41 -07:00
Jeremy Reizenstein
322c8f2f50 make lpips optional
Summary: So that lpips isn't needed in readthedocs

Reviewed By: shapovalov

Differential Revision: D40859351

fbshipit-source-id: 58933bd3b71e78e658fbce56c3663b11ee2331f6
2022-10-31 14:44:41 -07:00
David Novotny
eff0aad15a Bugfix - normalize emitted ray directions after substraction
Summary: The bug lead to non-coinciding origins of the rays emitted from perspective cameras when unit_directions=True

Reviewed By: bottler

Differential Revision: D40865610

fbshipit-source-id: 398598e9e919b53e6bea179f0400e735bbb5b625
2022-10-31 14:00:49 -07:00
David Novotny
bea84a6fcd voxel_grid_if -> remove union type from the settings.
Summary: see title

Reviewed By: shapovalov

Differential Revision: D40803670

fbshipit-source-id: 211189167837af577d6502a698e2f3fb3aec3e30
2022-10-31 11:37:43 -07:00
Roman Shapovalov
f711c4bfe9 Fix parameters not wrapped with nn.Parameter, antialiasing compatibility
Summary: Some things fail if a parameter is not wraped; in particular, it prevented other tensors moving to GPU.

Reviewed By: bottler

Differential Revision: D40819932

fbshipit-source-id: a23b38ceacd7f0dc131cb0355fef1178e3e2f7fd
2022-10-31 01:43:00 -07:00
Jeremy Reizenstein
88620b6847 attempt to fix doc build #1363
Summary: installing from git: is failing

Reviewed By: shapovalov

Differential Revision: D40635668

fbshipit-source-id: 604ba5425e14caeabe4e178bf7f851f2163419bd
2022-10-27 07:26:36 -07:00
generatedunixname89002005307016
db7c80bf76 upgrade pyre version in fbcode/vision - batch 2
Differential Revision: D40695068

fbshipit-source-id: 9944a872d93a9dac348b252a0f8bf9c7e6f929f3
2022-10-25 22:42:06 -07:00
Jeremy Reizenstein
995b60e3b9 version 0.7.1
Summary: update version number

Reviewed By: shapovalov

Differential Revision: D40622583

fbshipit-source-id: 87fa55e1b02fc114f65ee8a5c3d998ba50226ab1
2022-10-23 07:16:40 -07:00
Jeremy Reizenstein
ca58863347 yaml test fix
Summary: Yaml bool case fix

Reviewed By: shapovalov

Differential Revision: D40623031

fbshipit-source-id: 29b2fba171c2cbebfa03834e38b614d07275c997
2022-10-23 07:09:26 -07:00
Jeremy Reizenstein
74754bbf17 voxel_grid_implicit_function
Reviewed By: shapovalov

Differential Revision: D40622304

fbshipit-source-id: 277515a55c46d9b8300058b439526539a7fe00a0
2022-10-23 05:36:34 -07:00
Jeremy Reizenstein
611aba9a20 replicate_last_interval in raymarcher
Summary: Add option to flat pad the last delta. Might to help when training on rgb only.

Reviewed By: shapovalov

Differential Revision: D40587475

fbshipit-source-id: c763fa38948600ea532c730538dc4ff29d2c3e0a
2022-10-23 02:47:09 -07:00
Jeremy Reizenstein
ff933ab82b make visdom optional
Summary: Make Implicitron run without visdom installed.

Reviewed By: shapovalov

Differential Revision: D40587974

fbshipit-source-id: dc319596c7a4d10a4c54c556dabc89ad9d25c2fb
2022-10-22 15:51:22 -07:00
Jiali Duan
46cb5aaaae Omit _check_valid_rotation_matrix by default
Summary:
According to the profiler trace D40326775, _check_valid_rotation_matrix is slow because of aten::all_close operation and _safe_det_3x3 bottlenecks. Disable the check by default unless environment variable PYTORCH3D_CHECK_ROTATION_MATRICES is set to 1.

Comparison after applying the change:
```
Profiling/Function    get_world_to_view (ms)   Transform_points(ms)    specular(ms)
before                12.751                    18.577                  21.384
after                 4.432 (34.7%)             9.248 (49.8%)           11.507 (53.8%)
```

Profiling trace:
https://pxl.cl/2h687
More details in https://docs.google.com/document/d/1kfhEQfpeQToikr5OH9ZssM39CskxWoJ2p8DO5-t6eWk/edit?usp=sharing

Reviewed By: kjchalup

Differential Revision: D40442503

fbshipit-source-id: 954b58de47de235c9d93af441643c22868b547d0
2022-10-20 16:05:22 -07:00
Jeremy Reizenstein
8339cf2610 hydra/OC.structured: don't hide error
Summary: Keep the cause of hydra errors visible in some more cases.

Reviewed By: shapovalov

Differential Revision: D40516202

fbshipit-source-id: 8d214be5cc808a37738add77cc305fe099788546
2022-10-20 03:43:05 -07:00
Jeremy Reizenstein
9535c576e0 test fix for param_groups
Summary: param_groups only expected on MLPDecoder, not ElementwiseDecoder

Reviewed By: shapovalov

Differential Revision: D40508539

fbshipit-source-id: ea040ad6f7e26bd7d87e5de2eaadae2cf4b04faf
2022-10-19 04:08:30 -07:00
Jeremy Reizenstein
fe5bdb2fb5 different learning rate for different parts
Summary:
Adds the ability to have different learning rates for different parts of the model. The trainable parts of the implicitron have a new member

       param_groups: dictionary where keys are names of individual parameters,
            or module’s members and values are the parameter group where the
            parameter/member will be sorted to. "self" key is used to denote the
            parameter group at the module level. Possible keys, including the "self" key
            do not have to be defined. By default all parameters are put into "default"
            parameter group and have the learning rate defined in the optimizer,
            it can be overriden at the:
                - module level with “self” key, all the parameters and child
                    module s parameters will be put to that parameter group
                - member level, which is the same as if the `param_groups` in that
                    member has key=“self” and value equal to that parameter group.
                    This is useful if members do not have `param_groups`, for
                    example torch.nn.Linear.
                - parameter level, parameter with the same name as the key
                    will be put to that parameter group.

And in the optimizer factory, parameters and their learning rates are recursively gathered.

Reviewed By: shapovalov

Differential Revision: D40145802

fbshipit-source-id: 631c02b8d79ee1c0eb4c31e6e42dbd3d2882078a
2022-10-18 15:58:18 -07:00
Jeremy Reizenstein
a819ecb00b MLP last layer config
Summary:
Added initialization configuration for the last layer of the MLP decoding function. You can now set:
- last activation function (tensorf uses sigmoid)
- last bias init (tensorf uses 0, because of sigmoid ofc)
- option to use xavier initialization (we use relu so this should not be set)

Reviewed By: davnov134

Differential Revision: D40304981

fbshipit-source-id: ec398eb2235164ae85cb7c09b9660e843490ea04
2022-10-18 15:58:18 -07:00
Ji Hou
a2659e1730 Update iou3d.md (#1351)
Summary:
fix a typo

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1351

Reviewed By: shapovalov

Differential Revision: D40209834

Pulled By: bottler

fbshipit-source-id: 118133e0eab2df211e5c4f04371f2c695a9ceced
2022-10-15 21:41:02 -07:00
Jeremy Reizenstein
3b3306f9b4 suppress ffmpeg output
Summary: Restore the suppression of ffmpeg output.

Reviewed By: shapovalov

Differential Revision: D40296595

fbshipit-source-id: 41b2c14b6f6245f77e0ef6cc94fa7b41fbb83e33
2022-10-13 14:56:09 -07:00
Jeremy Reizenstein
f13086779d avoid torch.range
Summary: Avoid unintended use of torch.range.

Reviewed By: kjchalup

Differential Revision: D40341396

fbshipit-source-id: 108295983afdec0ca9e43178fef9c65695150bc1
2022-10-13 14:37:46 -07:00
Jeremy Reizenstein
4d9215b3b4 fix to get_default_args(instance)
Summary:
Small config system fix. Allows get_default_args to work on an instance which has been created with a dict (instead of a DictConfig) as an args field. E.g.

```
gm = GenericModel(
        raysampler_AdaptiveRaySampler_args={"scene_extent": 4.0}
    )
    OmegaConf.structured(gm1)
```

Reviewed By: shapovalov

Differential Revision: D40341047

fbshipit-source-id: 587d0e8262e271df442a80858949a48e5d6db3df
2022-10-13 06:05:07 -07:00
Darijan Gudelj
76cddd90be Elementwise decoder
Summary: Tensorf does relu or softmax after the density grid. This diff adds the ability to replicate that.

Reviewed By: bottler

Differential Revision: D40023228

fbshipit-source-id: 9f19868cd68460af98ab6e61c7f708158c26dc08
2022-10-13 05:59:22 -07:00
Jeremy Reizenstein
a607dd063e better implicit function #channels errors
Summary: More helpful errors when the output channels aren't 1 for density and 3 for color

Reviewed By: shapovalov

Differential Revision: D40341088

fbshipit-source-id: 6074bf7fefe11c8e60fee4db2760b776419bcfee
2022-10-13 05:43:36 -07:00
Krzysztof Chalupka
17bc043a0c Remove structured binding
Summary: Couldn't build p3d on devfair because C++17 is unsupported. Two structured bindings sneaked in.

Reviewed By: bottler

Differential Revision: D40280967

fbshipit-source-id: 9627f3f9f76247a6cefbeac067fdead67c6f4e14
2022-10-12 10:34:21 -07:00
Darijan Gudelj
f55d37f07d volume cropping
Summary:
TensoRF at step 2000 does volume croping and resizing.
At those steps it calculates part of the voxel grid which has density big enough to have objects and resizes the grid to fit that object.
Change is done on 3 levels:
- implicit function subscribes to epochs and at specific epochs finds the bounding box of the object and calls resizing of the color and density voxel grids to fit it
- VoxelGrid module calls cropping of the underlaying voxel grid and resizing to fit previous size it also adjusts its extends and translation to match wanted size
- Each voxel grid has its own way of cropping the underlaying data

Reviewed By: kjchalup

Differential Revision: D39854548

fbshipit-source-id: 5435b6e599aef1eaab980f5421d3369ee4829c50
2022-10-12 08:31:51 -07:00
Jeremy Reizenstein
0b5def5257 avoid numpy warning in split
Summary:
avoid creating a numpy array of random things just to split it: this can now generate a warning e.g. if the list contains lists of varying lengths. There might also be a performance win here, and we could do more of the same if we care about that.

(The vanilla way to avoid the new warning is to replace `np.split(a,` with `np.split(np.array(a, dtype=object), ` btw.)

Reviewed By: shapovalov

Differential Revision: D40209308

fbshipit-source-id: daae33a23ceb444e8e7241f72ce1525593e2f239
2022-10-11 14:49:51 -07:00
Darijan Gudelj
56d3465b09 scaffold
Summary: Forward method is sped up using the scaffold, a low resolution voxel grid which is used to filter out the points in empty space. These points will be predicted as having 0 density and (0, 0, 0) color. The points which were not evaluated as empty space will be passed through the steps outlined above.

Reviewed By: kjchalup

Differential Revision: D39579671

fbshipit-source-id: 8eab8bb43ef77c2a73557efdb725e99a6c60d415
2022-10-10 11:01:00 -07:00
Jeremy Reizenstein
95a2acf763 Co3Dv2 point cloud fix
Summary: Avoid certain hardcoded paths in co3dv2 data

Reviewed By: davnov134

Differential Revision: D40209309

fbshipit-source-id: 0e83a15baa47d5bd07d2d23c6048cb4522c1ccba
2022-10-09 05:06:49 -07:00
Jiali Duan
9df875bb5e Fix Circleci build failure: Add != operator for Marching Cubes Vertex struct
Summary: Fix Circleci error: https://app.circleci.com/pipelines/github/facebookresearch/pytorch3d/1066/workflows/94df137b-4882-4959-8fe4-738af447db23/jobs/56560.

Reviewed By: kjchalup

Differential Revision: D40185409

fbshipit-source-id: 7121b0cae66bd60f718df2a5d9ef5d2ac3bc658c
2022-10-07 12:14:24 -07:00
David Novotny
73ba66e4ab Bugfix in reduction feature aggr.
Summary: Bugfix

Reviewed By: bottler

Differential Revision: D40146840

fbshipit-source-id: a8415c361ed3cd939999b87311aff4d3bb1bcfe1
2022-10-07 01:45:24 -07:00
Kyle Hundman
4c8338b00f Improve memory efficiency in VolumeSampler
Summary: Avoids use of `torch.cat` operation when rendering a volume by instead issuing multiple calls to `torch.nn.functional.grid_sample`. Density and color tensors can be large.

Reviewed By: bottler

Differential Revision: D40072399

fbshipit-source-id: eb4cd34f6171d54972bbf2877065f973db497de0
2022-10-06 12:10:26 -07:00
Jiali Duan
0d8608b9f9 Marching Cubes C++ torch extension
Summary:
Torch C++ extension for Marching Cubes

- Add torch C++ extension for marching cubes. Observe a speed up of ~255x-324x speed up (over varying batch sizes and spatial resolutions)

- Add C++ impl in existing unit-tests.

(Note: this ignores all push blocking failures!)

Reviewed By: kjchalup

Differential Revision: D39590638

fbshipit-source-id: e44d2852a24c2c398e5ea9db20f0dfaa1817e457
2022-10-06 11:13:53 -07:00
Jiali Duan
850efdf706 Python marching cubes improvements
Summary: Overhaul of marching_cubes_naive for better performance and to avoid relying on unstable hashing. In particular, instead of hashing vertex positions, we index each interpolated vertex with its corresponding edge in the 3d grid.

Reviewed By: kjchalup

Differential Revision: D39419642

fbshipit-source-id: b5fede3525c545d1d374198928dfb216262f0ec0
2022-10-06 11:08:49 -07:00
Gavin Peng
6471893f59 Multithread CPU naive mesh rasterization
Summary:
Threaded the for loop:
```
for (int yi = 0; yi < H; ++yi) {...}
```
in function `RasterizeMeshesNaiveCpu()`.
Chunk size is approx equal.

Reviewed By: bottler

Differential Revision: D40063604

fbshipit-source-id: 09150269405538119b0f1b029892179501421e68
2022-10-06 06:42:58 -07:00
Darijan Gudelj
37bd280d19 load whole dataset in train loop
Summary: Loads the whole dataset and moves it to the device and sends it to for sampling to enable full dataset heterogeneous raysampling.

Reviewed By: bottler

Differential Revision: D39263009

fbshipit-source-id: c527537dfc5f50116849656c9e171e868f6845b1
2022-10-03 08:36:47 -07:00
Darijan Gudelj
c311a4cbb9 Enable mixed frame raysampling
Summary:
Changed ray_sampler and metrics to be able to use mixed frame raysampling.

Ray_sampler now has a new member which it passes to the pytorch3d raysampler.
If the raybundle is heterogeneous metrics now samples images by padding xys first. This reduces memory consumption.

Reviewed By: bottler, kjchalup

Differential Revision: D39542221

fbshipit-source-id: a6fec23838d3049ae5c2fd2e1f641c46c7c927e3
2022-10-03 08:36:47 -07:00
Darijan Gudelj
ad8907d373 ImplicitronRayBundle
Summary: new implicitronRayBundle with added cameraIDs and camera counts. Added to enable a single raybundle inside Implicitron and easier extension in the future. Since RayBundle is named tuple and RayBundleHeterogeneous is dataclass and RayBundleHeterogeneous cannot inherit RayBundle. So if there was no ImplicitronRayBundle every function that uses RayBundle now would have to use Union[RayBundle, RaybundleHeterogeneous] which is confusing and unecessary complicated.

Reviewed By: bottler, kjchalup

Differential Revision: D39262999

fbshipit-source-id: ece160e32f6c88c3977e408e966789bf8307af59
2022-10-03 08:36:47 -07:00
Darijan Gudelj
6ae863f301 Heterogeneous raysampling -> RayBundleHeterogeneous
Summary:
Added heterogeneous raysampling to pytorch3d raysampler, different cameras are sampled different number of times.

 It now returns RayBundle if heterogeneous raysampling is off and new RayBundleHeterogeneous (with added fields `camera_ids` and `camera_counts`).  Heterogeneous raysampling is on if `n_rays_total` is not None.

Reviewed By: bottler

Differential Revision: D39542222

fbshipit-source-id: d3d88d822ec7696e856007c088dc36a1cfa8c625
2022-09-30 04:03:01 -07:00
Roman Shapovalov
9a0f9ae572 Extending the API of Transform3d with SE(3) log
Summary:
This is quite a thin wrapper – not sure we need it. The motivation is that `Transform3d` is not as matrix-centric now, it can be converted to SE(3) logarithm equally easily.

It simplifies things like averaging cameras and getting axis-angle of camera rotation (previously, one would need to call `se3_log_map(cameras.get_world_to_camera_transform().get_matrix())`), now one fewer thing to call / discover.

Reviewed By: bottler

Differential Revision: D39928000

fbshipit-source-id: 85248d5b8af136618f1d08791af5297ea5179d19
2022-09-29 11:56:14 -07:00
Roman Shapovalov
74bbd6fd76 Fix returning a proper rotation in levelling; supporting batches and default centroid
Summary:
`get_rotation_to_best_fit_xy` is useful to expose externally, however there was a bug (which we probably did not care about for our use case): it could return a rotation matrix with det(R) == −1.
The diff fixes that, and also makes centroid optional (it can be computed from points).

Reviewed By: bottler

Differential Revision: D39926791

fbshipit-source-id: 5120c7892815b829f3ddcc23e93d4a5ec0ca0013
2022-09-29 11:56:14 -07:00
generatedunixname89002005307016
de98c9cc2f upgrade pyre version in fbcode/vision - batch 2
Differential Revision: D39894833

fbshipit-source-id: 95a32d9cb352c5fea345c6947194ad52971d4fe9
2022-09-28 20:07:00 -07:00
Darijan Gudelj
5005f09118 Add rescaling to voxel grids
Summary: Any module can be subscribed to step updates from the training loop. Once the training loop publishes a step the voxel grid changes its dimensions. During the construction of VoxelGridModule and its parameters it does not know which is the resolution that will be loaded from checkpoint, so before the checkpoint loading a hook runs which changes the VoxelGridModule's parameters to match shapes of the loaded checkpoint.

Reviewed By: bottler

Differential Revision: D39026775

fbshipit-source-id: 0d359ea5c8d2eda11d773d79c7513c83585d5f17
2022-09-28 05:23:22 -07:00
Jeremy Reizenstein
efea540bbc Fix camera clone() with torch.save
Summary:
User reported that cloned cameras fail to save. The error with latest PyTorch is

```
pickle.PicklingError: Can't pickle ~T_destination: attribute lookup T_destination on torch.nn.modules.module failed
```

This fixes it.

Reviewed By: btgraham

Differential Revision: D39692258

fbshipit-source-id: 75bbf3b8dfa0023dc28bf7d4cc253ca96e46a64d
2022-09-22 14:52:09 -07:00
Michaël Ramamonjisoa
ce3fce49d7 Adding a Checkerboard mesh utility to Pytorch3d
Summary: Adding a checkerboard mesh utility to Pytorch3d.

Reviewed By: bottler

Differential Revision: D39718916

fbshipit-source-id: d43cd30e566b5db068bae6eed0388057634428c8
2022-09-22 12:51:37 -07:00
Darijan Gudelj
f34da3d3b6 packed_to_padded now accepts all sizes
Summary:
We need to make packing/unpacking in 2 places for mixed frame raysampling (metrics and raysampler) but those tensors that need to be unpacked/packed have more than two dimensions.
I could have reshaped and stored dimensions but this seems to just complicate code there with something which packed_to_padded should support.
I could have made a separate function for implicitron but it would confusing to have two different padded_to_packed functions inside pytorch3d codebase one of which does packing for (b, max) and (b, max, f) and the other for (b, max, …)

Reviewed By: bottler

Differential Revision: D39729026

fbshipit-source-id: 2bdebf290dcc6c316b7fe1aeee49bbb5255e508c
2022-09-22 11:27:43 -07:00
Darijan Gudelj
c2d876c9e8 voxel grid implicit function
Summary: The implicit function and its members and internal working

Reviewed By: kjchalup

Differential Revision: D38829764

fbshipit-source-id: 28394fe7819e311ed52c9defc9a1b29f37fbc495
2022-09-22 10:56:00 -07:00
Jeremy Reizenstein
d6a197be36 make expand_args_fields optional
Summary: Call expand_args_field when instantiating an object.

Reviewed By: shapovalov

Differential Revision: D39541931

fbshipit-source-id: de8e1038927ff0112463394412d5d8c26c4a1e17
2022-09-22 08:36:09 -07:00
Jeremy Reizenstein
209c160a20 foreach optimizers
Summary: Allow using the new `foreach` option on optimizers.

Reviewed By: shapovalov

Differential Revision: D39694843

fbshipit-source-id: 97109c245b669bc6edff0f246893f95b7ae71f90
2022-09-22 05:11:56 -07:00
Darijan Gudelj
db3c12abfb arbitrary shape input to voxel_grids
Summary: Add the ability to process arbitrary point shapes `[n_grids, ..., 3]` instead of  only `[n_grids, n_points, 3]`.

Reviewed By: bottler

Differential Revision: D39574373

fbshipit-source-id: 0a9ecafe9ea58cd8f909644de43a1185ecf934f4
2022-09-22 03:35:11 -07:00
Michaël Ramamonjisoa
6ae6ff9cf7 include TexturesUV in IO.save_mesh(x.obj)
Summary:
Added export of UV textures to IO.save_mesh in Pytorch3d
MeshObjFormat now passes verts_uv, faces_uv, and texture_map as input to save_obj

TODO: check if TexturesUV.verts_uv_list or TexturesUV.verts_uv_padded() should be passed to save_obj

IO.save_mesh(obj_file, meshes, decimal_places=2) should be IO().save_mesh(obj_file, meshes, decimal_places=2)

Reviewed By: bottler

Differential Revision: D39617441

fbshipit-source-id: 4628b7f26f70e38c65f235852b990c8edb0ded23
2022-09-21 06:16:48 -07:00
Jeremy Reizenstein
305cf32f6b Avoid raysampler dict
Summary:
A significant speedup (e.g. >2% of a forward pass).

Move NDCMultinomialRaysampler parts of AbstractMaskRaySampler to members instead of living in a dict. The dict was hiding them from the nn.Module system so their _xy_grid members were remaining on the CPU. Therefore they were being copied to the GPU in every forward pass.

(We couldn't easily use a ModuleDict here because the enum keys are not strs.)

Reviewed By: shapovalov

Differential Revision: D39668589

fbshipit-source-id: 719b88e4a08fd7263a284e0ab38189e666bd7e3a
2022-09-21 04:29:44 -07:00
Jeremy Reizenstein
da7fe2854e small fixes to config
Summary:
- indicate location of OmegaConf.structured failures
- split the data gathering from enable_get_default_args to ease experimenting with it.
- comment fixes.
- nicer error when a_class_type has weird type.

Reviewed By: kjchalup

Differential Revision: D39434447

fbshipit-source-id: b80c7941547ca450e848038ef5be95b7ebbe8f3e
2022-09-15 03:03:52 -07:00
Jeremy Reizenstein
cb7bd33e7f validate lengths in chamfer and farthest_points
Summary: Fixes #1326

Reviewed By: kjchalup

Differential Revision: D39259697

fbshipit-source-id: 51392f4cc4a956165a62901cb115fcefe0e17277
2022-09-08 15:03:36 -07:00
Jeremy Reizenstein
6e25fe8cb3 visualize_reconstruction fixes
Summary: Various fixes to get visualize_reconstruction running, and an interactive test for it.

Reviewed By: kjchalup

Differential Revision: D39286691

fbshipit-source-id: 88735034cc01736b24735bcb024577e6ab7ed336
2022-09-07 20:10:07 -07:00
Jeremy Reizenstein
34ad77b841 trainer test completion
Summary: allow TESTIT to complete properly

Reviewed By: kjchalup

Differential Revision: D39280546

fbshipit-source-id: 38fe69988a736e32dbe78d1d05e6d8421353854a
2022-09-07 14:21:15 -07:00
Jeremy Reizenstein
90b758f725 hydra fix
Summary: Workaround for oddity with new hydra.

Reviewed By: davnov134

Differential Revision: D39280639

fbshipit-source-id: 76e91947f633589945446db93cf2dbc259642f8a
2022-09-07 03:25:39 -07:00
Jeremy Reizenstein
df36223ddf raysampling stratified_sampling doc
Summary: Followup to D39259775 (438c194ec6)

Reviewed By: davnov134

Differential Revision: D39271753

fbshipit-source-id: 5cf11c1210369e1762ef0d5d0c7b60336711b261
2022-09-06 10:28:45 -07:00
David Novotny
73ea4187de SimpleDataLoaderMapProvider sample batches without replacement if num_samples is not specified
Summary: Samples batches without replacement if the number of samples is not specified. This makes sure that we always iterate over the whole dataset in each epoch.

Reviewed By: bottler

Differential Revision: D39270786

fbshipit-source-id: 0c983d1f5e0af711463abfb23939bc0d2b5172a0
2022-09-06 05:59:01 -07:00
David Novotny
f6d43eaa62 Bugfixes in render_flyaround
Summary: Fixes bugs in render_flyaround

Reviewed By: bottler

Differential Revision: D39271932

fbshipit-source-id: 07e6c9ee07ba91feb437b725af0a8942fd98db0b
2022-09-06 05:45:31 -07:00
David Novotny
c79c954dea Rename and move render_flyaround into core implicitron
Summary:
Move the flyaround rendering function into core implicitron.
The unblocks an example in the facebookresearch/co3d repo.

Reviewed By: bottler

Differential Revision: D39257801

fbshipit-source-id: 6841a88a43d4aa364dd86ba83ca2d4c3cf0435a4
2022-09-06 03:03:08 -07:00
Matthias Treder
438c194ec6 stratified_sampling argument: set default to None (#1324)
Summary:
The self._stratified_sampling attribute is always overridden unless stratified_sampling is explicitly set to None. However, the desired default behavior is that the value of self._stratified_sampling is used unless the argument stratified_sampling is set to True/False. Changing the default to None achieves this

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1324

Reviewed By: bottler

Differential Revision: D39259775

Pulled By: davnov134

fbshipit-source-id: e01bb747ac80c812eb27bf22e67f5e14f29acadd
2022-09-05 11:16:25 -07:00
Darijan Gudelj
dd58ded73d stats object counting time wrong
Summary: On each call of the stats.update the object calculates current average iteration time by getting time elapsed from the time_start and then dividing it by the current number of steps. It saves the result to AverageMeter object which when queried returns the average of things saved, so the time is averaged twice which biases it towards the start value (which is often larger).

Reviewed By: kjchalup

Differential Revision: D39206989

fbshipit-source-id: ccab5233d7aaca1ac4fd626fb329b83c7c0d6af9
2022-09-05 06:27:37 -07:00
Darijan Gudelj
72c3a0ebe5 raybundle input to ImplicitFunctions -> api unification
Summary: Currently some implicit functions in implicitron take a raybundle, others take ray_points_world. raybundle is what they really need. However, the raybundle is going to become a bit more flexible later, as it will contain different numbers of rays for each camera.

Reviewed By: bottler

Differential Revision: D39173751

fbshipit-source-id: ebc038e426d22e831e67a18ba64655d8a61e1eb9
2022-09-05 06:26:06 -07:00
Pyre Bot Jr
70dc9c451a suppress errors in vision/fair/pytorch3d
Reviewed By: stroxler

Differential Revision: D39230408

fbshipit-source-id: dce7a461507ee7199f588341773096c06051b2dc
2022-09-03 09:22:49 -07:00
Jiali Duan
8a96770dc2 Update the docstring for try_get_projection_transform
Summary: Update the docstring for try_get_projection_transform on the API design.

Reviewed By: kjchalup

Differential Revision: D39227333

fbshipit-source-id: c9d0e625735d4972116d1f71865fb9b763e684de
2022-09-02 13:44:08 -07:00
Jiali Duan
84fa966643 Fix the typing for a Camera helper function
Summary: Fixed the typing for try_get_projection_transform.

Reviewed By: kjchalup

Differential Revision: D39211811

fbshipit-source-id: ef05c6b545831d1a9f3c754aeb02fb9776e360ed
2022-09-01 12:37:02 -07:00
Pyre Bot Jr
c80e5fd07a suppress errors in vision/fair/pytorch3d
Reviewed By: kjchalup

Differential Revision: D39198333

fbshipit-source-id: 3f4ebcf625215f21d165073837578ff69b05f72d
2022-09-01 11:46:55 -07:00
Jiali Duan
d19e6243d0 Update Rasterizer and add end2end fisheye integration test
Summary:
1) Update rasterizer/point rasterizer to accommodate fisheyecamera. Specifically, transform_points is in placement of explicit transform compositions.

2) In rasterizer unittests, update corresponding tests for rasterizer and point_rasterizer. Address comments to test fisheye against perspective camera when distortions are turned off.

3) Address comments to add end2end test for fisheyecameras. In test_render_meshes, fisheyecameras are added to camera enuerations whenever possible.

4) Test renderings with fisheyecameras of different params on cow mesh.

5) Use compositions for linear cameras whenever possible.

Reviewed By: kjchalup

Differential Revision: D38932736

fbshipit-source-id: 5b7074fc001f2390f4cf43c7267a8b37fd987547
2022-08-31 16:50:41 -07:00
Jiali Duan
b0515e1461 Amend D38407094: Fisheye Camera for PyTorch3D
Summary:
Amend FisheyeCamera by adding tests for all
combination of params and for different batch_sizes.

Reviewed By: kjchalup

Differential Revision: D39176747

fbshipit-source-id: 830d30da24beeb2f0df52db0b17a4303ed53b59c
2022-08-31 13:50:50 -07:00
Chris Lambert
d4a1051e0f Remove pytorch3d's wrappers for eigh, solve, lstsq, qr
Summary: Remove the compat functions eigh, solve, lstsq, and qr. Migrate callers to use torch.linalg directly.

Reviewed By: bottler

Differential Revision: D39172949

fbshipit-source-id: 484230a553237808f06ee5cdfde64651cba91c4c
2022-08-31 13:04:07 -07:00
Jeremy Reizenstein
9a1213e0e5 test order fix
Summary: A dummy value in test_opengl_utils seems to be able to break tests in test_mesh_renderer_opengl{,_to}.

Reviewed By: kjchalup

Differential Revision: D39173275

fbshipit-source-id: 83b15159f70135ea575d5085c7b6b37badd6e49e
2022-08-31 11:47:51 -07:00
Krzysztof Chalupka
95771985b7 Make PyTorch3D C++17 incompatible again :(
Summary: D38919607 (c4545a7cbc) and D38858887 (06cbba2628) were premature, turns out CUDA 10.2 doesn't support C++17.

Reviewed By: bottler

Differential Revision: D39156205

fbshipit-source-id: 5e2e84cc4a57d1113a915166631651d438540d56
2022-08-31 02:38:31 -07:00
Sergii Dymchenko
1530a66469 Update deprecated torch.symeig in vision/fair/pytorch3d/projects/nerf/nerf/eval_video_utils.py
Summary:
torch.symeig is deprecated for a long time and is being removed by https://github.com/pytorch/pytorch/pull/70988.

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: bottler

Differential Revision: D39153103

fbshipit-source-id: 3a1397b6d86fb3e45e4777e06a4da3ee76591b32
2022-08-30 17:15:11 -07:00
David Novotny
1163eaab43 CO3Dv2 trainer configs
Summary:
Adds yaml configs to train selected methods on CO3Dv2.

Few more updates:
1) moved some fields to base classes so that we can check is_multisequence in experiment.py
2) skip loading all train cameras for multisequence datasets, without this, co3d-fewview is untrainable
3) fix bug in json index dataset provider v2

Reviewed By: kjchalup

Differential Revision: D38952755

fbshipit-source-id: 3edac6fc8e20775aa70400bd73a0e6d52b091e0c
2022-08-30 13:42:19 -07:00
Jiali Duan
03562d87f5 Benchmark Cameras
Summary: Address comments to add benchmarkings for cameras and the new fisheye cameras. The dependency functions in test_cameras have been updated in Diff 1. The following two snapshots show benchmarking results.

Reviewed By: kjchalup

Differential Revision: D38991914

fbshipit-source-id: 51fe9bb7237543e4ee112c9f5068a4cf12a9d482
2022-08-28 11:43:46 -07:00
Jiali Duan
2283c292a9 Fisheye Camera for PyTorch3D
Summary:
1. A Fisheye camera model that generalizes pinhole camera by considering distortions (i.e. radial, tangential and thin-prism distortions).

2. Added tests against perspective cameras when distortions are off and Aria data points when distortions are on.

3. Address comments to test unhandled shapes between points and transforms. Added tests for __FIELDS, shape broadcasts, cuda etc.

4. Address earlier comments for code efficiency (e.g., adopted torch.norm; torch.solve for matrix inverse; removed inplace operations; unnecessary clone; expand in place of repeat etc).

Reviewed By: jcjohnson

Differential Revision: D38407094

fbshipit-source-id: a3ab48c85c496ac87af692d5d461bb3fc2a2db13
2022-08-28 11:17:20 -07:00
Darijan Gudelj
4711d12a09 MultiPassEmissionAbsorptionRenderer
Summary: I think there is a typo here could not find any MultiPassEARenderer just MultiPassEmissionAbsorptionRenderer?

Reviewed By: bottler

Differential Revision: D39056641

fbshipit-source-id: 4dd0b123fc795a0083a957786c032e23dc5abac9
2022-08-26 09:23:49 -07:00
Darijan Gudelj
e7c609f198 Decoding functions
Summary: Added replacable decoding functions which will be applied after the voxel grid to get color and density

Reviewed By: bottler

Differential Revision: D38829763

fbshipit-source-id: f21ce206c1c19548206ea2ce97d7ebea3de30a23
2022-08-26 08:47:30 -07:00
Darijan Gudelj
24f5f4a3e7 VoxelGridModule
Summary: Simple wrapper around voxel grids to make them a module

Reviewed By: bottler

Differential Revision: D38829762

fbshipit-source-id: dfee85088fa3c65e396cc7d3bf7ebaaffaadb646
2022-08-25 09:40:43 -07:00
Krzysztof Chalupka
6653f4400b Fix up docstrings
Summary:
One of the docstrings is a disaster see https://pytorch3d.readthedocs.io/en/latest/modules/ops.html

Also some minor fixes I encountered when browsing the code

Reviewed By: bottler

Differential Revision: D38581595

fbshipit-source-id: 3b6ca97788af380a44df9144a6a4cac782c6eab8
2022-08-23 14:58:49 -07:00
Krzysztof Chalupka
c4545a7cbc Add structured bindings to iou to prove that we're C++17-friendly. Also other minor improvements to bbox iou
Summary: Recently we removed C++14-only compilation, should work.

Reviewed By: bottler

Differential Revision: D38919607

fbshipit-source-id: 6a26fa7713f7ba2163364ccc673ad774aa3a5adb
2022-08-23 13:35:21 -07:00
Jeremy Reizenstein
5e7707b157 Update SMPL url
Summary: Fix issue #1306

Reviewed By: kjchalup

Differential Revision: D38941342

fbshipit-source-id: 306ea698ab6af22b874df6e2abdaa9021b65e1ef
2022-08-23 13:19:18 -07:00
Krzysztof Chalupka
a65928dcb9 Remove spurious compute in _compute_vertex_normals
Summary: https://github.com/facebookresearch/pytorch3d/issues/736

Reviewed By: bottler

Differential Revision: D38881935

fbshipit-source-id: 62aa3575513ab752a5afda4a257a985032bc7f6d
2022-08-23 10:08:14 -07:00
Darijan Gudelj
898ba5c53b Moved MLP and Transformer
Summary: Moved the MLP and transformer from nerf to a new file to be reused.

Reviewed By: bottler

Differential Revision: D38828150

fbshipit-source-id: 8ff77b18b3aeeda398d90758a7bcb2482edce66f
2022-08-23 07:22:41 -07:00
Darijan Gudelj
edee25a1e5 voxel grids with interpolation
Summary: Added voxel grid classes from TensoRF, both in their factorized (CP and VM) and full form.

Reviewed By: bottler

Differential Revision: D38465419

fbshipit-source-id: 8b306338af58dc50ef47a682616022a0512c0047
2022-08-23 07:22:41 -07:00
Jeremy Reizenstein
af799facdd silence stalebot
Summary: Stop stale workflow

Reviewed By: kjchalup

Differential Revision: D38858730

fbshipit-source-id: 25a5c00a0295739bac841ca6f0d5ff8230e689d0
2022-08-23 06:57:54 -07:00
Georgia Gkioxari
1bfe6bf20a eps fix for iou3d
Summary: Fix EPS issue that causes numerical instabilities when boxes are very close

Reviewed By: kjchalup

Differential Revision: D38661465

fbshipit-source-id: d2b6753cba9dc2f0072ace5289c9aa815a1a29f6
2022-08-22 04:26:19 -07:00
Jeremy Reizenstein
06cbba2628 Don't force C++14
Summary: Remove compiler arguments which insist on C++14.

Reviewed By: kjchalup

Differential Revision: D38858887

fbshipit-source-id: 542173ec97cacfa724d14c8a4b9ce9dc2457c5d5
2022-08-21 12:10:51 -07:00
Jeremy Reizenstein
7ce31b4e0f updates to CONTRIBUTING
Summary: Fix outdated info

Reviewed By: kjchalup

Differential Revision: D38858766

fbshipit-source-id: 52b120f355e8f9e86d777875627af02c80ee45b6
2022-08-21 11:51:46 -07:00
Max Wasylow
8ea4da2938 Replacing custom CUDA block reductions with CUB in sample_farthest_points
Summary: Removing hardcoded block reduction operation from `sample_farthest_points.cu` code, and replace it with `cub::BlockReduce` reducing complexity of the code, and letting established libraries do the thinking for us.

Reviewed By: bottler

Differential Revision: D38617147

fbshipit-source-id: b230029c55f05cda0aab1648d3105a8d3e92d27b
2022-08-19 09:17:19 -07:00
David Novotny
597bc7c7f6 Blender config fixes
Summary: Fixes the blender synthetic configs.

Reviewed By: kjchalup

Differential Revision: D38786095

fbshipit-source-id: 6d0784ced41a3f2904f074221108cdb56bd20e7f
2022-08-19 06:03:34 -07:00
Darijan Gudelj
f825f7e42c Split Volumes class to data and location part
Summary: Split Volumes class to data and location part so that location part can be reused in planned VoxelGrid classes.

Reviewed By: bottler

Differential Revision: D38782015

fbshipit-source-id: 489da09c5c236f3b81961ce9b09edbd97afaa7c8
2022-08-18 08:12:33 -07:00
Jeremy Reizenstein
fdaaa299a7 remove stray "generic_model_args" references
Summary:
generic_model_args no longer exists. Update some references to it, mostly in doc.

This fixes the testing of all the yaml files in test_forward pass.

Reviewed By: shapovalov

Differential Revision: D38789202

fbshipit-source-id: f11417efe772d7f86368b3598aa66c52b1309dbf
2022-08-18 07:18:55 -07:00
Jeremy Reizenstein
d42e0d3d86 1GPU for implicitron tests
Reviewed By: shapovalov

Differential Revision: D38794764

fbshipit-source-id: 140c8a935d760bab8569d903cc52ac3dd73cd553
2022-08-18 03:23:21 -07:00
Christoph Lassner
7623457686 Removing LOGGER.debug statements for performance gain. (#1260)
Summary:
We identified that these logging statements can deteriorate performance in certain cases. I propose removing them from the regular renderer implementation and letting individuals re-insert debug logging wherever needed on a case-by-case basis.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1260

Reviewed By: kjchalup

Differential Revision: D38737439

Pulled By: bottler

fbshipit-source-id: cf9dcbbeae4dbf214c2e17d5bafa00b2ff796393
2022-08-17 12:22:05 -07:00
Roman Shapovalov
d281f8efd1 Filtering outlier input cameras in trajectory estimation
Summary: Useful for visualising colmap output where some frames are not correctly registered.

Reviewed By: bottler

Differential Revision: D38743191

fbshipit-source-id: e823df2997870dc41d76784e112d4349f904d311
2022-08-17 03:47:31 -07:00
Roman Shapovalov
b7c826b786 Boolean indexing of cameras
Summary: Reasonable to expect bool indexing.

Reviewed By: bottler, kjchalup

Differential Revision: D38741446

fbshipit-source-id: 22b607bf13110043c5624196c66ca1484fdbce6c
2022-08-16 15:19:39 -07:00
Ashish Sinha
60808972b8 typo fix (#1293)
Summary:
fixes typo of the docstring.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1293

Differential Revision: D38737416

Pulled By: bottler

fbshipit-source-id: 3f9da3e97b55c2acd858263de9e85eaee272a98f
2022-08-16 06:46:11 -07:00
David Novotny
d35781f2d7 Rename psnr -> psnr_masked to avoid confusion
Summary: Previously, "psnr" was evaluated between the masked g.t. image and the render. To avoid confusion, "psnr" is now renamed to "psnr_masked".

Reviewed By: bottler

Differential Revision: D38707511

fbshipit-source-id: 8ee881ab1a05453d6692dde9782333a47d8c1234
2022-08-15 09:11:52 -07:00
Jeremy Reizenstein
b6771233e0 builds for PyTorch 1.12.1, drop 1.8
Summary: Builds for new PyTorch 1.12.1. Drop builds for PyTorch 1.8.0 and 1.8.1.

Reviewed By: kjchalup

Differential Revision: D38658991

fbshipit-source-id: 6192e226c2154cd051eeee98498d9a395cfd6fd5
2022-08-15 08:51:12 -07:00
David Novotny
2ff2c7c836 Enable additional test-time source views for json dataset provider v2
Summary: Adds additional source views to the eval batches for evaluating many-view models on CO3D Challenge

Reviewed By: bottler

Differential Revision: D38705904

fbshipit-source-id: cf7d00dc7db926fbd1656dd97a729674e9ff5adb
2022-08-15 08:40:09 -07:00
Jeremy Reizenstein
e8616cc8ba news to README
Summary: 0.6.2 and 0.7.0

Reviewed By: kjchalup

Differential Revision: D38659393

fbshipit-source-id: eb99f3fbe381039b391419c878b7bbac4a88d619
2022-08-12 22:55:34 -07:00
David Novotny
7b985702bb Add full-image PSNR metric
Summary: Reports also the PSNR between the unmasked G.T. image and the render.

Reviewed By: bottler

Differential Revision: D38655943

fbshipit-source-id: 1603a2d02116ea1ce037e5530abe1afc65a2ba93
2022-08-12 07:56:44 -07:00
Luca Di Grazia
a91f15f24e Incompatible variable type fixed (#1288)
Summary:
**"filename"**: "projects/nerf/nerf/implicit_function.py"
**"warning_type"**: "Incompatible variable type [9]",
**"warning_message"**: " input_skips is declared to have type `Tuple[int]` but is used as type `Tuple[]`.",
**"warning_line"**: 256,
**"fix"**: input_skips: Tuple[int,...] = ()

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1288

Reviewed By: kjchalup

Differential Revision: D38615188

Pulled By: bottler

fbshipit-source-id: a014344dd6cf2125f564f948a3c905ceb84cf994
2022-08-11 08:54:37 -07:00
Jeremy Reizenstein
276c9a8acb version 0.7.0
Summary: new version number

Reviewed By: patricklabatut

Differential Revision: D38426307

fbshipit-source-id: 60c6ab53bb46bdece6f20c8fed14f2351f1c606e
2022-08-09 20:48:51 -07:00
Jeremy Reizenstein
791a068183 avoid math.prod for python 3.7
Summary: This makes the new volumes tutorial work on google colab.

Reviewed By: kjchalup

Differential Revision: D38501906

fbshipit-source-id: a606a357e929dae903dc4d9067bd1519f05b1458
2022-08-09 20:48:51 -07:00
Jeremy Reizenstein
c49ebad249 tutorial fix: add visdom
Summary: need to pip install visdom in new volumes tutorial.

Reviewed By: kjchalup

Differential Revision: D38501905

fbshipit-source-id: 534bf097e41f05b3389e9420e6dd2b61a4517861
2022-08-09 20:48:51 -07:00
Jeremy Reizenstein
1cd0cbffb8 implicitron readme updates
Summary: add link in main readme

Reviewed By: kjchalup

Differential Revision: D38560053

fbshipit-source-id: 0814febb67d0580394cfa2664e49e31ff7254bd4
2022-08-09 20:48:51 -07:00
Jeremy Reizenstein
af48430ec0 IT readme updates
Summary: Updates for recent replaceables.

Reviewed By: kjchalup

Differential Revision: D38437370

fbshipit-source-id: 00d600aa451e5849ba48107cd7a4319e9fc8549f
2022-08-09 20:48:51 -07:00
Jeremy Reizenstein
a39cad40f4 LinearExponential LR
Summary: Linear followed by exponential LR progression. Needed for making Blender scenes converge.

Reviewed By: kjchalup

Differential Revision: D38557007

fbshipit-source-id: ad630dbc5b8fabcb33eeb5bdeed5e4f31360bac2
2022-08-09 18:18:46 -07:00
Jeremy Reizenstein
65e5bb3ea1 update notebooks for 0.7.0
Summary: We now expect pytorch 1.12

Reviewed By: patricklabatut

Differential Revision: D38425758

fbshipit-source-id: a22e672fcb0dc18f7d6424323d9cc6aaf5fcb4c6
2022-08-09 17:52:37 -07:00
Krzysztof Chalupka
c83ec3555d Mods and bugfixes for LLFF and Blender repros
Summary:
LLFF (and most/all non-synth datasets) will have no background/foreground distinction. Add support for data with no fg mask.

Also, we had a bug in stats loading, like this:
  * Load stats
  * One of the stats has a history of length 0
  * That's fine, e.g. maybe it's fg_error but the dataset has no notion of fg/bg. So leave it as len 0
  * Check whether all the stats have the same history length as an arbitrarily chosen "reference-stat"
  * Ooops the reference-stat happened to be the stat with length 0
  * assert (legit_stat_len == reference_stat_len (=0)) ---> failed assert

Also some minor fixes (from Jeremy's other diff) to support LLFF

Reviewed By: davnov134

Differential Revision: D38475272

fbshipit-source-id: 5b35ac86d1d5239759f537621f41a3aa4eb3bd68
2022-08-09 15:04:44 -07:00
Pyre Bot Jr
624bc5a274 suppress errors in vision/fair/pytorch3d
Differential Revision: D38529199

fbshipit-source-id: 4bc0574493b60f13e08d9ea7bded862778b3d171
2022-08-08 23:59:04 -07:00
Jeremy Reizenstein
e924de4bf2 add implicitron tutorials to website
Summary: Adding the implicitron tutorials to the website

Reviewed By: kjchalup

Differential Revision: D38508673

fbshipit-source-id: b38d43174acf6e1355b14bf6d58513f6696e7fa0
2022-08-08 14:26:58 -07:00
Roman Shapovalov
a393cccf6a Make multisequence evaluator use only cameras within a batch (fixes OOM in v2)
Summary: In a multisequence (fewview) scenario, it does not make sense to use all cameras for evaluating the difficulty as they come from different scenes. Using only this batch’s source (known) cameras instead.

Reviewed By: bottler

Differential Revision: D38491070

fbshipit-source-id: d6312d8fbb125b28a33db9f53d4215bcd1ca28a8
2022-08-08 04:43:21 -07:00
Jeremy Reizenstein
0e913b1c2e PYTORCH3D_NO_EXTENSION
Summary:
Request in https://github.com/facebookresearch/pytorch3d/issues/1233 for option to disable CUDA build.

Also option to disable binary build completely. This could be useful e.g. in the config tutorial where we need a small python-only part of pytorch3d.

Reviewed By: kjchalup

Differential Revision: D38458624

fbshipit-source-id: 421a0b1cc31306d7e322d3e743e30a7533d7f034
2022-08-08 04:16:26 -07:00
Sergey Prokudin
bd93e9ce21 small fix to the llff dataloader (#1281)
Summary:
simply fixing a typo in _ls function

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1281

Reviewed By: patricklabatut

Differential Revision: D38457259

Pulled By: bottler

fbshipit-source-id: 5204a57cb4d1fe1c804d8af3301b8ea2945443e8
2022-08-05 11:22:34 -07:00
Jeremy Reizenstein
da9584357e circleci fixes
Summary:
Misc fixes.

- most important: the mac image is gone so switch to a newer one.
- torch.concat is new; was used accidentally
- remove lpips from testing in meta.yaml as it is breaking the conda test. Better to leave the relevant tests failing in OSS.
- TypedDict usage is breaking implicitron on Python 3.7.

Reviewed By: patricklabatut

Differential Revision: D38458164

fbshipit-source-id: b16c26453a743b9a771e2a6787b9a4d2a52e41c2
2022-08-05 08:58:17 -07:00
Jeremy Reizenstein
5b8a9b34a0 clarify GM.bg_color
Summary: This field is specific to one purpose.

Reviewed By: patricklabatut

Differential Revision: D38424891

fbshipit-source-id: e017304497012430c30e436da7052b9ad6fc7614
2022-08-05 03:39:39 -07:00
Jeremy Reizenstein
02c0254f7f more globalencoder followup
Summary: remove n_instances==0 special case, standardise args for GlobalEncoderBase's forward.

Reviewed By: shapovalov

Differential Revision: D37817340

fbshipit-source-id: 0aac5fbc7c336d09be9d412cffff5712bda27290
2022-08-05 03:33:30 -07:00
Jeremy Reizenstein
9d888f1332 install trainer inside pytorch3d
Summary: One way to tidy the installation so we don't install files in site-packages/projects. Fixes https://github.com/facebookresearch/pytorch3d/issues/1279

Reviewed By: shapovalov, davnov134

Differential Revision: D38426772

fbshipit-source-id: ac1a54fbf230adb53904701e1f38bf9567f647ce
2022-08-05 02:49:42 -07:00
Pyre Bot Jr
a0f786f4cf upgrade pyre version in fbcode/vision - batch 2
Differential Revision: D38448021

fbshipit-source-id: 966708035115b4870a74f0ca0bbf8ea88b853527
2022-08-04 22:18:46 -07:00
Jeremy Reizenstein
b28754f8e1 config system tutorial
Summary: new

Reviewed By: kjchalup

Differential Revision: D38425731

fbshipit-source-id: 0fd8f524df6b29ceb8c7c9a674022412c1efc3b5
2022-08-04 13:24:15 -07:00
Jeremy Reizenstein
89d8eebc5a volumes tutorial
Summary: new

Reviewed By: kjchalup

Differential Revision: D38425739

fbshipit-source-id: 23e7a1dd01c034b231511acecf40ea0deb9a067f
2022-08-04 13:19:38 -07:00
David Novotny
326716781b - fail if CO3Dv2 path is not given even if path_manager is None
Summary: ... see title

Reviewed By: bottler

Differential Revision: D38430103

fbshipit-source-id: fd0696da82c367b0f4d9c9d92c0cba0230834137
2022-08-04 11:10:48 -07:00
Jeremy Reizenstein
46e82efb4e clean IF args
Summary: continued - avoid duplicate inputs

Reviewed By: davnov134

Differential Revision: D38248827

fbshipit-source-id: 91ed398e304496a936f66e7a70ab3d189eeb5c70
2022-08-03 12:37:31 -07:00
Jeremy Reizenstein
078846d166 clean renderer args
Summary: continued - don't duplicate inputs

Reviewed By: kjchalup

Differential Revision: D38248829

fbshipit-source-id: 2d56418ecbec9cc597c3cf0c122199e274661516
2022-08-03 12:37:31 -07:00
Jeremy Reizenstein
f45893b845 clean raysampler args
Summary: Don't copy from one part of config to another, rather do the copy within GenericModel.

Reviewed By: davnov134

Differential Revision: D38248828

fbshipit-source-id: ff8af985c37ea1f7df9e0aa0a45a58df34c3f893
2022-08-03 12:37:31 -07:00
Darijan Gudelj
5f069dbb7e open_dict for tweaking
Summary: Made the config system call open_dict when it calls the tweak function.

Reviewed By: shapovalov

Differential Revision: D38315334

fbshipit-source-id: 5924a92d8d0bf399bbf3788247f81fc990e265e7
2022-08-03 05:33:46 -07:00
David Novotny
c3f8dad55c Move load_stats to TrainingLoop
Summary:
Stats are logically connected to the training loop, not to the model. Hence, moving to the training loop.

Also removing resume_epoch from OptimizerFactory in favor of a single place - ModelFactory. This removes the need for config consistency checks etc.

Reviewed By: kjchalup

Differential Revision: D38313475

fbshipit-source-id: a1d188a63e28459df381ff98ad8acdcdb14887b7
2022-08-02 15:40:53 -07:00
Krzysztof Chalupka
760305e044 Fix test evaluation for Blender data
Summary: Blender data doesn't have depths or crops.

Reviewed By: shapovalov

Differential Revision: D38345583

fbshipit-source-id: a19300daf666bbfd799d0038aeefa14641c559d7
2022-08-02 12:40:21 -07:00
Jeremy Reizenstein
3a063f5976 SimpleDataLoaderMapProvider
Summary: Simple DataLoaderMapProvider instance

Reviewed By: davnov134

Differential Revision: D38326719

fbshipit-source-id: 58556833e76fae5790d25a59bea0aac4ce046bf1
2022-08-02 12:10:05 -07:00
Darijan Gudelj
c63ec81750 fix eval_batches in V1
Summary: fix to the D38275943 (597e0259dc).

Reviewed By: bottler

Differential Revision: D38355683

fbshipit-source-id: f326f45279fafa57f24b9211ebd3fda18a518937
2022-08-02 09:09:47 -07:00
Krzysztof Chalupka
b7b188bf54 Fix train_stats.pdf: they now work by default
Summary: Before this diff, train_stats.py would not be created by default, EXCEPT when resuming training. This makes them appear from start.

Reviewed By: shapovalov

Differential Revision: D38320341

fbshipit-source-id: 8ea5b99ec81c377ae129f58e78dc2eaff94821ad
2022-08-02 08:50:50 -07:00
Jeremy Reizenstein
f8bf528043 remove get_task
Summary: Remove the dataset's need to provide the task type.

Reviewed By: davnov134, kjchalup

Differential Revision: D38314000

fbshipit-source-id: 3805d885b5d4528abdc78c0da03247edb9abf3f7
2022-08-02 07:55:42 -07:00
Darijan Gudelj
37250a4326 Add forbidden fields to map_provider_v2
Summary:
Added _NEED_CONTROL
 to JsonIndexDatasetMapProviderV2 and made dataset_tweak_args use it.

Reviewed By: bottler

Differential Revision: D38313914

fbshipit-source-id: 529847571065dfba995b609a66737bd91e002cfe
2022-08-02 06:38:51 -07:00
Jeremy Reizenstein
3b7ab22d10 MeshRasterizerOpenGL import fixes
Summary: Only import it if you ask for it.

Reviewed By: kjchalup

Differential Revision: D38327167

fbshipit-source-id: 3f05231f26eda582a63afc71b669996342b0c6f9
2022-08-02 04:32:32 -07:00
David Novotny
5bf6d532f7 Better error message when dataset root set wrongly in JsonIndexDatasetMapProviderV2
Summary: <see title>

Reviewed By: bottler

Differential Revision: D38314727

fbshipit-source-id: 7178b816a22b06af938a35c5f7bb88404fb1b1c4
2022-08-01 14:08:19 -07:00
Darijan Gudelj
597e0259dc Made eval_batches be set inside the __init__
Summary: Made eval_batches be set in call to `__init__` not after the construction as they were before

Reviewed By: bottler

Differential Revision: D38275943

fbshipit-source-id: 32737401d1ddd16c284e1851b7a91f8b041c406f
2022-08-01 10:23:34 -07:00
David Novotny
80fc0ee0b6 Better seeding of random engines
Summary: Currently, seeds are set only inside the train loop. But this does not ensure that the model weights are initialized the same way everywhere which makes all experiments irreproducible. This diff fixes it.

Reviewed By: bottler

Differential Revision: D38315840

fbshipit-source-id: 3d2ecebbc36072c2b68dd3cd8c5e30708e7dd808
2022-08-01 10:03:09 -07:00
David Novotny
0c3599e8ee Correct MC rasterization pt. radius
Summary: Fixes the MC rasterization bug

Reviewed By: bottler

Differential Revision: D38312234

fbshipit-source-id: 910cf809ef3faff3de7a8d905b0821f395a52edf
2022-08-01 04:53:59 -07:00
Jeremy Reizenstein
14bd5e28e8 provide cow dataset
Summary: Make a dummy single-scene dataset using the code from generate_cow_renders (used in existing NeRF tutorials)

Reviewed By: kjchalup

Differential Revision: D38116910

fbshipit-source-id: 8db6df7098aa221c81d392e5cd21b0e67f65bd70
2022-08-01 01:52:12 -07:00
Krzysztof Chalupka
1b0584f7bd Replace pluggable components to create a proper Configurable hierarchy.
Summary:
This large diff rewrites a significant portion of Implicitron's config hierarchy. The new hierarchy, and some of the default implementation classes, are as follows:
```
Experiment
    data_source: ImplicitronDataSource
        dataset_map_provider
        data_loader_map_provider
    model_factory: ImplicitronModelFactory
        model: GenericModel
    optimizer_factory: ImplicitronOptimizerFactory
    training_loop: ImplicitronTrainingLoop
        evaluator: ImplicitronEvaluator
```

1) Experiment (used to be ExperimentConfig) is now a top-level Configurable and contains as members mainly (mostly new) high-level factory Configurables.
2) Experiment's job is to run factories, do some accelerate setup and then pass the results to the main training loop.
3) ImplicitronOptimizerFactory and ImplicitronModelFactory are new high-level factories that create the optimizer, scheduler, model, and stats objects.
4) TrainingLoop is a new configurable that runs the main training loop and the inner train-validate step.
5) Evaluator is a new configurable that TrainingLoop uses to run validation/test steps.
6) GenericModel is not the only model choice anymore. Instead, ImplicitronModelBase (by default instantiated with GenericModel) is a member of Experiment and can be easily replaced by a custom implementation by the user.

All the new Configurables are children of ReplaceableBase, and can be easily replaced with custom implementations.

In addition, I added support for the exponential LR schedule, updated the config files and the test, as well as added a config file that reproduces NERF results and a test to run the repro experiment.

Reviewed By: bottler

Differential Revision: D37723227

fbshipit-source-id: b36bee880d6aa53efdd2abfaae4489d8ab1e8a27
2022-07-29 17:32:51 -07:00
Jeremy Reizenstein
6b481595f0 redefinition -> defaults kept in config
Summary:
This is an internal change in the config systen. It allows redefining a pluggable implementation with new default values. This is useful in notebooks / interactive use. For example, this now works.

        class A(ReplaceableBase):
            pass

        registry.register
        class B(A):
            i: int = 4

        class C(Configurable):
            a: A
            a_class_type: str = "B"

            def __post_init__(self):
                run_auto_creation(self)

        expand_args_fields(C)

        registry.register
        class B(A):
            i: int = 5

        c = C()

        assert c.a.i == 5

Reviewed By: shapovalov

Differential Revision: D38219371

fbshipit-source-id: 72911a9bd3426d3359cf8802cc016fc7f6d7713b
2022-07-28 09:39:18 -07:00
Krzysztof Chalupka
cb49550486 Add MeshRasterizerOpenGL
Summary:
Adding MeshRasterizerOpenGL, a faster alternative to MeshRasterizer. The new rasterizer follows the ideas from "Differentiable Surface Rendering via non-Differentiable Sampling".

The new rasterizer 20x faster on a 2M face mesh (try pose optimization on Nefertiti from https://www.cs.cmu.edu/~kmcrane/Projects/ModelRepository/!). The larger the mesh, the larger the speedup.

There are two main disadvantages:
* The new rasterizer works with an OpenGL backend, so requires pycuda.gl and pyopengl installed (though we avoided writing any C++ code, everything is in Python!)
* The new rasterizer is non-differentiable. However, you can still differentiate the rendering function if you use if with the new SplatterPhongShader which we recently added to PyTorch3D (see the original paper cited above).

Reviewed By: patricklabatut, jcjohnson

Differential Revision: D37698816

fbshipit-source-id: 54d120639d3cb001f096237807e54aced0acda25
2022-07-22 15:52:50 -07:00
Krzysztof Chalupka
36edf2b302 Add .to methods to the splatter and SplatterPhongShader.
Summary: Needed to properly change devices during OpenGL rasterization.

Reviewed By: jcjohnson

Differential Revision: D37698568

fbshipit-source-id: 38968149d577322e662d3b5d04880204b0a7be29
2022-07-22 14:36:22 -07:00
Krzysztof Chalupka
78bb6d17fa Add EGLContext and DeviceContextManager
Summary:
EGLContext is a utility to render with OpenGL without an attached display (that is, without a monitor).

DeviceContextManager allows us to avoid unnecessary context creations and releases. See docstrings for more info.

Reviewed By: jcjohnson

Differential Revision: D36562551

fbshipit-source-id: eb0d2a2f85555ee110e203d435a44ad243281d2c
2022-07-22 09:43:05 -07:00
Jeremy Reizenstein
54c75b4114 GM error for unbatched inputs
Summary: Error when sending an unbatched FrameData through GM.

Reviewed By: shapovalov

Differential Revision: D38036286

fbshipit-source-id: b8d280c61fbbefdc112c57ccd630ab3ccce7b44e
2022-07-21 15:10:24 -07:00
Jeremy Reizenstein
3783437d2f lazy all_train_cameras
Summary: Avoid calculating all_train_cameras before it is needed, because it is slow in some datasets.

Reviewed By: shapovalov

Differential Revision: D38037157

fbshipit-source-id: 95461226655cde2626b680661951ab17ebb0ec75
2022-07-21 15:04:00 -07:00
Jeremy Reizenstein
b2dc520210 lints
Summary: lint issues (mostly flake) in implicitron

Reviewed By: patricklabatut

Differential Revision: D37920948

fbshipit-source-id: 8cb3c2a2838d111c80a211c98a404c210d4649ed
2022-07-21 13:33:49 -07:00
Jeremy Reizenstein
8597d4c5c1 dependencies for testing
Summary: We especially need omegaconf when testing impicitron.

Reviewed By: patricklabatut

Differential Revision: D37921440

fbshipit-source-id: 4e66fde35aa29f60eabd92bf459cd584cfd7e5ca
2022-07-21 13:22:19 -07:00
Jeremy Reizenstein
38fd8380f7 fix ndc/screen problem in blender/llff (#39)
Summary:
X-link: https://github.com/fairinternal/pytorch3d/pull/39

Blender and LLFF cameras were sending screen space focal length and principal point to a camera init function expecting NDC

Reviewed By: shapovalov

Differential Revision: D37788686

fbshipit-source-id: 2ddf7436248bc0d174eceb04c288b93858138582
2022-07-19 10:38:13 -07:00
Jeremy Reizenstein
67840f8320 multiseq conditioning type
Summary: Add the conditioning types to the repro yaml files. In particular, this fixes test_conditioning_type.

Reviewed By: shapovalov

Differential Revision: D37914537

fbshipit-source-id: 621390f329d9da662d915eb3b7bc709206a20552
2022-07-18 03:11:40 -07:00
Jeremy Reizenstein
9b2e570536 option to avoid accelerate
Summary: For debugging, introduce PYTORCH3D_NO_ACCELERATE env var.

Reviewed By: shapovalov

Differential Revision: D37885393

fbshipit-source-id: de080080c0aa4b6d874028937083a0113bb97c23
2022-07-17 13:15:59 -07:00
Iurii Makarov
0f966217e5 Fixed typing to have compatibility with OmegaConf 2.2.2 in Pytorch3D
Summary:
I tried to run `experiment.py` and `pytorch3d_implicitron_runner` and faced the failure with this traceback: https://www.internalfb.com/phabricator/paste/view/P515734086

It seems to be due to the new release of OmegaConf (version=2.2.2) which requires different typing. This fix helped to overcome it.

Reviewed By: bottler

Differential Revision: D37881644

fbshipit-source-id: be0cd4ced0526f8382cea5bdca9b340e93a2fba2
2022-07-15 05:55:03 -07:00
Jiali Duan
379c8b2780 Fix Pytorch3D PnP test
Summary:
EPnP fails the test when the number of points is below 6. As suggested, quadratic option is in theory to deal with as few as 4 points (so num_pts_thresh=3 is set). And when num_pts > num_pts_thresh=4, skip_q is False.

To avoid bumping num_pts_thresh while passing all the original tests, check_output is set to False when num_pts < 6, similar to the logic in Line 123-127.  It makes sure that the algo doesn't crash.

Reviewed By: shapovalov

Differential Revision: D37804438

fbshipit-source-id: 74576d63a9553e25e3ec344677edb6912b5f9354
2022-07-14 09:50:39 -07:00
Jeremy Reizenstein
8e0c82b89a lint fix: raise from None
Summary: New linter warning is complaining about `raise` inside `except`.

Reviewed By: kjchalup

Differential Revision: D37819264

fbshipit-source-id: 56ad5d0558ea39e1125f3c76b43b7376aea2bc7c
2022-07-14 04:21:44 -07:00
David Novotny
8ba9a694ee Remove -1 from crop mask
Summary: Removing 1 from the crop mask does not seem sensible.

Reviewed By: bottler, shapovalov

Differential Revision: D37843680

fbshipit-source-id: 70cec80f9ea26deac63312da62b9c8af27d2a010
2022-07-14 03:30:51 -07:00
Roman Shapovalov
36ba079bef Fixes to CO3Dv2 provider.
Summary:
1. Random sampling of num batches without replacement not supported.
2.Providers should implement the interface for the training loop to work.

Reviewed By: bottler, davnov134

Differential Revision: D37815388

fbshipit-source-id: 8a2795b524e733f07346ffdb20a9c0eb1a2b8190
2022-07-13 09:45:29 -07:00
Jeremy Reizenstein
b95ec190af followups to D37592429
Summary: Fixing comments on D37592429 (0dce883241)

Reviewed By: shapovalov

Differential Revision: D37752367

fbshipit-source-id: 40aa7ee4dc0c5b8b7a84a09d13a3933a9e3afedd
2022-07-13 06:07:02 -07:00
Jeremy Reizenstein
55f67b0d18 add accelerate dependency
Summary: Accelerate is an additional implicitron dependency, so document it.

Reviewed By: shapovalov

Differential Revision: D37786933

fbshipit-source-id: 11024fe604107881f8ca29e17cb5cbfe492fc7f9
2022-07-13 06:00:05 -07:00
Roman Shapovalov
4261e59f51 Fix: making visualisation work again
Summary:
1. Respecting `visdom_show_preds` parameter when it is False.
2. Clipping the images pre-visualisation, which is important for methods like SRN that are not arare of pixel value range.

Reviewed By: bottler

Differential Revision: D37786439

fbshipit-source-id: 8dbb5104290bcc5c2829716b663cae17edc911bd
2022-07-13 05:29:09 -07:00
David Novotny
af55ba01f8 Fix for box_crop=True
Summary: one more bugfix in JsonIndexDataset

Reviewed By: bottler

Differential Revision: D37789138

fbshipit-source-id: 2fb2bda7448674091ff6b279175f0bbd16ff7a62
2022-07-12 10:03:58 -07:00
Jeremy Reizenstein
d3b7f5f421 fix trainer test
Summary: After recent accelerate change D37543870 (aa8b03f31d), update interactive trainer test.

Reviewed By: shapovalov

Differential Revision: D37785932

fbshipit-source-id: 9211374323b6cfd80f6c5ff3a4fc1c0ca04b54ba
2022-07-12 07:20:21 -07:00
Tristan Rice
4ecc9ea89d shader: fix HardDepthShader sizes + tests (#1252)
Summary:
This fixes a indexing bug in HardDepthShader and adds proper unit tests for both of the DepthShaders. This bug was introduced when updating the shader sizes and discovered when I switched my local model onto pytorch3d trunk instead of the patched copy.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1252

Test Plan:
Unit test + custom model code

```
pytest tests/test_shader.py
```

![image](https://user-images.githubusercontent.com/909104/178397456-f478d0e0-9f6c-467a-a85b-adb4c47adfee.png)

Reviewed By: bottler

Differential Revision: D37775767

Pulled By: d4l3k

fbshipit-source-id: 5f001903985976d7067d1fa0a3102d602790e3e8
2022-07-12 04:38:33 -07:00
Tristan Rice
8d10ba52b2 renderer: add support for rendering high dimensional textures for classification/segmentation use cases (#1248)
Summary:
For 3D segmentation problems it's really useful to be able to train the models from multiple viewpoints using Pytorch3D as the renderer. Currently due to hardcoded assumptions in a few spots the mesh renderer only supports rendering RGB (3 dimensional) data. You can encode the classification information as 3 channel data but if you have more than 3 classes you're out of luck.

This relaxes the assumptions to make rendering semantic classes work with `HardFlatShader` and `AmbientLights` with no diffusion/specular. The other shaders/lights don't make any sense for classification since they mutate the texture values in some way.

This only requires changes in `Materials` and `AmbientLights`. The bulk of the code is the unit test.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1248

Test Plan: Added unit test that renders a 5 dimensional texture and compare dimensions 2-5 to a stored picture.

Reviewed By: bottler

Differential Revision: D37764610

Pulled By: d4l3k

fbshipit-source-id: 031895724d9318a6f6bab5b31055bb3f438176a5
2022-07-11 21:22:45 -07:00
Nikhila Ravi
aa8b03f31d Updates to support Accelerate and multigpu training (#37)
Summary:
## Changes:
- Added Accelerate Library and refactored experiment.py to use it
- Needed to move `init_optimizer` and `ExperimentConfig` to a separate file to be compatible with submitit/hydra
- Needed to make some modifications to data loaders etc to work well with the accelerate ddp wrappers
- Loading/saving checkpoints incorporates an unwrapping step so remove the ddp wrapped model

## Tests

Tested with both `torchrun` and `submitit/hydra` on two gpus locally. Here are the commands:

**Torchrun**

Modules loaded:
```sh
1) anaconda3/2021.05   2) cuda/11.3   3) NCCL/2.9.8-3-cuda.11.3   4) gcc/5.2.0. (but unload gcc when using submit)
```

```sh
torchrun --nnodes=1 --nproc_per_node=2 experiment.py --config-path ./configs --config-name repro_singleseq_nerf_test
```

**Submitit/Hydra Local test**

```sh
~/pytorch3d/projects/implicitron_trainer$ HYDRA_FULL_ERROR=1 python3.9 experiment.py --config-name repro_singleseq_nerf_test --multirun --config-path ./configs  hydra/launcher=submitit_local hydra.launcher.gpus_per_node=2 hydra.launcher.tasks_per_node=2 hydra.launcher.nodes=1
```

**Submitit/Hydra distributed test**

```sh
~/implicitron/pytorch3d$ python3.9 experiment.py --config-name repro_singleseq_nerf_test --multirun --config-path ./configs  hydra/launcher=submitit_slurm hydra.launcher.gpus_per_node=8 hydra.launcher.tasks_per_node=8 hydra.launcher.nodes=1 hydra.launcher.partition=learnlab hydra.launcher.timeout_min=4320
```

## TODOS:
- Fix distributed evaluation: currently this doesn't work as the input format to the evaluation function is not suitable for gathering across gpus (needs to be nested list/tuple/dicts of objects that satisfy `is_torch_tensor`) and currently `frame_data`  contains `Cameras` type.
- Refactor the `accelerator` object to be accessible by all functions instead of needing to pass it around everywhere? Maybe have a `Trainer` class and add it as a method?
- Update readme with installation instructions for accelerate and also commands for running jobs with torchrun and submitit/hydra

X-link: https://github.com/fairinternal/pytorch3d/pull/37

Reviewed By: davnov134, kjchalup

Differential Revision: D37543870

Pulled By: bottler

fbshipit-source-id: be9eb4e91244d4fe3740d87dafec622ae1e0cf76
2022-07-11 19:29:58 -07:00
Jeremy Reizenstein
57a40b3688 fix test
Summary: remove erroneous RandomDataLoaderMapProvider

Reviewed By: davnov134

Differential Revision: D37751116

fbshipit-source-id: cf3b555dc1e6304425914d1522b4f70407b498bf
2022-07-11 06:17:48 -07:00
David Novotny
522e5f0644 Bugfix - wrong mask bounds passed to box clamping
Summary: Fixes a bug

Reviewed By: bottler

Differential Revision: D37743350

fbshipit-source-id: d68e680d6027ae2b9814b2241fb72d3b74df77c1
2022-07-10 16:01:33 -07:00
David Novotny
e8390d3500 JsonIndexDatasetProviderV2
Summary: A new version of json index dataset provider supporting CO3Dv2

Reviewed By: shapovalov

Differential Revision: D37690918

fbshipit-source-id: bf2d5fc9d0f1220259e08661dafc69cdbe6b7f94
2022-07-09 17:16:24 -07:00
David Novotny
4300030d7a Changes for CO3Dv2 release [part1]
Summary:
Implements several changes needed for the CO3Dv2 release:
- FrameData contains crop_bbox_xywh which defines the outline of the image crop corresponding to the image-shaped tensors in FrameData
- revised the definition of a bounding box inside JsonDatasetIndex: bbox_xyxy is [xmin, ymin, xmax, ymax], where xmax, ymax are not inclusive; bbox_xywh = [xmin, ymain, xmax-xmin, ymax-ymin]
- is_filtered for detecting whether the entries of the dataset were somehow filtered
- seq_frame_index_to_dataset_index allows to skip entries that are not present in the dataset

Reviewed By: shapovalov

Differential Revision: D37687547

fbshipit-source-id: 7842756b0517878cc0964fc0935d3c0769454d78
2022-07-09 17:16:24 -07:00
Jeremy Reizenstein
00acf0b0c7 cu116 docker image
Summary: cu116 builds need to happen in a specific image.

Reviewed By: patricklabatut

Differential Revision: D37680352

fbshipit-source-id: 81bef0642ad832e83e4eba6321287759b3229303
2022-07-07 23:23:37 -07:00
Jeremy Reizenstein
a94f3f4c4b Add pytorch 1.12, drop pytorch 1.7
Summary: change deps

Reviewed By: kjchalup

Differential Revision: D37612290

fbshipit-source-id: 51af55159605b0edd89ffa9e177238466fc2d993
2022-07-06 14:36:45 -07:00
Jeremy Reizenstein
efb721320a extract camera_difficulty_bin_breaks
Summary: As part of removing Task, move camera difficulty bin breaks from hard code to the top level.

Reviewed By: davnov134

Differential Revision: D37491040

fbshipit-source-id: f2d6775ebc490f6f75020d13f37f6b588cc07a0b
2022-07-06 07:13:41 -07:00
Jeremy Reizenstein
40fb189c29 typing for trainer
Summary: Enable pyre checking of the trainer code.

Reviewed By: shapovalov

Differential Revision: D36545438

fbshipit-source-id: db1ea8d1ade2da79a2956964eb0c7ba302fa40d1
2022-07-06 07:13:41 -07:00
Jeremy Reizenstein
4e87c2b7f1 get_all_train_cameras
Summary: As part of removing Task, make the dataset code generate the source cameras for itself. There's a small optimization available here, in that the JsonIndexDataset could avoid loading images.

Reviewed By: shapovalov

Differential Revision: D37313423

fbshipit-source-id: 3e5e0b2aabbf9cc51f10547a3523e98c72ad8755
2022-07-06 07:13:41 -07:00
Jeremy Reizenstein
771cf8a328 more padding options in Dataloader
Summary: Add facilities for dataloading non-sequential scenes.

Reviewed By: shapovalov

Differential Revision: D37291277

fbshipit-source-id: 0a33e3727b44c4f0cba3a2abe9b12f40d2a20447
2022-07-06 07:13:41 -07:00
David Novotny
0dce883241 Refactor autodecoders
Summary: Refactors autodecoders. Tests pass.

Reviewed By: bottler

Differential Revision: D37592429

fbshipit-source-id: 8f5c9eac254e1fdf0704d5ec5f69eb42f6225113
2022-07-04 07:18:03 -07:00
Krzysztof Chalupka
ae35824f21 Refactor ViewMetrics
Summary:
Make ViewMetrics easy to replace by putting them into an OmegaConf dataclass.

Also, re-word a few variable names and fix minor TODOs.

Reviewed By: bottler

Differential Revision: D37327157

fbshipit-source-id: 78d8e39bbb3548b952f10abbe05688409fb987cc
2022-06-30 09:22:01 -07:00
Brian Hirsh
f4dd151037 fix internal index.Tensor test on wrong device
Summary: After landing https://github.com/pytorch/pytorch/pull/69607, that made it an error to use indexing with `cpu_tensor[cuda_indices]`. There was one outstanding test in fbcode that incorrectly used indexing in that way, which is fixed here

Reviewed By: bottler, osalpekar

Differential Revision: D37128838

fbshipit-source-id: 611b6f717b5b5d89fa61fd9ebeb513ad7e65a656
2022-06-29 09:30:37 -07:00
Roman Shapovalov
7ce8ed55e1 Fix: typo in dict processing
Summary:
David had his code crashed when using frame_annot["meta"] dictionary. Turns out we had a typo.
The tests were passing by chance since all the keys were single-character strings.

Reviewed By: bottler

Differential Revision: D37503987

fbshipit-source-id: c12b0df21116cfbbc4675a0182b9b9e6d62bad2e
2022-06-28 16:11:49 -07:00
Tristan Rice
7e0146ece4 shader: add SoftDepthShader and HardDepthShader for rendering depth maps (#36)
Summary:
X-link: https://github.com/fairinternal/pytorch3d/pull/36

This adds two shaders for rendering depth maps for meshes. This is useful for structure from motion applications that learn depths based off of camera pair disparities.

There's two shaders, one hard which just returns the distances and then a second that does a cumsum on the probabilities of the points with a weighted sum. Areas that don't have any z faces are set to the zfar distance.

Output from this renderer is `[N, H, W]` since it's just depth no need for channels.

I haven't tested this in an ML model yet just in a notebook.

hard:
![hardzshader](https://user-images.githubusercontent.com/909104/170190363-ef662c97-0bd2-488c-8675-0557a3c7dd06.png)

soft:
![softzshader](https://user-images.githubusercontent.com/909104/170190365-65b08cd7-0c49-4119-803e-d33c1d8c676e.png)

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1208

Reviewed By: bottler

Differential Revision: D36682194

Pulled By: d4l3k

fbshipit-source-id: 5d4e10c6fb0fff5427be4ddd3bd76305a7ccc1e2
2022-06-26 04:01:29 -07:00
Ignacio Rocco
0e4c53c612 Fix link in generic_model.py (#38)
Summary: Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/38

Reviewed By: ignacio-rocco

Differential Revision: D37415027

Pulled By: bottler

fbshipit-source-id: 9b17049e4762506cd5c152fd6e244d5f0d97855b
2022-06-24 06:41:06 -07:00
Jeremy Reizenstein
879495d38f omegaconf 2.2.2 compatibility
Summary: OmegaConf 2.2.2 doesn't like heterogenous tuples or Sequence or Set members. Workaround this.

Reviewed By: shapovalov

Differential Revision: D37278736

fbshipit-source-id: 123e6657947f5b27514910e4074c92086a457a2a
2022-06-24 04:18:01 -07:00
Jeremy Reizenstein
5c1ca757bb srn/idr followups
Summary: small followup to D37172537 (cba26506b6) and D37209012 (81d63c6382): changing default #harmonics and improving a test

Reviewed By: shapovalov

Differential Revision: D37412357

fbshipit-source-id: 1af1005a129425fd24fa6dd213d69c71632099a0
2022-06-24 04:07:15 -07:00
Jeremy Reizenstein
3e4fb0b9d9 provide fg_probability for blender data
Summary: The blender synthetic dataset contains object masks in the alpha channel. Provide these in the corresponding dataset.

Reviewed By: shapovalov

Differential Revision: D37344380

fbshipit-source-id: 3ddacad9d667c0fa0ae5a61fb1d2ffc806c9abf3
2022-06-22 06:11:50 -07:00
Jeremy Reizenstein
731ea53c80 Llff & blender convention fix
Summary: Images were coming out in the wrong format.

Reviewed By: shapovalov

Differential Revision: D37291278

fbshipit-source-id: c10871c37dd186982e7abf2071ac66ed583df2e6
2022-06-22 05:54:54 -07:00
Jeremy Reizenstein
2e42ef793f register ImplicitronDataSource
Summary: Just register ImplicitronDataSource. We don't use it as pluggable yet here.

Reviewed By: shapovalov

Differential Revision: D37315698

fbshipit-source-id: ac41153383f9ab6b14ac69a3dfdc44aca0d94995
2022-06-22 04:24:14 -07:00
Jeremy Reizenstein
81d63c6382 idr harmonic_fns and doc
Summary: Document the inputs of idr functions and distinguish n_harmonic_functions to be 0 (simple embedding) versus -1 (no embedding).

Reviewed By: davnov134

Differential Revision: D37209012

fbshipit-source-id: 6e5c3eae54c4e5e8c3f76cad1caf162c6c222d52
2022-06-20 13:48:34 -07:00
Jeremy Reizenstein
28c1afaa9d nesting n_known_frames_for_test
Summary: Use generator.permutation instead of choice so that different options for n_known_frames_for_test are nested.

Reviewed By: davnov134

Differential Revision: D37210906

fbshipit-source-id: fd0d34ce62260417c3f63354a3f750aae9998b0d
2022-06-20 13:47:47 -07:00
Jeremy Reizenstein
cba26506b6 bg_color for lstm renderer
Summary: Allow specifying a color for non-opaque pixels in LSTMRenderer.

Reviewed By: davnov134

Differential Revision: D37172537

fbshipit-source-id: 6039726678bb7947f7d8cd04035b5023b2d5398c
2022-06-20 13:46:35 -07:00
Jeremy Reizenstein
65f667fd2e loading llff and blender datasets
Summary: Copy code from NeRF for loading LLFF data and blender synthetic data, and create dataset objects for them

Reviewed By: shapovalov

Differential Revision: D35581039

fbshipit-source-id: af7a6f3e9a42499700693381b5b147c991f57e5d
2022-06-16 03:09:15 -07:00
Pyre Bot Jr
7978ffd1e4 suppress errors in vision/fair/pytorch3d
Differential Revision: D37172764

fbshipit-source-id: a2ec367e56de2781a17f5e708eb5832ec9d7e6b4
2022-06-15 06:27:35 -07:00
John Reese
ea4f3260e4 apply new formatting config
Summary:
pyfmt now specifies a target Python version of 3.8 when formatting
with black. With this new config, black adds trailing commas to all
multiline function calls. This applies the new formatting as part
of rolling out the linttool-integration for pyfmt.

paintitblack

Reviewed By: zertosh, lisroach

Differential Revision: D37084377

fbshipit-source-id: 781a1b883a381a172e54d6e447137657977876b4
2022-06-10 16:04:56 -07:00
Jeremy Reizenstein
023a2369ae test configs are loadable
Summary: Add test that the yaml files deserialize.

Reviewed By: davnov134

Differential Revision: D36830673

fbshipit-source-id: b785d8db97b676686036760bfa2dd3fa638bda57
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
c0f88e04a0 make ExperimentConfig Configurable
Summary: Preparing for pluggables in experiment.py

Reviewed By: davnov134

Differential Revision: D36830674

fbshipit-source-id: eab499d1bc19c690798fbf7da547544df7e88fa5
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
6275283202 pluggable JsonIndexDataset
Summary: Make dataset type and args configurable on JsonIndexDatasetMapProvider.

Reviewed By: davnov134

Differential Revision: D36666705

fbshipit-source-id: 4d0a3781d9a956504f51f1c7134c04edf1eb2846
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
1d43251391 PathManagerFactory
Summary: Allow access to manifold internally by default.

Reviewed By: davnov134

Differential Revision: D36760481

fbshipit-source-id: 2a16bd40e81ef526085ac1b3f4606b63c1841428
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
1fb268dea6 allow get_default_args(JsonIndexDataset)
Summary: Changes to JsonIndexDataset to make it fit with OmegaConf.structured. Also match some default values to what the provider defaults to.

Reviewed By: davnov134

Differential Revision: D36666704

fbshipit-source-id: 65b059a1dbaa240ce85c3e8762b7c3db3b5a6e75
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
8bc0a04e86 hooks and allow registering base class
Summary: Allow a class to modify its subparts in get_default_args by defining the special function provide_config_hook.

Reviewed By: davnov134

Differential Revision: D36671081

fbshipit-source-id: 3e5b73880cb846c494a209c4479835f6352f45cf
2022-06-10 12:22:46 -07:00
Jeremy Reizenstein
5cd70067e2 Fix tests for OSS
Summary: New paths.

Reviewed By: patricklabatut

Differential Revision: D36734929

fbshipit-source-id: c0ce7ee9145ddca07ef3758d31cc3c261b088e7d
2022-06-01 13:52:26 -07:00
Krzysztof Chalupka
5b74a2cc27 Remove use of torch.tile to fix CI
Summary: Our tests fail (https://fburl.com/jmoqo9bz) because test_splatter_blend uses torch.tile, which is not supported in earlier torch versions. Replace it with tensor.extend.

Reviewed By: bottler

Differential Revision: D36796098

fbshipit-source-id: 38d5b40667f98f3163b33f44e53e96b858cfeba2
2022-06-01 08:47:26 -07:00
Roman Shapovalov
49ed7b07b1 Adapting configs.
Summary: As subj.

Reviewed By: bottler

Differential Revision: D36705775

fbshipit-source-id: 7370710e863025dc07a140b41f77a7c752e3159f
2022-05-27 02:31:47 -07:00
Jeremy Reizenstein
c6519f29f0 chamfer for empty pointclouds #1174
Summary: Fix divide by zero for empty pointcloud in chamfer. Also for empty batches. In process, needed to regularize num_points_per_cloud for empty batches.

Reviewed By: kjchalup

Differential Revision: D36311330

fbshipit-source-id: 3378ab738bee77ecc286f2110a5c8dc445960340
2022-05-26 14:56:22 -07:00
Krzysztof Chalupka
a42a89a5ba SplatterBlender follow-ups
Summary: A few minor additions I didn't fit into the SplatterBlender diffs, as requested by reviewers.

Reviewed By: jcjohnson

Differential Revision: D36682437

fbshipit-source-id: 57af995e766dfd2674b3984a3ba00aef7ca7db80
2022-05-26 13:03:57 -07:00
Jeremy Reizenstein
c31bf85a23 test runner for experiment.py
Summary: Add simple interactive testrunner for experiment.py

Reviewed By: shapovalov

Differential Revision: D35316221

fbshipit-source-id: d424bcba632eef89eefb56e18e536edb58ec6f85
2022-05-26 05:33:03 -07:00
Jeremy Reizenstein
fbd3c679ac rename ImplicitronDataset to JsonIndexDataset
Summary: The ImplicitronDataset class corresponds to JsonIndexDatasetMapProvider

Reviewed By: shapovalov

Differential Revision: D36661396

fbshipit-source-id: 80ca2ff81ef9ecc2e3d1f4e1cd14b6f66a7ec34d
2022-05-25 10:16:59 -07:00
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
f625fe1f8b further test fix
Summary: test_viewpool was inactive so missed being fixed in D36547815 (2d1c6d5d93)

Reviewed By: kjchalup

Differential Revision: D36625587

fbshipit-source-id: e7224eadfa5581fe61f10f67d2221071783de04a
2022-05-25 04:22:38 -07:00
Krzysztof Chalupka
7c25d34d22 SplatterPhongShader Benchmarks
Summary:
Benchmarking. We only use num_faces=2 for splatter, because as far as I can see one would never need to use more. Pose optimization and mesh optimization experiments (see next two diffs) showed that Splatter with 2 faces beats Softmax with 50 and 100 faces in terms of accuracy.

Results: We're slower at 64px^2. At 128px and 256px, we're slower than Softmax+50faces, but faster than Softmax+100faces. We're also slower at 10 faces/pix, but expectation as well as results show that more then 2 faces shouldn't be necessary. See also more results in .https://fburl.com/gdoc/ttv7u7hp

Reviewed By: jcjohnson

Differential Revision: D36210575

fbshipit-source-id: c8de28c8a59ce5fe21a47263bd43d2757b15d123
2022-05-24 22:31:12 -07:00
Krzysztof Chalupka
c5a83f46ef SplatterBlender
Summary: Splatting shader. See code comments for details. Same API as SoftPhongShader.

Reviewed By: jcjohnson

Differential Revision: D36354301

fbshipit-source-id: 71ee37f7ff6bb9ce028ba42a65741424a427a92d
2022-05-24 21:04:11 -07:00
Jeremy Reizenstein
1702c85bec avoid warning in ndc_grid_sample
Summary: If you miss grid_sample in recent pytorch, it gives a warning, so stop doing this.

Reviewed By: kjchalup

Differential Revision: D36410619

fbshipit-source-id: 41dd4455298645c926f4d96c2084093b3f64ee2c
2022-05-24 18:18:21 -07:00
Jeremy Reizenstein
90d00f1b2b PLY heterogenous faces fix
Summary: PLY with mixture of triangle and quadrilateral faces was failing.

Reviewed By: gkioxari

Differential Revision: D36592981

fbshipit-source-id: 5373edb2f38389ac646a75fd2e1fa7300eb8d054
2022-05-24 01:40:22 -07:00
Jeremy Reizenstein
d27ef14ec7 test_forward_pass: speedup and RE fix
Summary: Use small image size for test_all_gm_configs

Reviewed By: shapovalov

Differential Revision: D36511528

fbshipit-source-id: 2c65f518a4f23626850343a62d103f85abfabd88
2022-05-22 15:23:17 -07:00
Jeremy Reizenstein
2d1c6d5d93 simplify image_feature_extractor control
Summary: If no view pooling, don't disable image_feature_extractor. Make image_feature_extractor default to absent.

Reviewed By: davnov134

Differential Revision: D36547815

fbshipit-source-id: e51718e1bcbf65b8b365a6e894d4324f136635e9
2022-05-20 08:32:19 -07:00
Jeremy Reizenstein
9fe15da3cd ImplicitronDatasetBase -> DatasetBase
Summary: Just a rename

Reviewed By: shapovalov

Differential Revision: D36516885

fbshipit-source-id: 2126e3aee26d89a95afdb31e06942d61cbe88d5a
2022-05-20 07:50:30 -07:00
Jeremy Reizenstein
0f12c51646 data_loader_map_provider
Summary: replace dataloader_zoo with a pluggable DataLoaderMapProvider.

Reviewed By: shapovalov

Differential Revision: D36475441

fbshipit-source-id: d16abb190d876940434329928f2e3f2794a25416
2022-05-20 07:50:30 -07:00
Jeremy Reizenstein
79c61a2d86 dataset_map_provider
Summary: replace dataset_zoo with a pluggable DatasetMapProvider. The logic is now in annotated_file_dataset_map_provider.

Reviewed By: shapovalov

Differential Revision: D36443965

fbshipit-source-id: 9087649802810055e150b2fbfcc3c197a761f28a
2022-05-20 07:50:30 -07:00
Jeremy Reizenstein
69c6d06ed8 New file for ImplicitronDatasetBase
Summary: Separate ImplicitronDatasetBase and FrameData (to be used by all data sources) from ImplicitronDataset (which is specific).

Reviewed By: shapovalov

Differential Revision: D36413111

fbshipit-source-id: 3725744cde2e08baa11aff4048237ba10c7efbc6
2022-05-20 07:50:30 -07:00
Jeremy Reizenstein
73dc109dba data_source
Summary:
Move dataset_args and dataloader_args from ExperimentConfig into a new member called datasource so that it can contain replaceables.

Also add enum Task for task type.

Reviewed By: shapovalov

Differential Revision: D36201719

fbshipit-source-id: 47d6967bfea3b7b146b6bbd1572e0457c9365871
2022-05-20 07:50:30 -07:00
Jeremy Reizenstein
9ec9d057cc Make feature extractor pluggable
Summary: Make ResNetFeatureExtractor be an implementation of FeatureExtractorBase.

Reviewed By: davnov134

Differential Revision: D35433098

fbshipit-source-id: 0664a9166a88e150231cfe2eceba017ae55aed3a
2022-05-18 08:50:18 -07:00
Jeremy Reizenstein
cd7b885169 don't check black version
Summary: skip checking the version of black because `black --version` looks different in different versions.

Reviewed By: kjchalup

Differential Revision: D36441262

fbshipit-source-id: a2d9a5cad4f5433909fb85bc9a584e91a2b72601
2022-05-17 09:08:06 -07:00
Jeremy Reizenstein
f632c423ef FrameAnnotation.meta, Optional in _dataclass_from_dict
Summary: Allow extra data in a FrameAnnotation. Therefore allow Optional[T] systematically in _dataclass_from_dict

Reviewed By: davnov134

Differential Revision: D36442691

fbshipit-source-id: ba70f6491574c08b0d9c9acb63f35514d29de214
2022-05-17 08:16:29 -07:00
Jeremy Reizenstein
f36b11fe49 allow Optional[Dict]=None in config
Summary: Fix recently observed case where enable_get_default_args was missing things declared as Optional[something mutable]=None.

Reviewed By: davnov134

Differential Revision: D36440492

fbshipit-source-id: 192ec07564c325b3b24ccc49b003788f67c63a3d
2022-05-17 05:06:18 -07:00
Krzysztof Chalupka
ea5df60d72 In blending, pull common functionality into get_background_color
Summary: A small refactor, originally intended for use with the splatter.

Reviewed By: bottler

Differential Revision: D36210393

fbshipit-source-id: b3372f7cc7690ee45dd3059b2d4be1c8dfa63180
2022-05-16 18:23:51 -07:00
Krzysztof Chalupka
4372001981 Make transform_points_screen's with_xyflip configurable
Summary: We'll need non-flipped screen coords in splatter.

Reviewed By: bottler

Differential Revision: D36337027

fbshipit-source-id: 897f88e8854bab215d2d0e502b25d15526ee86f1
2022-05-16 18:23:51 -07:00
Krzysztof Chalupka
61e2b87019 Add ability for phong_shading to return pixel_coords
Summary: The splatter can re-use pixel coords computed by the shader.

Reviewed By: bottler

Differential Revision: D36332530

fbshipit-source-id: b28e7abe22cca4f48b4108ad397aafc0f1347901
2022-05-16 18:23:51 -07:00
Roman Shapovalov
0143d63ba8 Correcting recent bugs code after debugging on devfair.
Summary:
1. Typo in the dataset path in the config.
2. Typo in num_frames.
3. Pick sequence was cached before it was modified for single-sequence.

Reviewed By: bottler

Differential Revision: D36417329

fbshipit-source-id: 6dcd75583de510412e1ae58f63db04bb4447403e
2022-05-16 12:17:08 -07:00
Jeremy Reizenstein
899a3192b6 create_x_impl
Summary: Make create_x delegate to create_x_impl so that users can rely on create_x_impl in their overrides of create_x.

Reviewed By: shapovalov, davnov134

Differential Revision: D35929810

fbshipit-source-id: 80595894ee93346b881729995775876b016fc08e
2022-05-16 04:42:03 -07:00
John Reese
3b2300641a apply import merging for fbcode (11 of 11)
Summary:
Applies new import merging and sorting from µsort v1.0.

When merging imports, µsort will make a best-effort to move associated
comments to match merged elements, but there are known limitations due to
the diynamic nature of Python and developer tooling. These changes should
not produce any dangerous runtime changes, but may require touch-ups to
satisfy linters and other tooling.

Note that µsort uses case-insensitive, lexicographical sorting, which
results in a different ordering compared to isort. This provides a more
consistent sorting order, matching the case-insensitive order used when
sorting import statements by module name, and ensures that "frog", "FROG",
and "Frog" always sort next to each other.

For details on µsort's sorting and merging semantics, see the user guide:
https://usort.readthedocs.io/en/stable/guide.html#sorting

Reviewed By: lisroach

Differential Revision: D36402260

fbshipit-source-id: 7cb52f09b740ccc580e61e6d1787d27381a8ce00
2022-05-15 12:53:03 -07:00
Jeremy Reizenstein
b5f3d3ce12 fix test_config_use
Summary: Fixes to reenable test_create_gm_overrides. Followup from D35852367 (47d06c8924) using logic from D36349361 (9e57b994ca).

Reviewed By: shapovalov

Differential Revision: D36371762

fbshipit-source-id: ad5fbbb4b5729fac41980d118f17a2589f7e6aba
2022-05-13 07:15:26 -07:00
Jeremy Reizenstein
2c1901522a return types for dataset_zoo, dataloader_zoo
Summary: Stronger typing for these functions

Reviewed By: shapovalov

Differential Revision: D36170489

fbshipit-source-id: a2104b29dbbbcfcf91ae1d076cd6b0e3d2030c0b
2022-05-13 05:38:14 -07:00
Jeremy Reizenstein
90ab219d88 clarify expand_args_fields
Summary: Fix doc and add a call to expand_args_fields for each implicit function.

Reviewed By: shapovalov

Differential Revision: D35929811

fbshipit-source-id: 8c3cfa56b8d8908fd2165614960e3d34b54717bb
2022-05-13 03:26:47 -07:00
Jeremy Reizenstein
9e57b994ca resnet34 weights for remote executor
Summary: Like vgg16 for lpips, internally we need resnet34 weights for coming feature extractor tests.

Reviewed By: davnov134

Differential Revision: D36349361

fbshipit-source-id: 1c33009c904766fcc15e7e31cd15d0f820c57354
2022-05-12 16:57:16 -07:00
David Novotny
e767c4b548 Raysampler as pluggable
Summary:
This converts raysamplers to ReplaceableBase so that users can hack their own raysampling impls.

Context: Andrea tried to implement TensoRF within implicitron but could not due to the need to implement his own raysampler.

Reviewed By: shapovalov

Differential Revision: D36016318

fbshipit-source-id: ef746f3365282bdfa9c15f7b371090a5aae7f8da
2022-05-12 15:39:35 -07:00
David Novotny
e85fa03c5a Generic Raymarcher refactor
Summary: Uses the GenericRaymarcher only as an ABC and derives two common implementations - EA raymarcher and Cumsum raymarcher (from neural volumes)

Reviewed By: shapovalov

Differential Revision: D35927653

fbshipit-source-id: f7e6776e71f8a4e99eefc018a47f29ae769895ee
2022-05-12 14:57:50 -07:00
David Novotny
47d06c8924 ViewPooler class
Summary: Implements a ViewPooler that groups ViewSampler and FeatureAggregator.

Reviewed By: shapovalov

Differential Revision: D35852367

fbshipit-source-id: c1bcaf5a1f826ff94efce53aa5836121ad9c50ec
2022-05-12 12:50:03 -07:00
John Reese
bef959c755 formatting changes from black 22.3.0
Summary:
Applies the black-fbsource codemod with the new build of pyfmt.

paintitblack

Reviewed By: lisroach

Differential Revision: D36324783

fbshipit-source-id: 280c09e88257e5e569ab729691165d8dedd767bc
2022-05-11 19:55:56 -07:00
Krzysztof Chalupka
c21ba144e7 Add Fragments.detach()
Summary: Add a capability to detach all detachable tensors in Fragments.

Reviewed By: bottler

Differential Revision: D35918133

fbshipit-source-id: 03b5d4491a3a6791b0a7bc9119f26c1a7aa43196
2022-05-11 18:50:24 -07:00
Christian Kauten
d737a05e55 Update INSTALL.md (#1194)
Summary:
Resolve https://github.com/facebookresearch/pytorch3d/issues/1186 by fixing the minimal version of CUDA for installing from a wheel

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1194

Reviewed By: patricklabatut

Differential Revision: D36279396

Pulled By: bottler

fbshipit-source-id: 2371256a5451ec33c01d6fa9616c5b24fa83f7f8
2022-05-11 07:03:12 -07:00
David Novotny
2374d19da5 Test all CO3D model configs in test_forward_pass
Summary: Tests all possible model configs in test_forward_pass.py

Reviewed By: shapovalov

Differential Revision: D35851507

fbshipit-source-id: 4860ee1d37cf17a2faab5fc14d4b2ba0b96c4b8b
2022-05-11 05:40:05 -07:00
Pyre Bot Jr
1f3953795c suppress errors in vision/fair/pytorch3d
Differential Revision: D36269817

fbshipit-source-id: 47b8a77747e8297af3731fd0a388d4c5432dc1ff
2022-05-09 19:10:01 -07:00
Roman Shapovalov
a6dada399d Extracted ImplicitronModelBase and unified API for GenericModel and ModelDBIR
Summary:
To avoid model_zoo, we need to make GenericModel pluggable.
I also align creation APIs for convenience.

Reviewed By: bottler, davnov134

Differential Revision: D35933093

fbshipit-source-id: 8228926528eb41a795fbfbe32304b8019197e2b1
2022-05-09 15:23:07 -07:00
David Novotny
5c59841863 Add **kwargs to ViewMetrics.forward
Summary: GenericModel crashes in case the `aux` field of any Renderer is populated. This is because the `rendered.aux` is unpacked to  ViewMetrics.forward whose signature does not contain **kwargs. Hence, the contents of `aux` are unknown to forward's signature resulting in a crash.

Reviewed By: bottler

Differential Revision: D36166118

fbshipit-source-id: 906a067ea02a3648a69667422466451bc219ebf6
2022-05-09 03:04:34 -07:00
Krzysztof Chalupka
2c64635daa Add type hints to MeshRenderer(WithFragments)
Reviewed By: bottler

Differential Revision: D36148049

fbshipit-source-id: 87ca3ea8d5b5a315418cc597b36fd0a1dffb1e00
2022-05-06 14:48:26 -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
44cb00e468 lstsq fix in circle fitting for old PyTorch
Summary: the pytorch3d.compat.lstsq function needs a 2D rhs.

Reviewed By: patricklabatut

Differential Revision: D36195826

fbshipit-source-id: 9dbafea2057035cc04973f56729dc97b47dcac83
2022-05-06 04:12:51 -07:00
Jeremy Reizenstein
44ca5f95d9 Add vis to readthedocs
Summary: pytorch3d/vis has been missing. Reduce prominence of common.

Reviewed By: patricklabatut

Differential Revision: D36008733

fbshipit-source-id: bbc9fbb031c8dc95870087fa48df29410ae69e35
2022-05-06 04:07:43 -07:00
Pyre Bot Jr
a51a300827 suppress errors in fbcode/vision - batch 2
Differential Revision: D36120486

fbshipit-source-id: bddbf47957f4476f826ad20c2d6e146c98ee73e1
2022-05-03 20:29:21 -07:00
588 changed files with 29601 additions and 6954 deletions

View File

@@ -81,7 +81,7 @@ jobs:
command: |
export LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64
python3 setup.py build_ext --inplace
- run: LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64 python -m unittest discover -v -s tests
- run: LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64 python -m unittest discover -v -s tests -t .
- run: python3 setup.py bdist_wheel
binary_linux_wheel:
@@ -117,7 +117,7 @@ jobs:
- run:
name: build
no_output_timeout: 20m
command: MAX_JOBS=15 TEST_FLAG=--no-test packaging/build_conda.sh
command: MAX_JOBS=15 TEST_FLAG=--no-test python3 packaging/build_conda.py
- store_artifacts:
path: /opt/conda/conda-bld/linux-64
- persist_to_workspace:
@@ -154,12 +154,12 @@ jobs:
export JUST_TESTRUN=1
VARS_TO_PASS="-e PYTHON_VERSION -e BUILD_VERSION -e PYTORCH_VERSION -e CU_VERSION -e JUST_TESTRUN"
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${TESTRUN_DOCKER_IMAGE} ./packaging/build_conda.sh
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${TESTRUN_DOCKER_IMAGE} python3 ./packaging/build_conda.py
binary_macos_wheel:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "13.4.1"
steps:
- checkout
- run:
@@ -182,23 +182,23 @@ workflows:
# context: DOCKERHUB_TOKEN
{{workflows()}}
- binary_linux_conda_cuda:
name: testrun_conda_cuda_py37_cu102_pyt170
name: testrun_conda_cuda_py38_cu102_pyt190
context: DOCKERHUB_TOKEN
python_version: "3.7"
pytorch_version: '1.7.0'
python_version: "3.8"
pytorch_version: '1.9.0'
cu_version: "cu102"
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py37_cpu
python_version: '3.7'
pytorch_version: '1.9.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py38_cpu
name: macos_wheel_py3.8_cpu
python_version: '3.8'
pytorch_version: '1.9.0'
pytorch_version: '1.13.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py39_cpu
name: macos_wheel_py3.9_cpu
python_version: '3.9'
pytorch_version: '1.9.0'
pytorch_version: '1.13.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py3.10_cpu
python_version: '3.10'
pytorch_version: '1.13.0'

View File

@@ -81,7 +81,7 @@ jobs:
command: |
export LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64
python3 setup.py build_ext --inplace
- run: LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64 python -m unittest discover -v -s tests
- run: LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda-11.3/lib64 python -m unittest discover -v -s tests -t .
- run: python3 setup.py bdist_wheel
binary_linux_wheel:
@@ -117,7 +117,7 @@ jobs:
- run:
name: build
no_output_timeout: 20m
command: MAX_JOBS=15 TEST_FLAG=--no-test packaging/build_conda.sh
command: MAX_JOBS=15 TEST_FLAG=--no-test python3 packaging/build_conda.py
- store_artifacts:
path: /opt/conda/conda-bld/linux-64
- persist_to_workspace:
@@ -154,12 +154,12 @@ jobs:
export JUST_TESTRUN=1
VARS_TO_PASS="-e PYTHON_VERSION -e BUILD_VERSION -e PYTORCH_VERSION -e CU_VERSION -e JUST_TESTRUN"
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${TESTRUN_DOCKER_IMAGE} ./packaging/build_conda.sh
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${TESTRUN_DOCKER_IMAGE} python3 ./packaging/build_conda.py
binary_macos_wheel:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "13.4.1"
steps:
- checkout
- run:
@@ -180,257 +180,6 @@ workflows:
jobs:
# - main:
# context: DOCKERHUB_TOKEN
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py37_cu101_pyt170
python_version: '3.7'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt170
python_version: '3.7'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu110
name: linux_conda_py37_cu110_pyt170
python_version: '3.7'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py37_cu101_pyt171
python_version: '3.7'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt171
python_version: '3.7'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu110
name: linux_conda_py37_cu110_pyt171
python_version: '3.7'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py37_cu101_pyt180
python_version: '3.7'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt180
python_version: '3.7'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt180
python_version: '3.7'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py37_cu101_pyt181
python_version: '3.7'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt181
python_version: '3.7'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt181
python_version: '3.7'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt190
python_version: '3.7'
pytorch_version: 1.9.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt190
python_version: '3.7'
pytorch_version: 1.9.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt191
python_version: '3.7'
pytorch_version: 1.9.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt191
python_version: '3.7'
pytorch_version: 1.9.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt1100
python_version: '3.7'
pytorch_version: 1.10.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt1100
python_version: '3.7'
pytorch_version: 1.10.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py37_cu113_pyt1100
python_version: '3.7'
pytorch_version: 1.10.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt1101
python_version: '3.7'
pytorch_version: 1.10.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt1101
python_version: '3.7'
pytorch_version: 1.10.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py37_cu113_pyt1101
python_version: '3.7'
pytorch_version: 1.10.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt1102
python_version: '3.7'
pytorch_version: 1.10.2
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt1102
python_version: '3.7'
pytorch_version: 1.10.2
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py37_cu113_pyt1102
python_version: '3.7'
pytorch_version: 1.10.2
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py37_cu102_pyt1110
python_version: '3.7'
pytorch_version: 1.11.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py37_cu111_pyt1110
python_version: '3.7'
pytorch_version: 1.11.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py37_cu113_pyt1110
python_version: '3.7'
pytorch_version: 1.11.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda115
context: DOCKERHUB_TOKEN
cu_version: cu115
name: linux_conda_py37_cu115_pyt1110
python_version: '3.7'
pytorch_version: 1.11.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py38_cu101_pyt170
python_version: '3.8'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py38_cu102_pyt170
python_version: '3.8'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu110
name: linux_conda_py38_cu110_pyt170
python_version: '3.8'
pytorch_version: 1.7.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py38_cu101_pyt171
python_version: '3.8'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py38_cu102_pyt171
python_version: '3.8'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu110
name: linux_conda_py38_cu110_pyt171
python_version: '3.8'
pytorch_version: 1.7.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py38_cu101_pyt180
python_version: '3.8'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py38_cu102_pyt180
python_version: '3.8'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py38_cu111_pyt180
python_version: '3.8'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py38_cu101_pyt181
python_version: '3.8'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py38_cu102_pyt181
python_version: '3.8'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py38_cu111_pyt181
python_version: '3.8'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
@@ -540,58 +289,58 @@ workflows:
pytorch_version: 1.11.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py39_cu101_pyt171
python_version: '3.9'
pytorch_version: 1.7.1
cu_version: cu102
name: linux_conda_py38_cu102_pyt1120
python_version: '3.8'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py38_cu113_pyt1120
python_version: '3.8'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py38_cu116_pyt1120
python_version: '3.8'
pytorch_version: 1.12.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py39_cu102_pyt171
python_version: '3.9'
pytorch_version: 1.7.1
name: linux_conda_py38_cu102_pyt1121
python_version: '3.8'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu110
name: linux_conda_py39_cu110_pyt171
python_version: '3.9'
pytorch_version: 1.7.1
cu_version: cu113
name: linux_conda_py38_cu113_pyt1121
python_version: '3.8'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py39_cu101_pyt180
python_version: '3.9'
pytorch_version: 1.8.0
cu_version: cu116
name: linux_conda_py38_cu116_pyt1121
python_version: '3.8'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py39_cu102_pyt180
python_version: '3.9'
pytorch_version: 1.8.0
cu_version: cu116
name: linux_conda_py38_cu116_pyt1130
python_version: '3.8'
pytorch_version: 1.13.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda117
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py39_cu111_pyt180
python_version: '3.9'
pytorch_version: 1.8.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu101
name: linux_conda_py39_cu101_pyt181
python_version: '3.9'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py39_cu102_pyt181
python_version: '3.9'
pytorch_version: 1.8.1
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu111
name: linux_conda_py39_cu111_pyt181
python_version: '3.9'
pytorch_version: 1.8.1
cu_version: cu117
name: linux_conda_py38_cu117_pyt1130
python_version: '3.8'
pytorch_version: 1.13.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
@@ -699,6 +448,60 @@ workflows:
name: linux_conda_py39_cu115_pyt1110
python_version: '3.9'
pytorch_version: 1.11.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py39_cu102_pyt1120
python_version: '3.9'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py39_cu113_pyt1120
python_version: '3.9'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py39_cu116_pyt1120
python_version: '3.9'
pytorch_version: 1.12.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py39_cu102_pyt1121
python_version: '3.9'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py39_cu113_pyt1121
python_version: '3.9'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py39_cu116_pyt1121
python_version: '3.9'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py39_cu116_pyt1130
python_version: '3.9'
pytorch_version: 1.13.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda117
context: DOCKERHUB_TOKEN
cu_version: cu117
name: linux_conda_py39_cu117_pyt1130
python_version: '3.9'
pytorch_version: 1.13.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
@@ -725,24 +528,78 @@ workflows:
name: linux_conda_py310_cu115_pyt1110
python_version: '3.10'
pytorch_version: 1.11.0
- binary_linux_conda_cuda:
name: testrun_conda_cuda_py37_cu102_pyt170
- binary_linux_conda:
context: DOCKERHUB_TOKEN
python_version: "3.7"
pytorch_version: '1.7.0'
cu_version: cu102
name: linux_conda_py310_cu102_pyt1120
python_version: '3.10'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py310_cu113_pyt1120
python_version: '3.10'
pytorch_version: 1.12.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py310_cu116_pyt1120
python_version: '3.10'
pytorch_version: 1.12.0
- binary_linux_conda:
context: DOCKERHUB_TOKEN
cu_version: cu102
name: linux_conda_py310_cu102_pyt1121
python_version: '3.10'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda113
context: DOCKERHUB_TOKEN
cu_version: cu113
name: linux_conda_py310_cu113_pyt1121
python_version: '3.10'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py310_cu116_pyt1121
python_version: '3.10'
pytorch_version: 1.12.1
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda116
context: DOCKERHUB_TOKEN
cu_version: cu116
name: linux_conda_py310_cu116_pyt1130
python_version: '3.10'
pytorch_version: 1.13.0
- binary_linux_conda:
conda_docker_image: pytorch/conda-builder:cuda117
context: DOCKERHUB_TOKEN
cu_version: cu117
name: linux_conda_py310_cu117_pyt1130
python_version: '3.10'
pytorch_version: 1.13.0
- binary_linux_conda_cuda:
name: testrun_conda_cuda_py38_cu102_pyt190
context: DOCKERHUB_TOKEN
python_version: "3.8"
pytorch_version: '1.9.0'
cu_version: "cu102"
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py37_cpu
python_version: '3.7'
pytorch_version: '1.9.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py38_cpu
name: macos_wheel_py3.8_cpu
python_version: '3.8'
pytorch_version: '1.9.0'
pytorch_version: '1.13.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py39_cpu
name: macos_wheel_py3.9_cpu
python_version: '3.9'
pytorch_version: '1.9.0'
pytorch_version: '1.13.0'
- binary_macos_wheel:
cu_version: cpu
name: macos_wheel_py3.10_cpu
python_version: '3.10'
pytorch_version: '1.13.0'

View File

@@ -20,25 +20,30 @@ from packaging import version
# version of pytorch.
# Pytorch 1.4 also supports cuda 10.0 but we no longer build for cuda 10.0 at all.
CONDA_CUDA_VERSIONS = {
"1.7.0": ["cu101", "cu102", "cu110"],
"1.7.1": ["cu101", "cu102", "cu110"],
"1.8.0": ["cu101", "cu102", "cu111"],
"1.8.1": ["cu101", "cu102", "cu111"],
"1.9.0": ["cu102", "cu111"],
"1.9.1": ["cu102", "cu111"],
"1.10.0": ["cu102", "cu111", "cu113"],
"1.10.1": ["cu102", "cu111", "cu113"],
"1.10.2": ["cu102", "cu111", "cu113"],
"1.11.0": ["cu102", "cu111", "cu113", "cu115"],
"1.12.0": ["cu102", "cu113", "cu116"],
"1.12.1": ["cu102", "cu113", "cu116"],
"1.13.0": ["cu116", "cu117"],
}
def conda_docker_image_for_cuda(cuda_version):
if cuda_version in ("cu101", "cu102", "cu111"):
return None
if cuda_version == "cu113":
return "pytorch/conda-builder:cuda113"
if cuda_version == "cu115":
return "pytorch/conda-builder:cuda115"
return None
if cuda_version == "cu116":
return "pytorch/conda-builder:cuda116"
if cuda_version == "cu117":
return "pytorch/conda-builder:cuda117"
raise ValueError("Unknown cuda version")
def pytorch_versions_for_python(python_version):
@@ -61,7 +66,7 @@ def pytorch_versions_for_python(python_version):
def workflows(prefix="", filter_branch=None, upload=False, indentation=6):
w = []
for btype in ["conda"]:
for python_version in ["3.7", "3.8", "3.9", "3.10"]:
for python_version in ["3.8", "3.9", "3.10"]:
for pytorch_version in pytorch_versions_for_python(python_version):
for cu_version in CONDA_CUDA_VERSIONS[pytorch_version]:
w += workflow_pair(

View File

@@ -16,14 +16,13 @@ We do not always accept new features, and we take the following factors into con
When sending a PR, please ensure you complete the following steps:
1. Fork the repo and create your branch from `master`. Follow the instructions
1. Fork the repo and create your branch from `main`. Follow the instructions
in [INSTALL.md](../INSTALL.md) to build the repo.
2. If you've added code that should be tested, add tests.
3. If you've changed any APIs, please update the documentation.
4. Ensure the test suite passes:
4. Ensure the test suite passes, by running this from the project root:
```
cd pytorch3d/tests
python -m unittest -v
python -m unittest discover -v -s tests -t .
```
5. Make sure your code lints by running `dev/linter.sh` from the project root.
6. If a PR contains multiple orthogonal changes, split it into multiple separate PRs.

BIN
.github/implicitron_config.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 MiB

View File

@@ -1,27 +0,0 @@
name: Mark stale issues and pull requests
on:
schedule:
- cron: '31 5 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-labels: 'enhancement,how-to'
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10

View File

@@ -8,8 +8,8 @@
The core library is written in PyTorch. Several components have underlying implementation in CUDA for improved performance. A subset of these components have CPU implementations in C++/PyTorch. It is advised to use PyTorch3D with GPU support in order to use all the features.
- Linux or macOS or Windows
- Python 3.6, 3.7, 3.8 or 3.9
- PyTorch 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2 or 1.11.0.
- Python 3.8, 3.9 or 3.10
- PyTorch 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1 or 1.13.0.
- torchvision that matches the PyTorch installation. You can install them together as explained at pytorch.org to make sure of this.
- gcc & g++ ≥ 4.9
- [fvcore](https://github.com/facebookresearch/fvcore)
@@ -21,11 +21,11 @@ The runtime dependencies can be installed by running:
```
conda create -n pytorch3d python=3.9
conda activate pytorch3d
conda install -c pytorch pytorch=1.9.1 torchvision cudatoolkit=10.2
conda install -c pytorch pytorch=1.9.1 torchvision cudatoolkit=11.6
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
```
For the CUB build time dependency, if you are using conda, you can continue with
For the CUB build time dependency, which you only need if you have CUDA older than 11.7, if you are using conda, you can continue with
```
conda install -c bottler nvidiacub
```
@@ -78,18 +78,18 @@ Or, to install a nightly (non-official, alpha) build:
conda install pytorch3d -c pytorch3d-nightly
```
### 2. Install from PyPI, on Mac only.
This works with pytorch 1.9.0 only. The build is CPU only.
This works with pytorch 1.13.0 only. The build is CPU only.
```
pip install pytorch3d
```
### 3. Install wheels for Linux
We have prebuilt wheels with CUDA for Linux for PyTorch 1.11.0, for each of the supported CUDA versions,
for Python 3.7, 3.8 and 3.9. This is for ease of use on Google Colab.
for Python 3.8 and 3.9. This is for ease of use on Google Colab.
These are installed in a special way.
For example, to install for Python 3.8, PyTorch 1.11.0 and CUDA 10.2
For example, to install for Python 3.8, PyTorch 1.11.0 and CUDA 11.3
```
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu102_pyt1110/download.html
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html
```
In general, from inside IPython, or in Google Colab or a jupyter notebook, you can install with
@@ -147,10 +147,10 @@ After any necessary patching, you can go to "x64 Native Tools Command Prompt for
cd pytorch3d
python3 setup.py install
```
After installing, verify whether all unit tests have passed
After installing, you can run **unit tests**
```
cd tests
python3 -m unittest discover -p *.py
python3 -m unittest discover -v -s tests -t .
```
# FAQ

View File

@@ -46,3 +46,26 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
NeRF https://github.com/bmild/nerf/
Copyright (c) 2020 bmild
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -12,6 +12,7 @@ Key features include:
- Data structure for storing and manipulating triangle meshes
- Efficient operations on triangle meshes (projective transformations, graph convolution, sampling, loss functions)
- A differentiable mesh renderer
- Implicitron, see [its README](projects/implicitron_trainer), a framework for new-view synthesis via implicit representations.
PyTorch3D is designed to integrate smoothly with deep learning methods for predicting and manipulating 3D data.
For this reason, all operators in PyTorch3D:
@@ -55,6 +56,11 @@ Get started with PyTorch3D by trying one of the tutorial notebooks.
|:------------------------------------------------------------:|:--------------------------------------------------:|
| [Fit Textured Volume](https://github.com/facebookresearch/pytorch3d/blob/main/docs/tutorials/fit_textured_volume.ipynb)| [Fit A Simple Neural Radiance Field](https://github.com/facebookresearch/pytorch3d/blob/main/docs/tutorials/fit_simple_neural_radiance_field.ipynb)|
| <img src="https://raw.githubusercontent.com/facebookresearch/pytorch3d/main/.github/fit_textured_volume.gif" width="310"/> | <img src="https://raw.githubusercontent.com/facebookresearch/pytorch3d/main/.github/implicitron_config.gif" width="310" height="310"/>
|:------------------------------------------------------------:|:--------------------------------------------------:|
| [Fit Textured Volume in Implicitron](https://github.com/facebookresearch/pytorch3d/blob/main/docs/tutorials/implicitron_volumes.ipynb)| [Implicitron Config System](https://github.com/facebookresearch/pytorch3d/blob/main/docs/tutorials/implicitron_config_system.ipynb)|
@@ -93,6 +99,8 @@ In alphabetical order:
* Amitav Baruah
* Steve Branson
* Krzysztof Chalupka
* Jiali Duan
* Luya Gao
* Georgia Gkioxari
* Taylor Gordon
@@ -136,6 +144,12 @@ If you are using the pulsar backend for sphere-rendering (the `PulsarPointRender
Please see below for a timeline of the codebase updates in reverse chronological order. We are sharing updates on the releases as well as research projects which are built with PyTorch3D. The changelogs for the releases are available under [`Releases`](https://github.com/facebookresearch/pytorch3d/releases), and the builds can be installed using `conda` as per the instructions in [INSTALL.md](INSTALL.md).
**[Oct 23rd 2022]:** PyTorch3D [v0.7.1](https://github.com/facebookresearch/pytorch3d/releases/tag/v0.7.1) released.
**[Aug 10th 2022]:** PyTorch3D [v0.7.0](https://github.com/facebookresearch/pytorch3d/releases/tag/v0.7.0) released with Implicitron and MeshRasterizerOpenGL.
**[Apr 28th 2022]:** PyTorch3D [v0.6.2](https://github.com/facebookresearch/pytorch3d/releases/tag/v0.6.2) released
**[Dec 16th 2021]:** PyTorch3D [v0.6.1](https://github.com/facebookresearch/pytorch3d/releases/tag/v0.6.1) released
**[Oct 6th 2021]:** PyTorch3D [v0.6.0](https://github.com/facebookresearch/pytorch3d/releases/tag/v0.6.0) released

View File

@@ -7,22 +7,10 @@
# Run this script at project root by "./dev/linter.sh" before you commit
{
V=$(black --version|cut '-d ' -f3)
code='import distutils.version; assert "19.3" < distutils.version.LooseVersion("'$V'")'
PYTHON=false
command -v python > /dev/null && PYTHON=python
command -v python3 > /dev/null && PYTHON=python3
${PYTHON} -c "${code}" 2> /dev/null
} || {
echo "Linter requires black 19.3b0 or higher!"
exit 1
}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIR=$(dirname "${DIR}")
if [[ -f "${DIR}/tests/TARGETS" ]]
if [[ -f "${DIR}/TARGETS" ]]
then
pyfmt "${DIR}"
else
@@ -42,7 +30,7 @@ clangformat=$(command -v clang-format-8 || echo clang-format)
find "${DIR}" -regex ".*\.\(cpp\|c\|cc\|cu\|cuh\|cxx\|h\|hh\|hpp\|hxx\|tcc\|mm\|m\)" -print0 | xargs -0 "${clangformat}" -i
# Run arc and pyre internally only.
if [[ -f "${DIR}/tests/TARGETS" ]]
if [[ -f "${DIR}/TARGETS" ]]
then
(cd "${DIR}"; command -v arc > /dev/null && arc lint) || true

View File

@@ -17,7 +17,8 @@ It has no dependencies.
def get_test_files() -> List[Path]:
root = Path(__file__).parent.parent
return list((root / "tests").glob("**/test*.py"))
dirs = ["tests", "projects/implicitron_trainer"]
return [i for dir in dirs for i in (root / dir).glob("**/test*.py")]
def tests_from_file(path: Path, base: str) -> List[str]:
@@ -51,7 +52,7 @@ def tests_from_file(path: Path, base: str) -> List[str]:
def main() -> None:
files = get_test_files()
test_root = Path(__file__).parent.parent / "tests"
test_root = Path(__file__).parent.parent
all_tests = []
for f in files:
file_base = str(f.relative_to(test_root))[:-3].replace("/", ".")

162
docs/generate_stubs.py Normal file
View File

@@ -0,0 +1,162 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
This script makes the stubs for implicitron in docs/modules.
"""
from pathlib import Path
ROOT_DIR = Path(__file__).resolve().parent.parent
def paths_to_modules(paths):
"""
Given an iterable of paths, return equivalent list of modules.
"""
return [
str(i.relative_to(ROOT_DIR))[:-3].replace("/", ".")
for i in paths
if "__pycache__" not in str(i)
]
def create_one_file(title, description, sources, dest_file):
with open(dest_file, "w") as f:
print(title, file=f)
print("=" * len(title), file=f)
print(file=f)
print(description, file=f)
for source in sources:
if source.find("._") != -1:
# ignore internal modules including __init__.py
continue
print(f"\n.. automodule:: {source}", file=f)
print(" :members:", file=f)
print(" :undoc-members:", file=f)
print(" :show-inheritance:", file=f)
def iterate_directory(directory_path, dest):
"""
Create a file for each module in the given path
"""
toc = []
if not dest.exists():
dest.mkdir()
for file in sorted(directory_path.glob("*.py")):
if file.stem.startswith("_"):
continue
module = paths_to_modules([file])
create_one_file(module[0], file.stem, module, dest / f"{file.stem}.rst")
toc.append(file.stem)
for subdir in directory_path.iterdir():
if not subdir.is_dir():
continue
if subdir.name == "fb":
continue
if subdir.name.startswith("_"):
continue
iterate_directory(subdir, dest / (subdir.name))
toc.append(f"{subdir.name}/index")
paths_to_modules_ = paths_to_modules([directory_path.with_suffix(".XX")])
if len(paths_to_modules_) == 0:
return
title = paths_to_modules_[0]
with open(dest / "index.rst", "w") as f:
print(title, file=f)
print("=" * len(title), file=f)
print("\n.. toctree::\n", file=f)
for item in toc:
print(f" {item}", file=f)
def make_directory_index(title: str, directory_path: Path):
index_file = directory_path / "index.rst"
directory_rsts = sorted(directory_path.glob("*.rst"))
subdirs = sorted([f for f in directory_path.iterdir() if f.is_dir()])
with open(index_file, "w") as f:
print(title, file=f)
print("=" * len(title), file=f)
print("\n.. toctree::\n", file=f)
for subdir in subdirs:
print(f" {subdir.stem}/index.rst", file=f)
for rst in directory_rsts:
if rst.stem == "index":
continue
print(f" {rst.stem}", file=f)
def do_implicitron():
DEST_DIR = Path(__file__).resolve().parent / "modules/implicitron"
iterate_directory(ROOT_DIR / "pytorch3d/implicitron/models", DEST_DIR / "models")
unwanted_tools = ["configurable", "depth_cleanup", "utils"]
tools_sources = sorted(ROOT_DIR.glob("pytorch3d/implicitron/tools/*.py"))
tools_modules = [
str(i.relative_to(ROOT_DIR))[:-3].replace("/", ".")
for i in tools_sources
if i.stem not in unwanted_tools
]
create_one_file(
"pytorch3d.implicitron.tools",
"Tools for implicitron",
tools_modules,
DEST_DIR / "tools.rst",
)
dataset_files = sorted(ROOT_DIR.glob("pytorch3d/implicitron/dataset/*.py"))
basic_dataset = [
"dataset_base",
"dataset_map_provider",
"data_loader_map_provider",
"data_source",
"scene_batch_sampler",
]
basic_dataset_modules = [
f"pytorch3d.implicitron.dataset.{i}" for i in basic_dataset
]
create_one_file(
"pytorch3d.implicitron.dataset in general",
"Basics of data for implicitron",
basic_dataset_modules,
DEST_DIR / "data_basics.rst",
)
specific_dataset_files = [
i for i in dataset_files if i.stem.find("_dataset_map_provider") != -1
]
create_one_file(
"pytorch3d.implicitron.dataset specific datasets",
"specific datasets",
paths_to_modules(specific_dataset_files),
DEST_DIR / "datasets.rst",
)
evaluation_files = sorted(ROOT_DIR.glob("pytorch3d/implicitron/evaluation/*.py"))
create_one_file(
"pytorch3d.implicitron.evaluation",
"evaluation",
paths_to_modules(evaluation_files),
DEST_DIR / "evaluation.rst",
)
make_directory_index("pytorch3d.implicitron", DEST_DIR)
def iterate_toplevel_module(name: str) -> None:
dest_dir = Path(__file__).resolve().parent / "modules" / name
iterate_directory(ROOT_DIR / "pytorch3d" / name, dest_dir)
do_implicitron()
iterate_toplevel_module("renderer")
iterate_toplevel_module("vis")

View File

@@ -0,0 +1,29 @@
pytorch3d.implicitron.dataset in general
========================================
Basics of data for implicitron
.. automodule:: pytorch3d.implicitron.dataset.dataset_base
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.data_loader_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.data_source
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.scene_batch_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,29 @@
pytorch3d.implicitron.dataset specific datasets
===============================================
specific datasets
.. automodule:: pytorch3d.implicitron.dataset.blender_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.json_index_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.json_index_dataset_map_provider_v2
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.llff_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.rendered_mesh_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,14 @@
pytorch3d.implicitron.evaluation
================================
evaluation
.. automodule:: pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.evaluation.evaluator
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,10 @@
pytorch3d.implicitron
=====================
.. toctree::
models/index.rst
data_basics
datasets
evaluation
tools

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.base_model
=======================================
base_model
.. automodule:: pytorch3d.implicitron.models.base_model
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.feature_extractor.feature_extractor
================================================================
feature_extractor
.. automodule:: pytorch3d.implicitron.models.feature_extractor.feature_extractor
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,7 @@
pytorch3d.implicitron.models.feature_extractor
==============================================
.. toctree::
feature_extractor
resnet_feature_extractor

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.feature_extractor.resnet_feature_extractor
=======================================================================
resnet_feature_extractor
.. automodule:: pytorch3d.implicitron.models.feature_extractor.resnet_feature_extractor
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.generic_model
==========================================
generic_model
.. automodule:: pytorch3d.implicitron.models.generic_model
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.global_encoder.autodecoder
=======================================================
autodecoder
.. automodule:: pytorch3d.implicitron.models.global_encoder.autodecoder
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.global_encoder.global_encoder
==========================================================
global_encoder
.. automodule:: pytorch3d.implicitron.models.global_encoder.global_encoder
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,7 @@
pytorch3d.implicitron.models.global_encoder
===========================================
.. toctree::
autodecoder
global_encoder

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.base
===================================================
base
.. automodule:: pytorch3d.implicitron.models.implicit_function.base
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.decoding_functions
=================================================================
decoding_functions
.. automodule:: pytorch3d.implicitron.models.implicit_function.decoding_functions
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.idr_feature_field
================================================================
idr_feature_field
.. automodule:: pytorch3d.implicitron.models.implicit_function.idr_feature_field
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,13 @@
pytorch3d.implicitron.models.implicit_function
==============================================
.. toctree::
base
decoding_functions
idr_feature_field
neural_radiance_field
scene_representation_networks
utils
voxel_grid
voxel_grid_implicit_function

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.neural_radiance_field
====================================================================
neural_radiance_field
.. automodule:: pytorch3d.implicitron.models.implicit_function.neural_radiance_field
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.scene_representation_networks
============================================================================
scene_representation_networks
.. automodule:: pytorch3d.implicitron.models.implicit_function.scene_representation_networks
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.utils
====================================================
utils
.. automodule:: pytorch3d.implicitron.models.implicit_function.utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.voxel_grid
=========================================================
voxel_grid
.. automodule:: pytorch3d.implicitron.models.implicit_function.voxel_grid
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.voxel_grid_implicit_function
===========================================================================
voxel_grid_implicit_function
.. automodule:: pytorch3d.implicitron.models.implicit_function.voxel_grid_implicit_function
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,15 @@
pytorch3d.implicitron.models
============================
.. toctree::
base_model
generic_model
metrics
model_dbir
feature_extractor/index
global_encoder/index
implicit_function/index
renderer/index
view_pooler/index
visualization/index

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.metrics
====================================
metrics
.. automodule:: pytorch3d.implicitron.models.metrics
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.model_dbir
=======================================
model_dbir
.. automodule:: pytorch3d.implicitron.models.model_dbir
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.base
==========================================
base
.. automodule:: pytorch3d.implicitron.models.renderer.base
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,14 @@
pytorch3d.implicitron.models.renderer
=====================================
.. toctree::
base
lstm_renderer
multipass_ea
ray_point_refiner
ray_sampler
ray_tracing
raymarcher
rgb_net
sdf_renderer

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.lstm_renderer
===================================================
lstm_renderer
.. automodule:: pytorch3d.implicitron.models.renderer.lstm_renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.multipass_ea
==================================================
multipass_ea
.. automodule:: pytorch3d.implicitron.models.renderer.multipass_ea
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_point_refiner
=======================================================
ray_point_refiner
.. automodule:: pytorch3d.implicitron.models.renderer.ray_point_refiner
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_sampler
=================================================
ray_sampler
.. automodule:: pytorch3d.implicitron.models.renderer.ray_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_tracing
=================================================
ray_tracing
.. automodule:: pytorch3d.implicitron.models.renderer.ray_tracing
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.raymarcher
================================================
raymarcher
.. automodule:: pytorch3d.implicitron.models.renderer.raymarcher
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.rgb_net
=============================================
rgb_net
.. automodule:: pytorch3d.implicitron.models.renderer.rgb_net
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.sdf_renderer
==================================================
sdf_renderer
.. automodule:: pytorch3d.implicitron.models.renderer.sdf_renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.feature_aggregator
===========================================================
feature_aggregator
.. automodule:: pytorch3d.implicitron.models.view_pooler.feature_aggregator
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,8 @@
pytorch3d.implicitron.models.view_pooler
========================================
.. toctree::
feature_aggregator
view_pooler
view_sampler

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.view_pooler
====================================================
view_pooler
.. automodule:: pytorch3d.implicitron.models.view_pooler.view_pooler
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.view_sampler
=====================================================
view_sampler
.. automodule:: pytorch3d.implicitron.models.view_pooler.view_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,6 @@
pytorch3d.implicitron.models.visualization
==========================================
.. toctree::
render_flyaround

View File

@@ -0,0 +1,9 @@
pytorch3d.implicitron.models.visualization.render_flyaround
===========================================================
render_flyaround
.. automodule:: pytorch3d.implicitron.models.visualization.render_flyaround
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,64 @@
pytorch3d.implicitron.tools
===========================
Tools for implicitron
.. automodule:: pytorch3d.implicitron.tools.camera_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.circle_fitting
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.config
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.eval_video_trajectory
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.image_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.metric_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.model_io
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.point_cloud_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.rasterize_mc
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.stats
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.video_writer
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.vis_utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -3,7 +3,6 @@ API Documentation
.. toctree::
common
structures
io
loss
@@ -12,3 +11,6 @@ API Documentation
transforms
utils
datasets
common
vis/index
implicitron/index

View File

@@ -1,7 +1,9 @@
blending
pytorch3d.renderer.blending
===========================
blending
.. automodule:: pytorch3d.renderer.blending
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.camera_conversions
=====================================
camera_conversions
.. automodule:: pytorch3d.renderer.camera_conversions
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.camera_utils
===============================
camera_utils
.. automodule:: pytorch3d.renderer.camera_utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,7 +1,9 @@
pytorch3d.renderer.cameras
==========================
cameras
===========================
.. automodule:: pytorch3d.renderer.cameras
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.compositing
==============================
compositing
.. automodule:: pytorch3d.renderer.compositing
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.fisheyecameras
=================================
fisheyecameras
.. automodule:: pytorch3d.renderer.fisheyecameras
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.harmonic_embedding
==============================================
harmonic_embedding
.. automodule:: pytorch3d.renderer.implicit.harmonic_embedding
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,11 @@
pytorch3d.renderer.implicit
===========================
.. toctree::
harmonic_embedding
raymarching
raysampling
renderer
sample_pdf
utils

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.raymarching
=======================================
raymarching
.. automodule:: pytorch3d.renderer.implicit.raymarching
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.raysampling
=======================================
raysampling
.. automodule:: pytorch3d.renderer.implicit.raysampling
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.renderer
====================================
renderer
.. automodule:: pytorch3d.renderer.implicit.renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.sample_pdf
======================================
sample_pdf
.. automodule:: pytorch3d.renderer.implicit.sample_pdf
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.implicit.utils
=================================
utils
.. automodule:: pytorch3d.renderer.implicit.utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,15 +1,19 @@
pytorch3d.renderer
===========================
pytorch3d.renderer
==================
.. toctree::
rasterizer
blending
camera_conversions
camera_utils
cameras
compositing
fisheyecameras
lighting
materials
texturing
blending
shading
shader
renderer
utils
splatter_blend
utils
implicit/index
mesh/index
opengl/index
points/index

View File

@@ -1,6 +1,9 @@
lighting
pytorch3d.renderer.lighting
===========================
lighting
.. automodule:: pytorch3d.renderer.lighting
:members:
:undoc-members:
:undoc-members:
:show-inheritance:

View File

@@ -1,7 +1,9 @@
pytorch3d.renderer.materials
============================
materials
===========================
.. automodule:: pytorch3d.renderer.materials
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.clip
============================
clip
.. automodule:: pytorch3d.renderer.mesh.clip
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,13 @@
pytorch3d.renderer.mesh
=======================
.. toctree::
clip
rasterize_meshes
rasterizer
renderer
shader
shading
textures
utils

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.rasterize_meshes
========================================
rasterize_meshes
.. automodule:: pytorch3d.renderer.mesh.rasterize_meshes
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.rasterizer
==================================
rasterizer
.. automodule:: pytorch3d.renderer.mesh.rasterizer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.renderer
================================
renderer
.. automodule:: pytorch3d.renderer.mesh.renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,7 +1,9 @@
pytorch3d.renderer.mesh.shader
==============================
shader
===========================
.. automodule:: pytorch3d.renderer.mesh.shader
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,7 +1,9 @@
pytorch3d.renderer.mesh.shading
===============================
shading
===========================
.. automodule:: pytorch3d.renderer.mesh.shading
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.textures
================================
textures
.. automodule:: pytorch3d.renderer.mesh.textures
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.mesh.utils
=============================
utils
.. automodule:: pytorch3d.renderer.mesh.utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,7 @@
pytorch3d.renderer.opengl
=========================
.. toctree::
opengl_utils
rasterizer_opengl

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.opengl.opengl_utils
======================================
opengl_utils
.. automodule:: pytorch3d.renderer.opengl.opengl_utils
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.opengl.rasterizer_opengl
===========================================
rasterizer_opengl
.. automodule:: pytorch3d.renderer.opengl.rasterizer_opengl
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.compositor
====================================
compositor
.. automodule:: pytorch3d.renderer.points.compositor
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,10 @@
pytorch3d.renderer.points
=========================
.. toctree::
compositor
rasterize_points
rasterizer
renderer
pulsar/index

View File

@@ -0,0 +1,7 @@
pytorch3d.renderer.points.pulsar
================================
.. toctree::
renderer
unified

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.pulsar.renderer
=========================================
renderer
.. automodule:: pytorch3d.renderer.points.pulsar.renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.pulsar.unified
========================================
unified
.. automodule:: pytorch3d.renderer.points.pulsar.unified
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.rasterize_points
==========================================
rasterize_points
.. automodule:: pytorch3d.renderer.points.rasterize_points
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.rasterizer
====================================
rasterizer
.. automodule:: pytorch3d.renderer.points.rasterizer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.points.renderer
==================================
renderer
.. automodule:: pytorch3d.renderer.points.renderer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,10 +0,0 @@
rasterizer
===========================
.. automodule:: pytorch3d.renderer.mesh.rasterize_meshes
:members:
:undoc-members:
.. automodule:: pytorch3d.renderer.mesh.rasterizer
:members:
:undoc-members:

View File

@@ -0,0 +1,9 @@
pytorch3d.renderer.splatter_blend
=================================
splatter_blend
.. automodule:: pytorch3d.renderer.splatter_blend
:members:
:undoc-members:
:show-inheritance:

View File

@@ -1,7 +0,0 @@
texturing
===========================
.. automodule:: pytorch3d.renderer.mesh.texturing
:members:
:undoc-members:

View File

@@ -1,6 +1,9 @@
pytorch3d.renderer.utils
========================
utils
===========================
.. automodule:: pytorch3d.renderer.utils
:members:
:undoc-members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,7 @@
pytorch3d.vis
=============
.. toctree::
plotly_vis
texture_vis

View File

@@ -0,0 +1,9 @@
pytorch3d.vis.plotly_vis
========================
plotly_vis
.. automodule:: pytorch3d.vis.plotly_vis
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,9 @@
pytorch3d.vis.texture_vis
=========================
texture_vis
.. automodule:: pytorch3d.vis.texture_vis
:members:
:undoc-members:
:show-inheritance:

View File

@@ -62,7 +62,7 @@ Below we compare the performance for Objectron (in C++) and our algorithm, in C+
```python
from pytorch3d.ops import box3d_overlap
# Assume inputs: boxes1 (M, 8, 3) and boxes2 (N, 8, 3)
intersection_vol, iou_3d = box3d_overal(boxes1, boxes2)
intersection_vol, iou_3d = box3d_overlap(boxes1, boxes2)
```
For more details, read [iou_box3d.py](https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/ops/iou_box3d.py).

View File

@@ -5,7 +5,8 @@ sphinx_rtd_theme
sphinx_markdown_tables
mock
numpy
git+git://github.com/facebookresearch/fvcore.git
git+git://github.com/facebookresearch/iopath.git
iopath
fvcore
https://download.pytorch.org/whl/cpu/torchvision-0.8.2%2Bcpu-cp37-cp37m-linux_x86_64.whl
https://download.pytorch.org/whl/cpu/torch-1.7.1%2Bcpu-cp37-cp37m-linux_x86_64.whl
omegaconf

View File

@@ -89,7 +89,7 @@
"except ModuleNotFoundError:\n",
" need_pytorch3d=True\n",
"if need_pytorch3d:\n",
" if torch.__version__.startswith(\"1.11.\") and sys.platform.startswith(\"linux\"):\n",
" if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n",
" # We try to install PyTorch3D via a released wheel.\n",
" pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n",
" version_str=\"\".join([\n",

Some files were not shown because too many files have changed in this diff Show More