Skip to content

Instantly share code, notes, and snippets.

@sidharthrajaram
sidharthrajaram / fitnpredict.py
Created August 8, 2017 21:34
just a conceptual (just methods + one fit)
#Sidharth Rajaram, 2017, part of NBA-Predict
from sklearn import svm
import numpy as np
def combineData(values1, values2):
combined_stats = []
for a in range(values1.size):
result_component = [values1[a],values2[a]]
combined_stats.append(result_component)
combined_stats = np.array(combined_stats)
@sidharthrajaram
sidharthrajaram / nms_3d.py
Last active May 27, 2024 03:27
3D Non-Maximum Suppression in Python
# 3D Non-Maximum Suppression Implemented in Python - Sidharth Rajaram
import numpy as np
import time
# This approach assumes there are prediction scores (one class only) in the incoming bounding boxes as well.
# Selects best score and then suppresses.
# class score + bounding box = (p, x, y, z, w, h, l)
# p: classification score / probability
# x,y,z: location
# w,h,l: dimensions
@sidharthrajaram
sidharthrajaram / nms_2d.py
Created August 7, 2020 00:10
2D Non-Maximum Suppression
# sid rajaram
import numpy as np
import time
# This approach assumes there are class scores in the incoming lists as well.
# Selects best score and then suppresses.
# class score + bounding box = (p, x, y, w, h)
# p: classification score / probability
# x,y: location
# w,h: dimensions