fix: 修复帧率限制实现错误的问题

This commit is contained in:
yuyuyzl committed 2026-02-08 23:29:44 +08:00
1 parent 0d4907c4d6
commit 034652338f
4 files changed
+10 -1

No files matched your search

+1
View File
@@ -51,6 +51,7 @@ parser.add_argument('--eyebrow', action='store_true')
parser.add_argument('--use_interpolation', action='store_true')
parser.add_argument('--interpolation_scale', type=int, default=1)
parser.add_argument('--interpolation_half', action='store_true')
parser.add_argument('--mark_interpolated', action='store_true', help='在插值帧左上角打红点便于确认补帧输出')
parser.add_argument('--use_sr', action='store_true')
parser.add_argument('--sr_x4', action='store_true')
+4
View File
@@ -111,9 +111,13 @@ def main():
else:
cv2.imshow("EasyVtuber Debug Frame", np_ret_shms[i])
cv2.waitKey(1)
# 限速:若 last_time 落后于当前时间则对齐到 now,避免开局成坨送帧
wait_until(last_time + interval)
last_time += interval
now = time.perf_counter()
if last_time < now:
last_time = now
ret_batch_shm_channels[i].release()
print("Infer Process FPS: {:.2f}, Input FPS: {:.2f}, Model Avg Interval: {:.2f} ms, Cache Hit Ratio: {:.2f}%, GPU Cache Hit Ratio: {:.2f}%, Output Pipeline FPS {:.5f}".format(
infer_process.pipeline_fps_number.value,
+4
View File
@@ -1,4 +1,5 @@
import math
import os
from multiprocessing import Process, Value, shared_memory, Event
import cv2
import numpy as np
@@ -32,6 +33,9 @@ class ModelClientProcess(Process):
self.finish_event = Event()
def run(self):
# 插值帧红点标记:由 --mark_interpolated 控制,供 ezvtb_rt 读取
if getattr(args, 'mark_interpolated', False):
os.environ['EZVTB_MARK_INTERPOLATED'] = '1'
pose_position_shm_guard = SharedMemoryGuard(self.pose_position_shm, ctrl_name="pose_position_shm_ctrl")
np_pose_shm = np.ndarray((45,), dtype=np.float32, buffer=self.pose_position_shm.buf[:45 * 4])
np_position_shm = np.ndarray((4,), dtype=np.float32, buffer=self.pose_position_shm.buf[45 * 4:45 * 4 + 4 * 4])