Giter Site home page Giter Site logo

hannesstark / smpl-nerf Goto Github PK

View Code? Open in Web Editor NEW
54.0 5.0 6.0 19.52 MB

Embed human pose information into neural radiance fields (NeRF) to render images of humans in desired poses :running: from novel views

Python 97.38% C++ 1.39% Cuda 1.17% POV-Ray SDL 0.06%
nerf neural-radiance-fields pytorch smpl

smpl-nerf's Introduction

PyTorch Neural Radiance Fields (NeRF) with SMPL embedding

This repository is a PyTorch implementation of NeRF which can be trained on images of a scene to then render novel views. To enjoy the the vanilla NeRF just run the train file with model_type=nerf. Additionally, different model types are supported that embed an SMPL model of a human to control its pose in addition to the view point.

Quickstart

  • Create a 128x128 synthetic dataset of humans with different arm angles for the model type smpl_nerf.
python create_dataset.py --dataset=smpl_nerf --save_dir=data --resolution=128 --start_angle=0 --end_angle=1 --number_steps=1 --human_number_steps=10 --multi_human_pose=1 --human_start_angle=0 --human_end_angle=60
  • Install torchsearchsorted.
cd torchsearchsorted
pip install .
  • Run the train file.
python train.py --experiment_name=SMPLNeRF --model_type=smpl_nerf --dataset_dir=data --batchsize=64 --batchsize_val=64 --num_epochs=100 --netdepth=8 --run_fine=1 --netdepth_fine=8
  • Start tensorboard.
tensorboard --logdir=logs/summaries --port=6006

Navigate to localhost:6006 in your browser and watch the model train.

Requirements

  • PyTorch >=1.4
  • matplotlib
  • numpy
  • imageio
  • configargparse
  • torchsearchsorted
  • smplx

Creating synthetic datasets requires

  • pyrender
  • trimesh

Setting up the Baseline

  • Clone Pix2Pix repo (TODO: install dependencies):
mkdir baseline/
cd baseline/
git clone https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix.git
cd ..
  • Create Dataset with (RGB, depth)-pairs
python create_dataset.py --dataset=pix2pix --save_dir=baseline/pytorch-CycleGAN-and-pix2pix/datasets/smpl --resolution=128 --start_angle=-90 --end_angle=90 --number_steps=10
  • Train Pix2Pix on datasets (set name for experiment, set gpu_ids=-1 for CPU)
cd baseline/pytorch-CycleGAN-and-pix2pix/
python train.py --gpu_ids=0 --model=pix2pix --dataroot=datasets/smpl --name=SMPL_pix2pix --direction=BtoA --save_epoch_freq=50

Model Types

  • nerf: the vanilla NeRF
  • image_wise_dynamic: the rays are not shuffeled between the image during processing so that the warp for every ray is only calculated once.

NeRF is from the Paper:

Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, & Ren Ng. (2020). NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis.

smpl-nerf's People

Contributors

hannesstark avatar phi-wol avatar philippreiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smpl-nerf's Issues

where is SirenRenderRayNet ?

hello! i have a problem when i run your repository.

from models.debug_model import DebugModel
from models.siren_net import SirenRenderRayNet

could you please tell me where are the definitions of the DebugModel module and SirenRenderRayNet module that are referenced in the train.py) ?

ๅ›พ็‰‡

thanks a lot !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.