Table of Contents:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
from picamera import PiCamera | |
from picamera.array import PiRGBArray | |
CAMERA_RESOLUTION = (640, 480) | |
def capture_video(): | |
# Press 'q' to stop the program. | |
try: | |
# Setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from functools import partial | |
from multiprocessing import Pool | |
def apply_multicore(df, n_workers, fn, **kwargs): | |
""" | |
Apply a function to a column of a pandas DataFrame, with multicore support. | |
Parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add `source enc.sh` to your .bashrc, .profile or .zshrc to include these functions. | |
# | |
# For encryption, type: | |
# $ enc myfile | |
# | |
# For decryption, type: | |
# $ dec myfile.enc | |
function enc() { | |
if [ $# -eq 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import gluoncv | |
import mxnet as mx | |
import mxnet.ndarray as nd | |
import numpy as np | |
import pandas as pd | |
from mxnet import init, autograd | |
from mxnet.gluon import nn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discuss.mxnet.io/t/batchnorm-running-var-value-depends-on-context/3401 | |
# https://discuss.mxnet.io/t/hw-9-how-to-prevent-overflow-to-nan/3853 | |
# https://github.com/apache/incubator-mxnet/issues/18100 | |
# https://github.com/apache/incubator-mxnet/issues/18209 | |
# https://github.com/apache/incubator-mxnet/issues/14710 | |
import matplotlib.pyplot as plt | |
import mxnet as mx | |
import mxnet.ndarray as nd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Gilbert Francois Duivesteijn | |
# Date: Febr 2023 | |
# Platform: macOS | |
# License: Apache | |
# Discard receipt data for the installed GStreamer packages. | |
pkgutil --pkgs | grep gstreamer | xargs -I % sudo pkgutil --forget % | |
# Remove the GStreamer Framework from disk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# extract the downloaded opencv-[version].tar.gz to /tmp/opencv-[version], then run this script. The | |
# package will be installed in /tmp/opencv. If you like it to be installed somewhere else, change the | |
# INSTALL_PREFIX parameter. | |
### BEGIN USER SETTINGS | |
# | |
OPENCV_SRC=/tmp/opencv-3.4.5 | |
OPENCV_CONTRIB_SRC=/tmp/opencv_contrib-3.4.5/modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from google.protobuf import text_format | |
from tensorflow.python.platform import gfile | |
def pbtxt_to_graphdef(filename): | |
with open(filename, 'r') as f: | |
graph_def = tf.GraphDef() | |
file_content = f.read() | |
text_format.Merge(file_content, graph_def) | |
tf.import_graph_def(graph_def, name='') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creates a dist archive that can be used to create C++ applications with Tensorflow, without bazel | |
# IMPORTANT: Before running this script, compile tensorflow_cc.so with --config=monolithic, then run this script. | |
# | |
# The script is written for Tensorflow v1.11. Update all dependencies in this script when running for a higher version. | |
# You can find the 3rd party dependency library versions in ${TENSORFLOW_DIR}/tensorflow/workspace.bzl. | |
# | |
# Original script: https://github.com/memo/ofxMSATensorFlow/blob/master/scripts/ubuntu/copy_headers.sh | |
# |
NewerOlder