Skip to content
Snippets Groups Projects
Commit 7be02653 authored by Hussain Kanafani's avatar Hussain Kanafani
Browse files

abstract base class add, code refactored and imports modified

parent 569719e0
No related branches found
No related tags found
No related merge requests found
from moviepy.editor import VideoFileClip
import abc
import os
class BaseVideoClip(VideoFileClip, abc.ABC):
def __init__(self, video_name, video_path, gt_base_dir):
self.video_clip = VideoFileClip(video_path)
self.fps = int(self.video_clip.fps)
self.duration = int(self.video_clip.duration)
self.gt_path = os.path.join(gt_base_dir, video_name)
self.video_name = video_name
self.n_frames = self.video_clip.reader.infos['video_nframes']
@abc.abstractmethod
def get_gt(self):
pass
def get_frames(self):
return list(self.video_clip.iter_frames(with_times=False))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment