Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
3D Deep Learning with Python

You're reading from  3D Deep Learning with Python

Product type Book
Published in Oct 2022
Publisher Packt
ISBN-13 9781803247823
Pages 236 pages
Edition 1st Edition
Languages
Authors (3):
Xudong Ma Xudong Ma
Profile icon Xudong Ma
Vishakh Hegde Vishakh Hegde
Profile icon Vishakh Hegde
Lilit Yolyan Lilit Yolyan
Profile icon Lilit Yolyan
View More author details

Table of Contents (16) Chapters

Preface 1. PART 1: 3D Data Processing Basics
2. Chapter 1: Introducing 3D Data Processing 3. Chapter 2: Introducing 3D Computer Vision and Geometry 4. PART 2: 3D Deep Learning Using PyTorch3D
5. Chapter 3: Fitting Deformable Mesh Models to Raw Point Clouds 6. Chapter 4: Learning Object Pose Detection and Tracking by Differentiable Rendering 7. Chapter 5: Understanding Differentiable Volumetric Rendering 8. Chapter 6: Exploring Neural Radiance Fields (NeRF) 9. PART 3: State-of-the-art 3D Deep Learning Using PyTorch3D
10. Chapter 7: Exploring Controllable Neural Feature Fields 11. Chapter 8: Modeling the Human Body in 3D 12. Chapter 9: Performing End-to-End View Synthesis with SynSin 13. Chapter 10: Mesh R-CNN 14. Index 15. Other Books You May Enjoy

Implementing the mesh fitting with PyTorch3D

The input point cloud is contained in pedestrian.ply. The mesh can be visualized using the vis_input.py code snippet. The main code snippet for fitting a mesh model to the point cloud is contained in deform1.py:

  1. We will start by importing the needed packages:
    import os
    import sys
    import torch
    from pytorch3d.io import load_ply, save_ply
    from pytorch3d.io import load_obj, save_obj
    from pytorch3d.structures import Meshes
    from pytorch3d.utils import ico_sphere
    from pytorch3d.ops import sample_points_from_meshes
    from pytorch3d.loss import (
        chamfer_distance,
        mesh_edge_loss,
        mesh_laplacian_smoothing,
        mesh_normal_consistency,
    )
    import numpy as np
  2. We then declare a PyTorch device. If you have GPUs, then the device would be created to use GPUs. Otherwise, the device has to use CPUs:
    if torch.cuda.is_available():
        device...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}