Skip to content

Instantly share code, notes, and snippets.

View karolzak's full-sized avatar
😷
Working from home

Karol Żak karolzak

😷
Working from home
  • Microsoft
View GitHub Profile
@karolzak
karolzak / keras_callbacks.py
Created August 22, 2019 21:39
Some callbacks for keras
from keras.callbacks import ModelCheckpoint
checkpoint_callback = ModelCheckpoint(
"c3d_v5_chkpt-{epoch:02d}-{val_loss:.2f}-{val_acc:.2f}.hdf5",
monitor='val_loss',
verbose=1,
save_best_only=True,
save_weights_only=False,
mode='auto',
period=1)
@karolzak
karolzak / video_indexer.py
Created March 30, 2021 09:50
Azure Video Indexer python client
# Original source code: https://github.com/bklim5/python_video_indexer_lib
import re
import time
import datetime
import requests
def get_retry_after_from_message(message):
@karolzak
karolzak / faiss_nn.py
Last active April 9, 2021 12:28
Nearest Neighbors algo implementation with FAISS
import numpy as np
import faiss
class FaissNearestNeighbors:
def __init__(self, k=5):
self.index = None
self.y = None
self.k = k