videopython 0.33.5__tar.gz → 0.34.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {videopython-0.33.5 → videopython-0.34.1}/PKG-INFO +1 -1
- {videopython-0.33.5 → videopython-0.34.1}/pyproject.toml +1 -1
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/transforms.py +24 -8
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/image_text.py +400 -130
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/__init__.py +3 -1
- videopython-0.34.1/src/videopython/editing/transcription_overlay.py +527 -0
- videopython-0.33.5/src/videopython/editing/transcription_overlay.py +0 -186
- {videopython-0.33.5 → videopython-0.34.1}/.gitignore +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/LICENSE +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/README.md +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/_device.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/config.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/dubber.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/expressiveness.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/loudness.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/models.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/pipeline.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/quality.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/remux.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/timing.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/voice_sample.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/audio.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/image.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/qwen3.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/translation.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/video.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/audio.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/faces.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/image.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/separation.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/temporal.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/analyzer.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/models.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/sampling.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/stages.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/analysis.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/audio.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_dimensions.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_ffmpeg.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_video_io.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/description.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/exceptions.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/DejaVuSans.ttf +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/LICENSE_DEJAVU +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/__init__.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/transcription.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/video.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/effects.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/operation.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/streaming.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/transforms.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/video_edit.py +0 -0
- {videopython-0.33.5 → videopython-0.34.1}/src/videopython/py.typed +0 -0
|
@@ -12,7 +12,7 @@ from tqdm import tqdm
|
|
|
12
12
|
|
|
13
13
|
from videopython.ai.understanding.faces import FaceTracker
|
|
14
14
|
from videopython.base._dimensions import floor_to_even
|
|
15
|
-
from videopython.base.video import Video
|
|
15
|
+
from videopython.base.video import Video, VideoMetadata
|
|
16
16
|
from videopython.editing.operation import OpCategory, Operation
|
|
17
17
|
|
|
18
18
|
logger = logging.getLogger(__name__)
|
|
@@ -76,6 +76,28 @@ class FaceTrackingCrop(Operation):
|
|
|
76
76
|
# "dynamic" — placeholder until motion/look-direction framing is implemented.
|
|
77
77
|
return (face_cx, face_cy - self.headroom)
|
|
78
78
|
|
|
79
|
+
def _resolved_output_dims(self, w: int, h: int) -> tuple[int, int]:
|
|
80
|
+
"""Output ``(width, height)`` after the crop + resize.
|
|
81
|
+
|
|
82
|
+
Every frame is resized to this size regardless of the per-frame face
|
|
83
|
+
position, so it is a pure function of the input dimensions and
|
|
84
|
+
``target_aspect``. Single source of truth shared by :meth:`apply` and
|
|
85
|
+
:meth:`predict_metadata` (mirrors ``Resize._resolve_dims`` /
|
|
86
|
+
``Crop._resolve_box``), so the dry-run cannot disagree with the render.
|
|
87
|
+
"""
|
|
88
|
+
target_ratio = self.target_aspect[0] / self.target_aspect[1]
|
|
89
|
+
if target_ratio < w / h:
|
|
90
|
+
out_h = floor_to_even(h)
|
|
91
|
+
out_w = floor_to_even(int(out_h * target_ratio))
|
|
92
|
+
else:
|
|
93
|
+
out_w = floor_to_even(w)
|
|
94
|
+
out_h = floor_to_even(int(out_w / target_ratio))
|
|
95
|
+
return out_w, out_h
|
|
96
|
+
|
|
97
|
+
def predict_metadata(self, meta: VideoMetadata) -> VideoMetadata:
|
|
98
|
+
out_w, out_h = self._resolved_output_dims(meta.width, meta.height)
|
|
99
|
+
return meta.with_dimensions(out_w, out_h)
|
|
100
|
+
|
|
79
101
|
def _clamp_speed(self, current: tuple[float, float], target: tuple[float, float]) -> tuple[float, float]:
|
|
80
102
|
if self.max_speed is None:
|
|
81
103
|
return target
|
|
@@ -135,13 +157,7 @@ class FaceTrackingCrop(Operation):
|
|
|
135
157
|
)
|
|
136
158
|
|
|
137
159
|
h, w = video.frame_shape[:2]
|
|
138
|
-
|
|
139
|
-
if target_ratio < w / h:
|
|
140
|
-
out_h = floor_to_even(h)
|
|
141
|
-
out_w = floor_to_even(int(out_h * target_ratio))
|
|
142
|
-
else:
|
|
143
|
-
out_w = floor_to_even(w)
|
|
144
|
-
out_h = floor_to_even(int(out_w / target_ratio))
|
|
160
|
+
out_w, out_h = self._resolved_output_dims(w, h)
|
|
145
161
|
|
|
146
162
|
default_x = (w - out_w) // 2
|
|
147
163
|
default_y = (h - out_h) // 2
|