Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@willurd
willurd / web-servers.md
Last active April 23, 2024 23:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@EncodeTS
EncodeTS / keras VGG-Face Model.md
Last active February 19, 2024 06:56
VGG-Face model for keras

VGG-Face model for Keras

This is the Keras model of VGG-Face.

It has been obtained through the following method:

  • vgg-face-keras:directly convert the vgg-face matconvnet model to keras model
  • vgg-face-keras-fc:first convert vgg-face caffe model to mxnet model,and then convert it to keras model

Details about the network architecture can be found in the following paper:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@baraldilorenzo
baraldilorenzo / readme.md
Last active November 21, 2023 22:41
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread
@weiliu620
weiliu620 / Dice_coeff_loss.py
Last active July 19, 2023 10:30
Dice coefficient loss function in PyTorch
def dice_loss(pred, target):
"""This definition generalize to real valued pred and target vector.
This should be differentiable.
pred: tensor with first dimension as batch
target: tensor with first dimension as batch
"""
smooth = 1.
@aldous-rey
aldous-rey / transposer.py
Last active June 3, 2023 07:38
Transpose MIDI files into C Major or A Minor
#converts all midi files in the current folder
import glob
import os
import music21
#converting everything into the key of C major or A minor
# major conversions
majors = dict([("A-", 4),("A", 3),("B-", 2),("B", 1),("C", 0),("D-", -1),("D", -2),("E-", -3),("E", -4),("F", -5),("G-", 6),("G", 5)])
@kylemcdonald
kylemcdonald / ACAI (PyTorch).ipynb
Last active March 12, 2023 18:37
PyTorch ACAI (1807.07543).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JPvRiel
JPvRiel / remove-docker-containers-and-untaged-images.md
Last active February 14, 2023 13:36 — forked from ngpestelos/remove-docker-containers.md
How to remove unused docker containers and images (cleanup)

Delete all containers

$ docker ps -q -a | xargs docker rm
  • -q prints only the container IDs
  • -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID