Spaces:
Runtime error
Runtime error
unknown
commited on
Commit
·
d71c9fa
1
Parent(s):
3cb7b20
cuda
Browse files
app.py
CHANGED
|
@@ -140,10 +140,10 @@ class FoleyController:
|
|
| 140 |
seed_textbox,
|
| 141 |
):
|
| 142 |
# move to gpu
|
| 143 |
-
self.time_detector
|
| 144 |
-
self.pipeline
|
| 145 |
-
self.vocoder
|
| 146 |
-
self.image_encoder
|
| 147 |
|
| 148 |
vision_transform_list = [
|
| 149 |
torchvision.transforms.Resize((128, 128)),
|
|
@@ -161,7 +161,7 @@ class FoleyController:
|
|
| 161 |
frames, duration = read_frames_with_moviepy(input_video, max_frame_nums=max_frame_nums)
|
| 162 |
if duration >= 10:
|
| 163 |
duration = 10
|
| 164 |
-
time_frames = torch.FloatTensor(frames).permute(0, 3, 1, 2)
|
| 165 |
time_frames = video_transform(time_frames)
|
| 166 |
time_frames = {'frames': time_frames.unsqueeze(0).permute(0, 2, 1, 3, 4)}
|
| 167 |
preds = self.time_detector(time_frames)
|
|
|
|
| 140 |
seed_textbox,
|
| 141 |
):
|
| 142 |
# move to gpu
|
| 143 |
+
self.time_detector.to(self.device)
|
| 144 |
+
self.pipeline.to(self.device)
|
| 145 |
+
self.vocoder.to(self.device)
|
| 146 |
+
self.image_encoder.to(self.device)
|
| 147 |
|
| 148 |
vision_transform_list = [
|
| 149 |
torchvision.transforms.Resize((128, 128)),
|
|
|
|
| 161 |
frames, duration = read_frames_with_moviepy(input_video, max_frame_nums=max_frame_nums)
|
| 162 |
if duration >= 10:
|
| 163 |
duration = 10
|
| 164 |
+
time_frames = torch.FloatTensor(frames).permute(0, 3, 1, 2).to(self.device)
|
| 165 |
time_frames = video_transform(time_frames)
|
| 166 |
time_frames = {'frames': time_frames.unsqueeze(0).permute(0, 2, 1, 3, 4)}
|
| 167 |
preds = self.time_detector(time_frames)
|