Esempio n. 1
0
import sys
import logging
import time




directoryPath = "examples/eval/2x2"
x = None
v = None
i = 0
limit = [2, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200][10]
sys.setrecursionlimit(30000)

print("LIMIT = {}".format(limit))
logging.info("LIMIT = {}".format(limit))

filepaths = [os.path.join(directoryPath, filename) for filename in os.listdir(directoryPath)]
filepaths = filepaths[0:limit]
t1 = time.perf_counter()
roots = [reflect.load(filepath) for filepath in filepaths]
v = roots[0].concat(roots[1:])
t2 = time.perf_counter()
logging.info("Concatted (limit={}) in {} us".format(limit, round((t2 - t1) * 1000000, 5)))

t1 = time.perf_counter()
for i in range(limit):
  v = v.blur(1)
t2 = time.perf_counter()
logging.info("Pushed (limit={}) in {} us".format(limit, round((t2 - t1) * 1000000, 5)))
Esempio n. 2
0

def V():
  try:
    reflect.server.BLUR_AMOUNT += 1
    b = reflect.server.BLUR_AMOUNT
  except AttributeError:
    reflect.server.BLUR_AMOUNT = 1
    b = reflect.server.BLUR_AMOUNT

  print("BLUR_AMOUNT = {}".format(b))

  return b


x = reflect.load("D:/Documents/University/Year 3/_Project/Media/sources/bbb_480p.avi")

x = x.blur(V())

for i in range(60):
  x = x.blur(1)

x = x.blur(1)

for i in range(60):
  x = x.blur(1)

x = x.blur(1)

x = x.subclip(1000, 1002) # the first frame will be requested for the tab thumbnail
Esempio n. 3
0
  return c

def pillarbox(x, width, height):
  b = x.resize(width = width).gaussianBlur(31)
  b = b.crop(height = height, yc = b.height / 2)
  b = b.brighten(-0.5)
  x = x.resize(height = height)
  c = b.composite(x, y1 = 0, xc = b.width / 2)
  return c

directoryPath = "examples/cambridge"
v = None
i, limit = 0, 5
for filename in os.listdir(directoryPath):
  filepath = os.path.join(directoryPath, filename)

  x = reflect.load(filepath).speed(duration = 2)
  if x.width / x.height > 800/480:
    x = letterbox(x, 800, 480)
  else:
    x = pillarbox(x, 800, 480)

  if v is None:
    v = x
  else:
    v = v.slide(x, origin = random.choice(["top", "bottom", "left", "right"]), frameCount = 20, f = reflect.core.easing.inOutQuad)

  i += 1
  if i >= limit:
    break
Esempio n. 4
0
import reflect
import os
import sys
import time
import logging


# limit = [1, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000][10]
limit = 1000
print("LIMIT = {}".format(limit))
logging.info("LIMIT = {}".format(limit))

directoryPath = "examples/eval/2x2"
x = None
v = None
i = 0
sys.setrecursionlimit(30000)
for filename in os.listdir(directoryPath):
  filepath = os.path.join(directoryPath, filename)

  x = reflect.load(filepath)

  if v is None:
    v = x
  else:
    v = v.concat(x)

  i += 1
  if i >= limit:
    break
# -*- coding: utf-8 -*-

import reflect
import os
import imageio
import time
import inspect
import random

random.seed(42)




x = reflect.load("D:/Documents/University/Year 3/_Project/Media/sources/bbb_1080p_30fps.mp4")

y = x.subclip(1619, duration = "2:30")
y = x.subclip(4819+6113)
y = x.subclip(4819+6113+2683)