spookyuser commited on
Commit
8756e93
1 Parent(s): bc014af
Files changed (1) hide show
  1. animate.py +7 -7
animate.py CHANGED
@@ -40,19 +40,19 @@ def contourfinder(image1, image2, text=None, num_frames=100, output_dir=Path("te
40
 
41
  # Initialize three empty videos
42
  vid1 = cv2.VideoWriter(
43
- Path(output_dir / "vid1.mp4"),
44
  cv2.VideoWriter_fourcc(*"mp4v"),
45
  24,
46
  threshold.shape,
47
  )
48
  vid2 = cv2.VideoWriter(
49
- Path(output_dir / "vid2.mp4"),
50
  cv2.VideoWriter_fourcc(*"mp4v"),
51
  24,
52
  threshold.shape,
53
  )
54
  text_vid = cv2.VideoWriter(
55
- Path(output_dir / "text_video.mp4"),
56
  cv2.VideoWriter_fourcc(*"mp4v"),
57
  10,
58
  threshold.shape,
@@ -74,7 +74,7 @@ def contourfinder(image1, image2, text=None, num_frames=100, output_dir=Path("te
74
  vid1.write(blank)
75
 
76
  vid1.release()
77
- clip1 = vfc(Path(output_dir / "vid1.mp4"))
78
  positions = list_of_positions((len(contours2)))
79
 
80
  for i in range(0, len(contours2)):
@@ -87,7 +87,7 @@ def contourfinder(image1, image2, text=None, num_frames=100, output_dir=Path("te
87
  vid2.write(blank2)
88
 
89
  vid2.release()
90
- clip3 = vfc(Path(output_dir / "vid2.mp4"))
91
 
92
  # Next is the text vid
93
 
@@ -113,7 +113,7 @@ def contourfinder(image1, image2, text=None, num_frames=100, output_dir=Path("te
113
  def text_frames(text, image, org):
114
  spacing = 55 # spacing between letters
115
  blink = image
116
- cv2.imwrite(Path(output_dir / "blink.png"), blink)
117
  for i in range(0, len(text) - 1):
118
 
119
  text_vid.write(blink)
@@ -131,7 +131,7 @@ def contourfinder(image1, image2, text=None, num_frames=100, output_dir=Path("te
131
  print(org)
132
 
133
  # Displaying the image
134
- cv2.imwrite(Path(output_dir / f"text_im{i}.png"), image)
135
 
136
  # Complile to video
137
  text_vid.write(image)
 
40
 
41
  # Initialize three empty videos
42
  vid1 = cv2.VideoWriter(
43
+ Path(output_dir / "vid1.mp4").as_posix(),
44
  cv2.VideoWriter_fourcc(*"mp4v"),
45
  24,
46
  threshold.shape,
47
  )
48
  vid2 = cv2.VideoWriter(
49
+ Path(output_dir / "vid2.mp4").as_posix(),
50
  cv2.VideoWriter_fourcc(*"mp4v"),
51
  24,
52
  threshold.shape,
53
  )
54
  text_vid = cv2.VideoWriter(
55
+ Path(output_dir / "text_video.mp4").as_posix(),
56
  cv2.VideoWriter_fourcc(*"mp4v"),
57
  10,
58
  threshold.shape,
 
74
  vid1.write(blank)
75
 
76
  vid1.release()
77
+ clip1 = vfc(Path(output_dir / "vid1.mp4").as_posix())
78
  positions = list_of_positions((len(contours2)))
79
 
80
  for i in range(0, len(contours2)):
 
87
  vid2.write(blank2)
88
 
89
  vid2.release()
90
+ clip3 = vfc(Path(output_dir / "vid2.mp4").as_posix())
91
 
92
  # Next is the text vid
93
 
 
113
  def text_frames(text, image, org):
114
  spacing = 55 # spacing between letters
115
  blink = image
116
+ cv2.imwrite(Path(output_dir / "blink.png").as_posix(), blink)
117
  for i in range(0, len(text) - 1):
118
 
119
  text_vid.write(blink)
 
131
  print(org)
132
 
133
  # Displaying the image
134
+ cv2.imwrite(Path(output_dir / f"text_im{i}.png").as_posix, image)
135
 
136
  # Complile to video
137
  text_vid.write(image)