add passthrough editor

This commit is contained in:
Tanishq Dubey 2023-03-17 22:35:06 -04:00
parent 174a828988
commit d83aeba336
3 changed files with 19 additions and 1 deletions

View File

@ -14,13 +14,14 @@ check_ffmpeg()
from src.editors.amplitude.editor import AmplitudeEditor
from src.editors.sentiment.editor import SentimentEditor
from src.editors.passthrough.editor import PassthroughEditor
from src.math.cost import quadratic_loss
from src.mediautils.audio import extract_audio_from_video
from src.mediautils.video import render_moments
log = structlog.get_logger()
EDITORS = {"amplitude": AmplitudeEditor, "sentiment": SentimentEditor}
EDITORS = {"amplitude": AmplitudeEditor, "sentiment": SentimentEditor, "passthrough": PassthroughEditor}
ERROR_FUNCS = {"quadratic": quadratic_loss}
@ -158,6 +159,11 @@ if __name__ == "__main__":
choices=["base", "tiny", "small", "medium", "large"],
)
parser_passthrough = subparsers.add_parser(
"passthrough",
help="The passthrough editor simply cuts the video to the target length provided",
)
parser.add_argument(
"-p",
"--parallelism",

View File

View File

@ -0,0 +1,12 @@
from ...models.moment import Moment
class PassthroughEditor:
def __init__(self, video_path, audio_path, params):
pass
def edit(self, large_window, small_window, params):
pass
def full_edit(self, costfunc, desired_time, params):
return [Moment(0, desired_time)]