openfree commited on
Commit
9c496af
Β·
verified Β·
1 Parent(s): 8e99715

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -52,12 +52,6 @@ from moviepy import (
52
  )
53
 
54
 
55
- from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
56
- from moviepy.video.VideoClip import ColorClip
57
- # ────────────────────────────────────────────────────────────
58
-
59
- import time
60
- from concurrent.futures import ThreadPoolExecutor
61
  # λΉ„λ””μ˜€ 배경제거 κ΄€λ ¨ import
62
  from transformers import AutoModelForImageSegmentation
63
  from torchvision import transforms
@@ -69,7 +63,8 @@ try:
69
  except ImportError:
70
  from moviepy import VideoFileClip, concatenate_videoclips
71
 
72
- import moviepy.video.fx.all as vfx # 효과 ν•¨μˆ˜ (resize λ“±)
 
73
 
74
  from moviepy import (
75
  ImageSequenceClip, # 이미지 μ‹œν€€μŠ€ β†’ λΉ„λ””μ˜€
@@ -86,7 +81,6 @@ from concurrent.futures import ThreadPoolExecutor
86
 
87
 
88
 
89
-
90
  # ν™˜κ²½ λ³€μˆ˜ μ„€μ •μœΌλ‘œ torch.load 체크 우회 (μž„μ‹œ ν•΄κ²°μ±…)
91
  os.environ["TRANSFORMERS_ALLOW_UNSAFE_DESERIALIZATION"] = "1"
92
 
@@ -705,7 +699,8 @@ def merge_videos_with_audio(video_files, audio_file, audio_volume, output_fps):
705
  adjusted_clips = []
706
  for clip, size in zip(video_clips, clip_sizes):
707
  if size != (target_width, target_height):
708
- adjusted_clip = vfx.resize(clip, newsize=(target_width, target_height))
 
709
 
710
  adjusted_clips.append(adjusted_clip)
711
  else:
 
52
  )
53
 
54
 
 
 
 
 
 
 
55
  # λΉ„λ””μ˜€ 배경제거 κ΄€λ ¨ import
56
  from transformers import AutoModelForImageSegmentation
57
  from torchvision import transforms
 
63
  except ImportError:
64
  from moviepy import VideoFileClip, concatenate_videoclips
65
 
66
+ # resize 효과 ν•¨μˆ˜λ₯Ό 직접 μž„ν¬νŠΈ ─ κ²½λŸ‰ μ„€μΉ˜μ—μ„œλ„ 쑴재
67
+ from moviepy.video.fx.resize import resize as mp_resize
68
 
69
  from moviepy import (
70
  ImageSequenceClip, # 이미지 μ‹œν€€μŠ€ β†’ λΉ„λ””μ˜€
 
81
 
82
 
83
 
 
84
  # ν™˜κ²½ λ³€μˆ˜ μ„€μ •μœΌλ‘œ torch.load 체크 우회 (μž„μ‹œ ν•΄κ²°μ±…)
85
  os.environ["TRANSFORMERS_ALLOW_UNSAFE_DESERIALIZATION"] = "1"
86
 
 
699
  adjusted_clips = []
700
  for clip, size in zip(video_clips, clip_sizes):
701
  if size != (target_width, target_height):
702
+
703
+ adjusted_clip = mp_resize(clip, newsize=(target_width, target_height))
704
 
705
  adjusted_clips.append(adjusted_clip)
706
  else: