gnosticdev commited on
Commit
6e16e99
·
verified ·
1 Parent(s): 8d8ac09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -104,14 +104,14 @@ def aplicar_glitch(video_clip):
104
  """Aplica un efecto de glitch al video."""
105
  def glitch_effect(frame):
106
  import numpy as np
107
- # Desplazar aleatoriamente filas de píxeles
108
  height, width, _ = frame.shape
109
  offset = np.random.randint(-10, 10)
110
  if offset > 0:
111
  offset = min(offset, height)
112
  if offset < 0:
113
  offset = max(offset, -height + 1)
114
- frame[offset:, :] = frame[:-offset, :]
 
115
  return frame
116
 
117
  return video_clip.fl_image(glitch_effect)
 
104
  """Aplica un efecto de glitch al video."""
105
  def glitch_effect(frame):
106
  import numpy as np
 
107
  height, width, _ = frame.shape
108
  offset = np.random.randint(-10, 10)
109
  if offset > 0:
110
  offset = min(offset, height)
111
  if offset < 0:
112
  offset = max(offset, -height + 1)
113
+ if offset!= 0 and height > 0:
114
+ frame[offset:, :] = np.roll(frame[:-offset, :], -offset, axis=0)
115
  return frame
116
 
117
  return video_clip.fl_image(glitch_effect)