mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 11:09:59 +00:00
chore(fromat): formatting code
This commit is contained in:
@@ -37,11 +37,12 @@ import torchvision
|
|||||||
from datasets.features.features import register_feature
|
from datasets.features.features import register_feature
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
from lerobot.utils.import_utils import get_safe_default_video_backend
|
||||||
|
|
||||||
from .pyav_utils import (
|
from .pyav_utils import (
|
||||||
check_video_encoder_config_pyav,
|
check_video_encoder_config_pyav,
|
||||||
detect_available_encoders_pyav,
|
detect_available_encoders_pyav,
|
||||||
)
|
)
|
||||||
from lerobot.utils.import_utils import get_safe_default_video_backend
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -478,7 +478,9 @@ class TestConcatenateVideoFiles:
|
|||||||
def test_two_clips_frame_count(self, tmp_path):
|
def test_two_clips_frame_count(self, tmp_path):
|
||||||
"""Output frame count equals the sum of the two input frame counts."""
|
"""Output frame count equals the sum of the two input frame counts."""
|
||||||
out = tmp_path / "out.mp4"
|
out = tmp_path / "out.mp4"
|
||||||
concatenate_video_files([TEST_ARTIFACTS_DIR / "clip_6frames.mp4", TEST_ARTIFACTS_DIR / "clip_4frames.mp4"], out)
|
concatenate_video_files(
|
||||||
|
[TEST_ARTIFACTS_DIR / "clip_6frames.mp4", TEST_ARTIFACTS_DIR / "clip_4frames.mp4"], out
|
||||||
|
)
|
||||||
|
|
||||||
with av.open(str(out)) as container:
|
with av.open(str(out)) as container:
|
||||||
total = sum(1 for _ in container.decode(video=0))
|
total = sum(1 for _ in container.decode(video=0))
|
||||||
@@ -497,7 +499,9 @@ class TestConcatenateVideoFiles:
|
|||||||
def test_geometry_preserved(self, tmp_path):
|
def test_geometry_preserved(self, tmp_path):
|
||||||
"""Output resolution, fps, codec and pixel format must match the inputs."""
|
"""Output resolution, fps, codec and pixel format must match the inputs."""
|
||||||
out = tmp_path / "out.mp4"
|
out = tmp_path / "out.mp4"
|
||||||
concatenate_video_files([TEST_ARTIFACTS_DIR / "clip_4frames.mp4", TEST_ARTIFACTS_DIR / "clip_4frames.mp4"], out)
|
concatenate_video_files(
|
||||||
|
[TEST_ARTIFACTS_DIR / "clip_4frames.mp4", TEST_ARTIFACTS_DIR / "clip_4frames.mp4"], out
|
||||||
|
)
|
||||||
|
|
||||||
info = get_video_info(out)
|
info = get_video_info(out)
|
||||||
assert info["video.height"] == 64
|
assert info["video.height"] == 64
|
||||||
|
|||||||
Reference in New Issue
Block a user