Skip to content

Instantly share code, notes, and snippets.

@brbsix
brbsix / pyqt5_scraper.py
Created June 16, 2016 13:07
PyQt5 Scraper
"""Render HTML for scraping"""
# -*- coding: utf-8 -*-
import os
import sys
from contextlib import contextmanager
from multiprocessing import Pool
try:
TimeoutError
@mrdrozdov
mrdrozdov / example.py
Last active December 28, 2018 22:10
Logging in Tensorflow
from tf_logger import TFLogger
""" Example of using TFLogger to save train & dev statistics. To visualize
in tensorboard simply do:
tensorboard --logdir /path/to/summaries
This code does depend on Tensorflow, but does not require that your model
is built using Tensorflow. For instance, could build a model in Chainer, then
@hollance
hollance / Compressing-MobileNet.ipynb
Created September 26, 2017 12:47
Jupyter notebook for compressing MobileNet (work in progress)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import commentjson
import os
import sys
import collections
import numpy as np
import scipy as scp
import scipy.misc
import tensorflow as tf
@jubjamie
jubjamie / pb_viewer.py
Created March 31, 2017 10:01
Load .pb into Tensorboard
import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Session() as sess:
model_filename ='PATH_TO_PB.pb'
with gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def)
LOGDIR='/logs/tests/1/'
train_writer = tf.summary.FileWriter(LOGDIR)
@AdilsonFuxe
AdilsonFuxe / Kurbenetes ErrImagePull, ErrImageNeverPull and ImagePullBackoff Errors
Created April 1, 2022 08:30
Kurbenetes ErrImagePull, ErrImageNeverPull and ImagePullBackoff Errors
If your pods are showing ErrImagePull, ErrImageNeverPull, or ImagePullBackOff errors after running kubectl apply, the simplest solution is to provide an imagePullPolicy to the pod.
First, run kubectl delete -f infra/k8s/
Then, update your pod manifest:
spec:
containers:
- name: posts
image: cygnet/posts:0.0.1
@Fweeb
Fweeb / blender-multi_gpu.markdown
Last active November 12, 2023 00:33
Rendering in Blender on a machine with multiple GPUs

Rendering in Blender on a machine with multiple GPUs

So here's the premise: For scenes that take around a minute or less to render, performance is actually worse if you render on all of the cards with a single instance of Blender. This is because (AFAIK) there's a bit of additional time necessary to collect the render results from each card and stitch them together. That time is a fixed short duration, so it's negligible on larger/longer render jobs. However, on shorter render jobs, the 'stitch time' has a much more significant impact.

I ran into this with a machine I render on that has 4 Quadro K6000s in it. To render animations, I ended up writing a few little scripts to facilitate launching 4 separate instances of Blender, each one tied to one GPU. Overall rendertime was much shorter with that setup than one instance of Blender using all 4 GPUs.

The setup works basically like this... I have a the following Python script (it can be anywhere on your hard drive, so long as you remember the path to it).

@carlthome
carlthome / Signal reconstruction from spectrograms.ipynb
Created May 31, 2018 13:53
Try to recover audio from filtered magnitudes when phase information has been lost.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@omoindrot
omoindrot / tensorflow_finetune.py
Last active February 25, 2024 15:00
Example TensorFlow script for fine-tuning a VGG model (uses tf.contrib.data)
"""
Example TensorFlow script for finetuning a VGG model on your own data.
Uses tf.contrib.data module which is in release v1.2
Based on PyTorch example from Justin Johnson
(https://gist.github.com/jcjohnson/6e41e8512c17eae5da50aebef3378a4c)
Required packages: tensorflow (v1.2)
Download the weights trained on ImageNet for VGG:
```
wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active April 21, 2024 02:41
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.