A very simple and small path tracer written in pytorch meant to be run on the GPU

Overview

MentisOculi Pytorch Path Tracer

example

  • A very simple and small path tracer written in pytorch meant to be run on the GPU
  • Why use pytorch and not some other cuda library or shaders? To enable arbitrary automatic differentiation. And because I can.

Features

Future Directions

Credits

  • While the code has been significantly morphed, it was originally a fork James Bowmans' python raytracer
  • This was inspired by my ongoing work on secure differentiable programming, specifically adversarial examples in neural networks, at the ETH SRI Lab.
You might also like...
Unofficial PyTorch implementation of DeepMind's Perceiver IO with PyTorch Lightning scripts for distributed training

Unofficial PyTorch implementation of DeepMind's Perceiver IO with PyTorch Lightning scripts for distributed training

A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch

Torchmeta A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch. Torchmeta contains popular meta-learning bench

PyTorch extensions for fast R&D prototyping and Kaggle farming

Pytorch-toolbelt A pytorch-toolbelt is a Python library with a set of bells and whistles for PyTorch for fast R&D prototyping and Kaggle farming: What

Fast, general, and tested differentiable structured prediction in PyTorch
Fast, general, and tested differentiable structured prediction in PyTorch

Torch-Struct: Structured Prediction Library A library of tested, GPU implementations of core structured prediction algorithms for deep learning applic

A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API
A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API

micrograd A tiny Autograd engine (with a bite! :)). Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural

A simplified framework and utilities for PyTorch
A simplified framework and utilities for PyTorch

Here is Poutyne. Poutyne is a simplified framework for PyTorch and handles much of the boilerplating code needed to train neural networks. Use Poutyne

Kaldi-compatible feature extraction with PyTorch, supporting CUDA, batch processing, chunk processing, and autograd

Kaldi-compatible feature extraction with PyTorch, supporting CUDA, batch processing, chunk processing, and autograd

A pure Python implementation of Compact Bilinear Pooling and Count Sketch for PyTorch.

Compact Bilinear Pooling for PyTorch. This repository has a pure Python implementation of Compact Bilinear Pooling and Count Sketch for PyTorch. This

PyTorch Lightning Optical Flow models, scripts, and pretrained weights.

PyTorch Lightning Optical Flow models, scripts, and pretrained weights.

Comments
  • Fractals

    Fractals

    Do you think it is possible to add fractal calculations like in https://bananaft.itch.io/yedomaglobula ? video example: https://www.youtube.com/watch?v=N1oKIbDqo8g&app=desktop

    opened by Bachstelze 4
  • ‘async’ is a reserved word in Python >= 3.7

    ‘async’ is a reserved word in Python >= 3.7

    Use non_blocking instead.

    flake8 testing of https://github.com/mmirman/MentisOculi on Python 3.7.1

    $ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

    ./helpers.py:34:85: E999 SyntaxError: invalid syntax
        dtype = lambda *args, **kargs: torch.cuda.DoubleTensor(*args, **kargs).cuda(async=cuda_async)
                                                                                        ^
    1     E999 SyntaxError: invalid syntax
    1
    
    opened by cclauss 2
  • Do you mind to provide me with any suggestion about how to read your code?

    Do you mind to provide me with any suggestion about how to read your code?

    I am still very junior in this field and would like to know how to start to understand a complex project like yours. Could you provide me any suggestions in this direction?

    opened by zshyang 1
  • Fixed crashes with recent versions of PyTorch

    Fixed crashes with recent versions of PyTorch

    With the current stable version of PyTorch (1.5 at time of writing), MentisOculi crashes for three reasons:

    First, subtraction is used with bool tensors, resulting in the following error:

    RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.
    

    Second, computing the value of is_first in the getFirstOcc function causes the following error to be thrown:

    RuntimeError: Expected object of scalar type unsigned char but got scalar type bool for sequence element 1.
    

    Changing the first element in the list from btype([1]) to btype([1]).bool() fixes this problem.

    Third, Writing the image to file in the save_img function fails when using CUDA unless I explicitly copy the image to CPU using img = img.cpu.

    I have fixed all three of these problems in this pull request, and MentisOculi appears to be able to render the "ring" image correctly. (I have not tested with the Cornell box.)

    Caveat: While executing, the application repeatedly prints the following deprecation warning:

    ../aten/src/ATen/native/IndexingUtils.h:19: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
    

    I have not fixed this. However, it does not stop the renderer from working.

    opened by n8xm 0
Owner
Matthew B. Mirman
make making ai safe easy
Matthew B. Mirman
GPU-accelerated PyTorch implementation of Zero-shot User Intent Detection via Capsule Neural Networks

GPU-accelerated PyTorch implementation of Zero-shot User Intent Detection via Capsule Neural Networks This repository implements a capsule model Inten

Joel Huang 15 Dec 24, 2022
Pretrained EfficientNet, EfficientNet-Lite, MixNet, MobileNetV3 / V2, MNASNet A1 and B1, FBNet, Single-Path NAS

(Generic) EfficientNets for PyTorch A 'generic' implementation of EfficientNet, MixNet, MobileNetV3, etc. that covers most of the compute/parameter ef

Ross Wightman 1.5k Jan 1, 2023
PyTorch framework A simple and complete framework for PyTorch, providing a variety of data loading and simple task solutions that are easy to extend and migrate

PyTorch framework A simple and complete framework for PyTorch, providing a variety of data loading and simple task solutions that are easy to extend and migrate

Cong Cai 12 Dec 19, 2021
Differentiable ODE solvers with full GPU support and O(1)-memory backpropagation.

PyTorch Implementation of Differentiable ODE Solvers This library provides ordinary differential equation (ODE) solvers implemented in PyTorch. Backpr

Ricky Chen 4.4k Jan 4, 2023
Differentiable SDE solvers with GPU support and efficient sensitivity analysis.

PyTorch Implementation of Differentiable SDE Solvers This library provides stochastic differential equation (SDE) solvers with GPU support and efficie

Google Research 1.2k Jan 4, 2023
The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.

News March 3: v0.9.97 has various bug fixes and improvements: Bug fixes for NTXentLoss Efficiency improvement for AccuracyCalculator, by using torch i

Kevin Musgrave 5k Jan 2, 2023
Tez is a super-simple and lightweight Trainer for PyTorch. It also comes with many utils that you can use to tackle over 90% of deep learning projects in PyTorch.

Tez: a simple pytorch trainer NOTE: Currently, we are not accepting any pull requests! All PRs will be closed. If you want a feature or something does

abhishek thakur 1.1k Jan 4, 2023
A lightweight wrapper for PyTorch that provides a simple declarative API for context switching between devices, distributed modes, mixed-precision, and PyTorch extensions.

A lightweight wrapper for PyTorch that provides a simple declarative API for context switching between devices, distributed modes, mixed-precision, and PyTorch extensions.

Fidelity Investments 56 Sep 13, 2022
A PyTorch repo for data loading and utilities to be shared by the PyTorch domain libraries.

A PyTorch repo for data loading and utilities to be shared by the PyTorch domain libraries.

null 878 Dec 30, 2022
null 270 Dec 24, 2022