Skip to content

Commit

Permalink
[torchcodec]Remove usage of cv2 in smoke_test
Browse files Browse the repository at this point in the history
Summary: The smoke test relies on cv2. But in conda its not pre-installed. Use torchvision instead.

Reviewed By: NicolasHug

Differential Revision: D58980922

fbshipit-source-id: 7a71d4b555c6f6330af4ec3add207871a7a3bc01
  • Loading branch information
kaiyuey authored and facebook-github-bot committed Jun 25, 2024
1 parent 5717599 commit d024e7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/decoders/manual_smoke_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import cv2
import torchcodec
from torchvision.io.image import write_png

decoder = torchcodec.decoders._core.create_from_file(
os.path.dirname(__file__) + "/../resources/nasa_13013.mp4"
Expand All @@ -10,5 +10,5 @@
frame = torchcodec.decoders._core.get_frame_at_index(
decoder, stream_index=3, frame_index=180
)

cv2.imwrite("frame180.png", frame.numpy())
frame = frame.permute(2, 0, 1)
write_png(frame, "frame180.png")

0 comments on commit d024e7b

Please sign in to comment.