This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Batch convert Collada to Wavefront (.dae to .obj) using Blender | |
usage: blender -b -P dae_obj.py -- ./in_dir/ ./out_dir/ | |
""" | |
import sys | |
import os | |
import bpy # Blender Python API | |
def clear(): | |
""" Clears the scene """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bl_info = { | |
"name": "NeRF Data Exporter", | |
"description": "Outputs images and camera parameters in bmild/NeRF's Blender data format.", | |
"author": "ecmjohnson", | |
"version": (0, 3), | |
"blender": (2, 80, 0), | |
"support": "TESTING", | |
"category": "Import-Export", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This class implements the object pool pattern: | |
* | |
* It can be used for creating objects exactly as if using Unity's `Instantiate` call. Simply | |
* call `AcquireObject` with a prefab and an instance of that object will be returned, either | |
* recycled from the pool or allocated if the pool is empty. | |
* | |
* It is the responsibility of the object to set itself inactive with `SetActive(false)` at | |
* lifetime end. This is how objects are recycled by the pool. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: needed to modify variables in a for loop | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
:: command line options | |
SET TEXT=%~1 | |
SET FILENAME=%~2 | |
SET MAX_EPOCHS=%~3 | |
:: hardcoded options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import numba as nb | |
""" | |
A small ray-tracer for rendering a triangle soup. It gives all intersections | |
along the ray (in no particular order) and does not do back-face culling. | |
Uses a BVH for algorithmic acceleration and numba for low-level optimization. | |
Usage: | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
""" | |
A simple writer for .ply geometry files. Very useful for debugging! | |
Buffers the contents and writes out only on exit (necessary for writing | |
the header without knowing the vertex/edge/face count in advance). | |
Closes the fd in the case a with block raises an exception. | |
We could wait until the exit to even open the fd; however, I decided | |
against that to match expected behaviour. This could accomodate a | |
design where the vertex/edge/face count is provided in advance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os | |
import numpy as np | |
import imageio | |
from absl import app, flags | |
from tqdm import tqdm | |
opts = flags.FLAGS | |
flags.DEFINE_string('input_dir', 'masks', 'Input directory') | |
flags.DEFINE_string('output_dir', 'results', 'Outut directory') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
template<typename T> | |
class PID { | |
public: | |
PID(T Kp, T Ki, T Kd, T minInt, T maxInt) { | |
_kp = Kp; | |
_ki = Ki; | |
_kd = Kd; |