Skip to content

Instantly share code, notes, and snippets.

View sprintr's full-sized avatar
🎯
Focusing

Amin Ullah sprintr

🎯
Focusing
View GitHub Profile
@sprintr
sprintr / Skycam.py
Created June 2, 2021 23:40
SkyCam Equations
# SkyCam Equations
# ----------------
# See https://www.scienceforums.com/topic/9394-skycam-formula-upside-down-pyramid/?tab=comments#comment-148968
import math
# Distances between adjacent towers
v = 460
w = 250
@sprintr
sprintr / pytorch-multiclass-accuracy.py
Last active April 24, 2022 23:52
Multiclass Classifier Accuracy
test_correct = 0
train_correct = 0
output = (net(mnist_test_X) > 0.5).float()
for i, v in enumerate(output):
if v.argmax() == mnist_test_y[i].argmax():
test_correct += 1
output = (net(mnist_train_X) > 0.5).float()
for i, v in enumerate(output):
@sprintr
sprintr / bounding-box-regression.py
Last active April 26, 2022 16:27
Bounding Box Regression
# The actual height and width of each cell
cell_height, cell_width = 256, 256
# Bounding box parameters normalized between 0 and 1
# This comes from the output of a bounding box regression model
bx, by, bh, bw = 0.6, 0.6, 0.4, 0.4
# Calculate height and width
height = cell_height * bh
width = cell_width * bw

Run with the following bash command

ts-node computeJoinPoint.ts