mirror of
https://github.com/maciej3031/comixify.git
synced 2026-03-11 08:54:35 +00:00
Fix temp folder deletion (#12)
This commit is contained in:
parent
6a2be40ea0
commit
8c627690f1
2 changed files with 7 additions and 4 deletions
|
|
@ -35,9 +35,11 @@ class Video(models.Model):
|
|||
raise TooLargeFile()
|
||||
|
||||
def create_comic(self, frames_mode=0, rl_mode=0):
|
||||
keyframes, keyframes_extraction_time = KeyFramesExtractor.get_keyframes(video=self,
|
||||
frames_mode=frames_mode,
|
||||
rl_mode=rl_mode)
|
||||
keyframes, keyframes_extraction_time = KeyFramesExtractor.get_keyframes(
|
||||
video=self,
|
||||
frames_mode=frames_mode,
|
||||
rl_mode=rl_mode
|
||||
)
|
||||
stylized_keyframes, stylization_time = StyleTransfer.get_stylized_frames(frames=keyframes)
|
||||
comic_image, layout_generation_time = LayoutGenerator.get_layout(frames=stylized_keyframes)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import uuid
|
||||
|
||||
import shutil
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
|
@ -37,6 +37,7 @@ class KeyFramesExtractor:
|
|||
probs = cls._get_probs(norm_features, gpu, mode=rl_mode)
|
||||
keyframes = cls._get_keyframes(frames, probs, change_points, frames_per_segment)
|
||||
chosen_frames = cls._get_popularity_chosen_frames(keyframes, features)
|
||||
shutil.rmtree(jj(f"{settings.TMP_DIR}", f"{all_frames_tmp_dir}"))
|
||||
return chosen_frames
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Reference in a new issue