/** * 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. */ const React = require('react'); const CompLibrary = require('../../core/CompLibrary.js'); const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */ const Container = CompLibrary.Container; const GridBlock = CompLibrary.GridBlock; const bash = (...args) => `~~~bash\n${String.raw(...args)}\n~~~`; class HomeSplash extends React.Component { render() { const {siteConfig, language = ''} = this.props; const {baseUrl, docsUrl} = siteConfig; const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; const langPart = `${language ? `${language}/` : ''}`; const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`; const SplashContainer = props => (
{props.children}
); const Logo = props => (
Project Logo
); const ProjectTitle = props => (

{props.tagline}

); const PromoSection = props => (
{props.children}
); const Button = props => (
{props.children}
); return (
); } } function SocialBanner() { return (
Support Ukraine πŸ‡ΊπŸ‡¦{' '} Help Provide Humanitarian Aid to Ukraine .
); } class Index extends React.Component { render() { const {config: siteConfig, language = ''} = this.props; const {baseUrl} = siteConfig; const Block = props => ( ); const Description = () => ( {[ { content: 'This is another description of how this project is useful', image: `${baseUrl}img/docusaurus.svg`, imageAlign: 'right', title: 'Description', }, ]} ); const pre = '```'; const codeExample = `${pre}python from pytorch3d.utils import ico_sphere from pytorch3d.io import load_obj from pytorch3d.structures import Meshes from pytorch3d.ops import sample_points_from_meshes from pytorch3d.loss import chamfer_distance # Use an ico_sphere mesh and load a mesh from an .obj e.g. model.obj sphere_mesh = ico_sphere(level=3) verts, faces, _ = load_obj("model.obj") test_mesh = Meshes(verts=[verts], faces=[faces.verts_idx]) # Differentiably sample 5k points from the surface of each mesh and then compute the loss. sample_sphere = sample_points_from_meshes(sphere_mesh, 5000) sample_test = sample_points_from_meshes(test_mesh, 5000) loss_chamfer, _ = chamfer_distance(sample_sphere, sample_test) `; const QuickStart = () => (

Get Started

  1. Install PyTorch3D (following the instructions here)
  2. Try a few 3D operators e.g. compute the chamfer loss between two meshes: {codeExample}
); const Features = () => (
{[ { content: 'Supports batching of 3D inputs of different sizes ' + 'such as meshes' , image: `${baseUrl}img/batching.svg`, imageAlign: 'top', title: 'Heterogeneous Batching', }, { content: 'Supports optimized implementations of ' + 'several common functions for 3D data', image: `${baseUrl}img/ops.png`, imageAlign: 'top', title: 'Fast 3D Operators', }, { content: 'Modular differentiable rendering API ' + 'with parallel implementations in ' + 'PyTorch, C++ and CUDA' , image: `${baseUrl}img/rendering.svg`, imageAlign: 'top', title: 'Differentiable Rendering', }, ]}
); const Showcase = () => { if ((siteConfig.users || []).length === 0) { return null; } const showcase = siteConfig.users .filter(user => user.pinned) .map(user => ( {user.caption} )); const pageUrl = page => baseUrl + (language ? `${language}/` : '') + page; return (

Who is Using This?

This project is used by all these people

{showcase}
More {siteConfig.title} Users
); }; return (
); } } module.exports = Index;