Download bench_builder/video_source_plugins/base.py from CharlieDreemur/Recreate-AAA: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/CharlieDreemur/Recreate-AAA/resolve/main/bench_builder/video_source_plugins/base.py
- Command line
-
hf download hf://CharlieDreemur/Recreate-AAA/bench_builder/video_source_plugins/base.py
-
curl -L -o base.py https://huggingface.co/CharlieDreemur/Recreate-AAA/resolve/main/bench_builder/video_source_plugins/base.py
2.36 kB
| """Public contract for gameplay-video source plugins.""" | |
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from pathlib import Path | |
| from typing import Any, Mapping, Protocol | |
| from bench_builder.video_plugin_options import PluginOptionSpec | |
| class VideoSourcePluginError(RuntimeError): | |
| """Raised when a source cannot be opened or clipped.""" | |
| class VideoSourceInput: | |
| kind: str | |
| url: str = "" | |
| path: Path | None = None | |
| filename: str = "" | |
| class VideoSourcePluginDescriptor: | |
| plugin_id: str | |
| display_name: str | |
| input_kinds: tuple[str, ...] | |
| options: tuple[PluginOptionSpec, ...] = () | |
| class VideoSourceCapability: | |
| ready: bool | |
| reason: str | |
| remote_preview: bool = False | |
| selected_range: bool = True | |
| class ResolvedVideo: | |
| plugin_id: str | |
| source: VideoSourceInput | |
| title: str | |
| duration_seconds: float | |
| preview_source: str | Path | |
| metadata: Mapping[str, Any] = field(default_factory=dict) | |
| class VideoClipSelection: | |
| start_seconds: float | |
| end_seconds: float | |
| def duration_seconds(self) -> float: | |
| return self.end_seconds - self.start_seconds | |
| class VideoClipArtifact: | |
| plugin_id: str | |
| path: Path | |
| start_seconds: float | |
| end_seconds: float | |
| duration_seconds: float | |
| class VideoSourcePlugin(Protocol): | |
| descriptor: VideoSourcePluginDescriptor | |
| def validate_options( | |
| self, options: Mapping[str, Any] | None | |
| ) -> dict[str, Any]: ... | |
| def supports(self, source: VideoSourceInput) -> bool: ... | |
| def probe( | |
| self, source: VideoSourceInput, options: Mapping[str, Any] | |
| ) -> VideoSourceCapability: ... | |
| def resolve( | |
| self, source: VideoSourceInput, options: Mapping[str, Any] | |
| ) -> ResolvedVideo: ... | |
| def materialize_clip( | |
| self, | |
| video: ResolvedVideo, | |
| selection: VideoClipSelection, | |
| destination: Path, | |
| options: Mapping[str, Any], | |
| ) -> VideoClipArtifact: ... | |
| __all__ = [ | |
| "ResolvedVideo", | |
| "VideoClipArtifact", | |
| "VideoClipSelection", | |
| "VideoSourceCapability", | |
| "VideoSourceInput", | |
| "VideoSourcePlugin", | |
| "VideoSourcePluginDescriptor", | |
| "VideoSourcePluginError", | |
| ] | |