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 java.awt.Toolkit; | |
| /* Example Project | |
| OrbitCamera cam; | |
| void setup() { | |
| size(1200, 800, P3D); | |
| cam = new OrbitCamera(); | |
| fill(128); | |
| } | |
| void draw() { |
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 | |
| EPSILON = 1e-10 | |
| def _error(actual: np.ndarray, predicted: np.ndarray): | |
| """ Simple error """ | |
| return actual - predicted |
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
| // A script to generate and register an OpenVR manifest in a Unity-friendly way | |
| // OpenVR manifest lets you show proper app name in SteamVR status screen instead of process name, set a custom image for the loading screen in compositor or even allow to launch your game from Steam interface | |
| // Feel free to do anything you want with this script, but please keep this copyright notice intact. | |
| // https://gist.github.com/krzys-h/98464aa2f4a1ad814358f8f078111366 | |
| // Author: krzys_h, 2018-02-11 | |
| // Usage: | |
| // Put this script anywhere in your assets folder | |
| // Click Edit > Project Settings > OpenVR Manifest | |
| // Fill in the settings |
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
| const cloneGltf = (gltf) => { | |
| const clone = { | |
| animations: gltf.animations, | |
| scene: gltf.scene.clone(true) | |
| }; | |
| const skinnedMeshes = {}; | |
| gltf.scene.traverse(node => { | |
| if (node.isSkinnedMesh) { |
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 cv2 | |
| def add_gaussian_noise(X_imgs): | |
| gaussian_noise_imgs = [] | |
| row, col, _ = X_imgs[0].shape | |
| # Gaussian distribution parameters | |
| mean = 0 | |
| var = 0.1 | |
| sigma = var ** 0.5 | |
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
| from vjoy import vj, setJoy | |
| import numpy as np | |
| import time | |
| print("vj opening", flush=True) | |
| vj.open() | |
| time.sleep(1) | |
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 argparse | |
| import logging | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--verbose', '-v', action='count', default=1) | |
| args = parser.parse_args() | |
| args.verbose = 70 - (10*args.verbose) if args.verbose > 0 else 0 | |
| logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s', |
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
| using UnityEngine; | |
| public class TrackTargets : MonoBehaviour { | |
| [SerializeField] | |
| Transform[] targets; | |
| [SerializeField] | |
| float boundingBoxPadding = 2f; |
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
| // https://frarees.github.io/default-gist-license | |
| using System; | |
| using UnityEngine; | |
| [AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)] | |
| public class MinMaxSliderAttribute : PropertyAttribute | |
| { | |
| public float Min { get; set; } | |
| public float Max { get; set; } |
NewerOlder