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
#!/usr/bin/python3 | |
# read, akaze and show | |
import cv2 | |
import multiprocessing | |
# Function to read video frames | |
def read_video_stream(video_file, frame_queue): | |
cap = cv2.VideoCapture(video_file) |
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
#!/usr/bin/python3 | |
# Dividing the frame into tiles | |
import multiprocessing | |
import numpy as np | |
import cv2 | |
class OpenCV_Multiprocessing: | |
def __init__(self, features): |
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
class ReduceDraw: | |
""" | |
Class for drawing many objects without loops | |
""" | |
__slots__ = ['frame_tmp','color', 'size', 'font'] | |
def __init__(self, color = (0, 0, 255), size = 10): | |
self.frame_tmp = None | |
self.color = color | |
self.size = size | |
self.font = cv2.FONT_HERSHEY_SIMPLEX |
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 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
img = cv2.imread('image_big.png') | |
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
rows, colss = img.shape | |
crow, ccol = rows//2 , colss//2 | |
print(crow, ccol) |
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
class CX:... | |
CX.m = lambda x : x | |
a = CX | |
CX.n = lambda y : y | |
b = CX | |
print(a is b) | |
print(id(a.n(a)) is id(b.m(b))) | |
print(id(a.n(a)) == id(b.m(b))) | |
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
''' | |
Random YouTube Video | |
It's just for fun, generate a random string | |
and try to find a youtube video with that string's id | |
''' | |
import random | |
import string | |
import requests |
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
class DataBuffer: | |
""" Observer pattern """ | |
def __init__(self): | |
self.memory = None | |
def remember(self, memory): | |
self.memory = memory | |
def recall(self): | |
out = self.memory |
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
read_list=[] | |
for i in nuke.allNodes(): | |
if i.Class() == ('Read'): | |
read_list.append(i.knob('file').getValue()) | |
for rl in read_list: | |
if '/bstorage/strg01/mnt/projects/mavka/render/' in rl: | |
print rl |
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
""" | |
Load the latest version of daily | |
import sys | |
module_path = '/home/shrimo/Desktop/course/vfx_dev/nuke' | |
if module_path not in sys.path: | |
sys.path.append(module_path) | |
import daily_view | |
reload(daily_view) |
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
""" | |
Find render version | |
import sys | |
module_path = '/home/shrimo/Desktop/course/vfx_dev/nuke' | |
if module_path not in sys.path: | |
sys.path.append(module_path) | |
import find_version | |
reload(find_version) |
NewerOlder