This file contains hidden or 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 | |
#include <fstream> | |
#include <vector> | |
#include <array> | |
class PCD | |
{ | |
public: | |
PCD() = default; |
This file contains hidden or 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 os, subprocess, re | |
from absl import app, flags | |
from tqdm import tqdm | |
import concurrent.futures | |
import colorama | |
flags.DEFINE_string( | |
'dir', | |
None, | |
'Directory under which to search' |
This file contains hidden or 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; |
This file contains hidden or 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
#include <iostream> | |
#include <chrono> | |
class ScopedTimer | |
{ | |
public: | |
static size_t total_ns; | |
ScopedTimer(std::string name) : | |
name(name), |
This file contains hidden or 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 handles save data on the local device: | |
* | |
* It writes and reads encrypted data to/from the storage on the target device using | |
* `Application.persistentDataPath`. This secure data can be read only if its format | |
* and key are known! | |
* | |
* It is the client's responsibility to verify a loaded file exists! This can be done | |
* with the `DoesFileExist` utility function. Note that this does not guarantee | |
* success, as the type contained in the file may conflict with that requested. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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. | |
* |
NewerOlder