Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Unsupervised Video Summarization
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hussain Kanafani
Unsupervised Video Summarization
Commits
7be02653
Commit
7be02653
authored
4 years ago
by
Hussain Kanafani
Browse files
Options
Downloads
Patches
Plain Diff
abstract base class add, code refactored and imports modified
parent
569719e0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/BaseVideoClip.py
+20
-0
20 additions, 0 deletions
src/BaseVideoClip.py
with
20 additions
and
0 deletions
src/BaseVideoClip.py
0 → 100644
+
20
−
0
View file @
7be02653
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
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment