This file contains 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
# BIG NOTE: | |
# I made this becuase I thought the method was interesting. It's not useful in it's current form. | |
# If you can, use an index instead. https://stackoverflow.com/a/27895337 | |
from sqlalchemy import Column, Integer, Float, ForeignKey, event, DDL | |
from sqlalchemy.schema import CreateSchema | |
from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION | |
from sqlalchemy.ext.declarative import declarative_base, declared_attr | |
Base = declarative_base() |
This file contains 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
# Reimplementation of: https://github.com/aladdinpersson/Machine-Learning-Collection/blob/master/ML/Pytorch/object_detection/metrics/mean_avg_precision.py | |
# Now with more vectorisation! | |
def precision_recall_curve_th(is_tp, confs, n_true, eps=1e-8): | |
# Sort by confs | |
order = (-confs).argsort() | |
is_tp = is_tp[order] | |
confs = confs[order] | |
# Cumulative sum true positives and number of predictions |
This file contains 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
# Utility functions for managing 3x3 matrices for cv2.warpAffine in pure numpy | |
import numpy as np | |
def identity(): | |
return np.eye(3, dtype=np.float64) | |
def affine(A=None, t=None): |
This file contains 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
name: sb3 | |
channels: | |
- pytorch | |
- nvidia | |
- conda-forge | |
dependencies: | |
- diffusers | |
- transformers | |
- pytorch | |
- torchvision |
OlderNewer