Skip to content

Commit

Permalink
Consistent newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Jun 27, 2024
1 parent 2a35629 commit a9ee83b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/basic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,25 @@
my_path = os.path.abspath(inspect.getfile(inspect.currentframe()))
video_file_path = os.path.dirname(my_path) + "/../test/resources/nasa_13013.mp4"
simple_decoder = SimpleVideoDecoder(video_file_path)

# %%
# You can get the total frame count for the best video stream by calling len().

num_frames = len(simple_decoder)
print(f"{video_file_path=} has {num_frames} frames")

# %%
# You can get the decoded frame by using the subscript operator.

first_frame = simple_decoder[0]
print(f"decoded frame has type {type(first_frame)}")

# %%
# The shape of the decoded frame is (H, W, C) where H and W are the height
# and width of the video frame. C is 3 because we have 3 channels red, green,
# and blue.

print(f"{first_frame.shape=}")

# %%
# The dtype of the decoded frame is ``torch.uint8``.

print(f"{first_frame.dtype=}")

# %%
Expand Down

0 comments on commit a9ee83b

Please sign in to comment.