Skip to content

Instantly share code, notes, and snippets.

@raulqf
raulqf / Install_OpenCV4_CUDA11_CUDNN8.md
Last active April 18, 2024 19:53
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 22.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 22.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@daveshah1
daveshah1 / vtbin2nes.py
Created February 2, 2018 18:59
VTxx BIN to NES 2.0 converter
#!/usr/bin/env python3
import os, sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert VTxx BIN format to NES 2.0 format')
parser.add_argument('infile', metavar='infile', type=str, nargs=1,
help='Input .bin file')
parser.add_argument('-m', '--mapper', action='store', default=256,
help='NES 2.0 mapper number (default: 256)')
@danijar
danijar / blog_tensorflow_variational_auto_encoder.py
Last active February 22, 2023 09:02
TensorFlow Variational Auto-Encoder
# Full example for my blog post at:
# https://danijar.com/building-variational-auto-encoders-in-tensorflow/
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
tfd = tf.contrib.distributions
@mmalex
mmalex / pngencode.cpp
Created April 7, 2011 17:48 — forked from anonymous/pngencode.cpp
bug fix png encoder
// by alex evans, 2011. released into the public domain.
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple.
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8)
//
// VERSION 0.02! now using zlib's crc rather than my own, and avoiding a memcpy and memory scribbler in the old one
// by passing the zero byte at the start of the scanline to zlib first, then the original scanline in place. WIN!
//
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
//
// follow me on twitter @mmalex http://twitter.com/mmalex