mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
model replay: less frames and less complexity (#35427)
* Revert "ci: faster model_replay (#34036)"
This reverts commit 847a5ce1f3.
* fix conflict
* trigger on test change
* zst
* give start and end frame
* unused flags
* no print
* whitespace
* fix plotting
* slice correct
* no print
* Just start from beginning
This commit is contained in:
@@ -535,25 +535,3 @@ def FrameIterator(fn, pix_fmt, **kwargs):
|
||||
else:
|
||||
for i in range(fr.frame_count):
|
||||
yield fr.get(i, pix_fmt=pix_fmt)[0]
|
||||
|
||||
|
||||
class NumpyFrameReader:
|
||||
def __init__(self, name, w, h, cache_size):
|
||||
self.name = name
|
||||
self.pos = -1
|
||||
self.frames = None
|
||||
self.w = w
|
||||
self.h = h
|
||||
self.cache_size = cache_size
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def get(self, num, count=1, pix_fmt="nv12"):
|
||||
num -= 1
|
||||
q = num // self.cache_size
|
||||
if q != self.pos:
|
||||
del self.frames
|
||||
self.pos = q
|
||||
self.frames = np.load(f'{self.name}_{self.pos}.npy')
|
||||
return [self.frames[num % self.cache_size]]
|
||||
|
||||
Reference in New Issue
Block a user