Raumkommander commited on
Commit
ee84b3c
·
1 Parent(s): 85da776

inital deployment1

Browse files
Files changed (1) hide show
  1. app.py +18 -3
app.py CHANGED
@@ -21,9 +21,24 @@ def generate_image(prompt: str):
21
  image = pipe(prompt, num_inference_steps=4).images[0]
22
  return image
23
 
24
- def process_frame(frame):
25
- """Process each frame (convert to grayscale as an example)"""
26
- frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  return frame
28
 
29
  def video_stream(frame):
 
21
  image = pipe(prompt, num_inference_steps=4).images[0]
22
  return image
23
 
24
+
25
+
26
+ def apply_color_filter(frame, filter_type="None"):
27
+ """Apply a color filter to the frame."""
28
+ if filter_type == "Red":
29
+ frame[:, :, 1] = 0 # Remove green channel
30
+ frame[:, :, 2] = 0 # Remove blue channel
31
+ elif filter_type == "Green":
32
+ frame[:, :, 0] = 0 # Remove red channel
33
+ frame[:, :, 2] = 0 # Remove blue channel
34
+ elif filter_type == "Blue":
35
+ frame[:, :, 0] = 0 # Remove red channel
36
+ frame[:, :, 1] = 0 # Remove green channel
37
+ return frame
38
+
39
+ def process_frame(frame, filter_type="None"):
40
+ """Process a single frame by applying a color filter."""
41
+ frame = apply_color_filter(frame, filter_type)
42
  return frame
43
 
44
  def video_stream(frame):