2026-05-18-20-35-32 修复结果视频关键帧空白
This commit is contained in:
@@ -78,9 +78,18 @@ def test_segment_video_and_compare_frame(tmp_path: Path):
|
||||
assert result_capture.isOpened()
|
||||
result_frames = int(result_capture.get(cv2.CAP_PROP_FRAME_COUNT) or 0)
|
||||
result_fps = float(result_capture.get(cv2.CAP_PROP_FPS) or 0)
|
||||
result_capture.set(cv2.CAP_PROP_POS_FRAMES, 1)
|
||||
ok, carried_overlay = result_capture.read()
|
||||
result_capture.release()
|
||||
assert result_frames == 18
|
||||
assert abs((result_frames / result_fps) - payload["duration"]) < 0.25
|
||||
assert ok
|
||||
yellow_pixels = (
|
||||
(carried_overlay[:, :, 1] > 140)
|
||||
& (carried_overlay[:, :, 2] > 140)
|
||||
& (carried_overlay[:, :, 0] < 150)
|
||||
).sum()
|
||||
assert yellow_pixels > 0
|
||||
|
||||
with video_path.open("rb") as handle:
|
||||
compare = client.post(
|
||||
|
||||
Reference in New Issue
Block a user