Skip to content

Commit

Permalink
Addressed comment:
Browse files Browse the repository at this point in the history
  • Loading branch information
Krish Patel committed Jun 20, 2023
1 parent 00fb7d6 commit 84a5162
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions openadapt/scripts/scrub.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Module for scrubbing a media file.
Usage: python -m openadapt.scripts.scrub <media_file_path>
Usage:
$ python -m openadapt.scripts.scrub scrub_mp4 <mp4_file_path>
"""

Expand All @@ -10,9 +11,10 @@
from loguru import logger
from PIL import Image
import cv2
import fire
import numpy as np

from openadapt import scrub
from openadapt import scrub, utils


def scrub_mp4(mp4_file: str) -> str:
Expand Down Expand Up @@ -84,20 +86,4 @@ def scrub_media_file(media_file_path: str) -> str:


if __name__ == "__main__":
if (
len(sys.argv) < 2
or len(sys.argv) > 2
or sys.argv[1] == "-h"
or sys.argv[1] == "--help"
):
logger.info(
"Usage: python -m openadapt.scripts.scrub <video_file_path>"
)
sys.exit(1)

scrubbed_file_path = scrub_media_file(sys.argv[1])

if scrubbed_file_path:
logger.info(f"Scrubbed media file saved at: {scrubbed_file_path}")
else:
logger.info("Failed to scrub the media file.")
fire.Fire(utils.get_functions(__name__))

0 comments on commit 84a5162

Please sign in to comment.