Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jirka Borovec <[email protected]>
  • Loading branch information
ethanwharris and Borda authored Jan 18, 2022
1 parent 43b477a commit 28d2b8e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions flash/video/classification/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def from_folders(
>>> os.makedirs(os.path.join("train_folder", "cat"), exist_ok=True)
>>> os.makedirs(os.path.join("train_folder", "dog"), exist_ok=True)
>>> os.makedirs("predict_folder", exist_ok=True)
>>> io.write_video(os.path.join("train_folder", "cat", "video_1.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "dog", "video_2.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "cat", "video_3.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> _ = [io.write_video(
... os.path.join("train_folder", label, f"video_{i + 1}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
... ) for i, label in enumerate(["cat", "dog", "cat"])]
>>> _ = [
... io.write_video(
... os.path.join("predict_folder", f"predict_video_{i}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
Expand Down Expand Up @@ -425,9 +425,9 @@ def from_data_frame(
>>> data = torch.randint(255, (10, 64, 64, 3))
>>> os.makedirs("train_folder", exist_ok=True)
>>> os.makedirs("predict_folder", exist_ok=True)
>>> io.write_video(os.path.join("train_folder", "video_1.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "video_2.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "video_3.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> _ = [io.write_video(
... os.path.join("train_folder", f"video_{i}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
... ) for i in range(1, 4)]
>>> _ = [
... io.write_video(
... os.path.join("predict_folder", f"predict_video_{i}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
Expand Down Expand Up @@ -598,9 +598,9 @@ def from_csv(
>>> data = torch.randint(255, (10, 64, 64, 3))
>>> os.makedirs("train_folder", exist_ok=True)
>>> os.makedirs("predict_folder", exist_ok=True)
>>> io.write_video(os.path.join("train_folder", "video_1.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "video_2.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> io.write_video(os.path.join("train_folder", "video_3.mp4"), data, 5, "libx264rgb", {"crf": "0"})
>>> _ = [io.write_video(
... os.path.join("train_folder", f"video_{i}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
... ) for i in range(1, 4)]
>>> _ = [
... io.write_video(
... os.path.join("predict_folder", f"predict_video_{i}.mp4"), data, 5, "libx264rgb", {"crf": "0"}
Expand Down

0 comments on commit 28d2b8e

Please sign in to comment.