Skip to content

Instantly share code, notes, and snippets.

View oliver-batchelor's full-sized avatar

Oliver Batchelor oliver-batchelor

View GitHub Profile
@oliver-batchelor
oliver-batchelor / gist:b18fdcbc533d205cf1527c7e6770b63a
Created November 27, 2024 12:17
EWA Splatting Jacobian sympy
import sympy as sp
fx, fy, cx, cy, x, y, z = sp.symbols('fx fy cx cy x y z')
K = sp.Matrix([[fx, 0, cx],
[0, fy, cy],
[0, 0, 1]])
p = sp.Matrix([x, y, z])
# project point
@oliver-batchelor
oliver-batchelor / align.py
Last active November 18, 2024 05:33
align curves test
import numpy as np
import matplotlib.pyplot as plt
import scipy
def offset_and_scale(curve, c, a, b):
return np.stack([curve[:, 0] + c, curve[:, 1] * a + b], axis=1)
def align_curves(curve1, curve2):
def distance(args):
import argparse
from functools import partial
import math
from pathlib import Path
from camera_geometry import FrameSet
from camera_geometry.scan.views import load_frames_with, undistort_cameras
from camera_geometry import Camera
import cv2
import numpy as np
import random
import numpy as np
import functools
from scipy.optimize import leastsq
def homog_points(points):
from os.path import split
from typing import List
import torch
# import opt_einsum as oe
from torch.nn.modules.activation import ReLU
import torch.utils.benchmark as benchmark
from torch import nn
import math
import nestedtensor
from os.path import split
import torch
import opt_einsum as oe
import torch.utils.benchmark as benchmark
from torch import nn
import torch.nn.functional as F
f1 = 256
f2 = 256
#!/bin/bash
#!/bin/bash
read -r -d '' script <<-'EOF'
/netfs/share/bin/mountp
ln -sf ~/.p_drive/file.canterbury.ac.nz/Student/Class/cosc ./cosc_shared
EOF
ssh cosc "$script" > /dev/null 2>&1
#!/bin/bash
read -p 'Enter COSC Username: ' user
echo "Writing ~/.ssh.config..."
cat > ~/.ssh/config << END
# This is the most part as it allows access to the gateway computer
# Accessing any internal computers requires this base configuration.
Host cosc
Hostname linux.cosc.canterbury.ac.nz
causality loop detected:
Main.main (test/DebugCycles.hs:182:1-30)
|
`- Main.runTest (test/DebugCycles.hs:(144,1)-(160,28))
|
`- Test.Run.runApp' (test/Test/Run.hs:(64,1)-(66,75))
|
`- Test.Run.runApp (test/Test/Run.hs:(29,1)-(58,92))
|
`- Reflex.PerformEvent.Base.hostPerformEventT (src/Reflex/PerformEvent/Base.hs:(130,1)-(150,15))
import cv2
import numpy as np
import os.path as path
import os
from matplotlib import pyplot as plt
def valid(file):
_, ext = path.splitext(file)
return ext in ['.jpg', '.png', '.jpeg']