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 taichi as ti | |
from skimage.io import imread, imsave | |
ti.init(arch=ti.cuda) | |
@ti.kernel | |
def normals_from_depth_kernel(f: ti.f32, cx: ti.f32, cy: ti.f32, window_size: ti.u16, max_rel_depth_diff: ti.f32): | |
height, width = ti_depth.shape() |
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
#!/bin/bash | |
mv "$1" "${1%.*}"-$(sha256sum "$1" | cut -c1-8).pt |
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
# x - easting, y - northing | |
def grid20k(x, y): | |
x = int(x) // 1000 - 200 | |
y = int(y) // 1000 - 5900 | |
idx = (y // 100) * 1000 + (y // 10 % 10) * 10 | |
idx += (x // 100) * 100 + (x // 10 % 10) | |
return idx | |
def grid10k(x, y): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 av | |
# packets = [H.264 packets as byte arrays] | |
codec = av.CodecContext.create('h264', 'r') | |
for packet in packets: | |
for avpacket in codec.parse(packet): | |
frames = codec.decode(avpacket) | |
print(frames) | |
# Or, can also simply do |
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
% Matlab sample code to read calibration data from sensor output. | |
fileFilter = '*.pcap'; | |
[File_name, Directory] = uigetfile(fileFilter, 'Open a .pcap file'); | |
Filename = [Directory File_name]; | |
fid = fopen(Filename); | |
ttc = fread(fid, 40); | |
ttc = fread(fid, 42); | |
ttc = fread(fid, inf, '1206*uint8=>uint8', 58); | |
fclose(fid); |
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
# Defines the following helper functions: | |
# - print_target_properties() | |
# - print_vars() | |
# - get_all_targets() | |
# Adapted from https://stackoverflow.com/a/68881024/2997179 | |
# Print all properties of CMake target. | |
function(print_target_properties target) | |
if(NOT TARGET ${target}) |
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
#!/bin/bash | |
set -eu -o pipefail | |
name=$1 | |
version=$2 | |
template=${3:-"cmake_package"} | |
echo Copying sources... | |
root=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
pkg_dir=$root/recipes/$name |