Skip to content

Instantly share code, notes, and snippets.

@stared
stared / live_loss_plot_keras.ipynb
Last active Jan 24, 2021
Live loss plot for training models in Keras (see: https://github.com/stared/livelossplot/ for a library)
View live_loss_plot_keras.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rummanwaqar
rummanwaqar / cv::Mat.type() to string
Created Jun 8, 2016
Convert opencv mat type to string
View cv::Mat.type() to string
std::string type2str(int type) {
std::string r;
uchar depth = type & CV_MAT_DEPTH_MASK;
uchar chans = 1 + (type >> CV_CN_SHIFT);
switch ( depth ) {
case CV_8U: r = "8U"; break;
case CV_8S: r = "8S"; break;
case CV_16U: r = "16U"; break;
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@bgreenlee
bgreenlee / logging_subprocess.py
Created Nov 29, 2011
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
View logging_subprocess.py
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.