This file contains 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
apiVersion: "nuclio.io/v1beta1" | |
kind: "Function" | |
spec: | |
runtime: "python:3.6" | |
handler: main:handler | |
minReplicas: 1 | |
maxReplicas: 1 | |
build: | |
baseImage: python:3.6-jessie |
This file contains 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
from IPython.display import HTML, display | |
import cv2 as cv | |
import os | |
import matplotlib.pyplot as plt | |
def make_prediction(model, movie, nframe, classes, shape=(224, 224), nchan=3): | |
video = cv.VideoCapture(movie) | |
frames = [] | |
while True: | |
grabbed, frame = video.read() |
This file contains 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 as cv | |
import os | |
import glob | |
import numpy as np | |
import random | |
from tensorflow import keras | |
import keras.preprocessing.image | |
from tensorflow.python.keras.utils.data_utils import Sequence | |
class VideoFrameGenerator(Sequence): |
This file contains 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 | |
import numpy as np | |
from IPython.display import clear_output, Image, display, HTML | |
def strip_consts(graph_def, max_const_size=32): | |
"""Strip large constant values from graph_def.""" | |
strip_def = tf.GraphDef() | |
for n0 in graph_def.node: | |
n = strip_def.node.add() | |
n.MergeFrom(n0) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 keras | |
import cv2 as cv | |
import glob | |
import numpy as np | |
import os | |
import random | |
import keras_preprocessing | |
# author: Patrice Ferlet <patrice.ferlet@smile.fr> | |
# licence: MIT |
This file contains 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
# DEPRECATED - please go to my complete package: | |
# pipy package https://pypi.org/project/keras-video-generators/ | |
# github sources https://github.com/metal3d/keras-video-generators | |
import keras | |
import cv2 as cv | |
import glob | |
import numpy as np | |
import os | |
import random |
This file contains 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 bpy | |
import mathutils | |
# Author: Patrice Ferlet <metal3d@gmail.com> | |
# License: GPL | |
# Works with Blender 2.80-2.90 | |
# To use this script: | |
# - paste this script in a "text editor" *inside* blender | |
# - name it "sun_set.py" |
This file contains 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
<html> | |
<meta charset="utf-8" /> | |
<body> | |
<pre> | |
<code> | |
# All you have to do is to prefix variables with "_change_" | |
# and let the script to manage the editable values | |
FOO="_change_thisvariable" | |
this is a command with _change_argument here |
This file contains 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
Based on https://gist.github.com/tadast/8827699: | |
- remove duplicates | |
- striped and no unecessary double quotes | |
- floating point values instead of strings |