MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / count_frames

Function count_frames

examples/WanVSR/infer_flashvsr_tiny.py:128–139  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

126 fps = int(round(fps_val)) if isinstance(fps_val, (int, float)) else 30
127
128 def count_frames(r):
129 try:
130 nf = meta.get('nframes', None)
131 if isinstance(nf,int) and nf>0: return nf
132 except Exception: pass
133 try: return r.count_frames()
134 except Exception:
135 n=0
136 try:
137 while True: r.get_data(n); n+=1
138 except Exception:
139 return n
140
141 total = count_frames(rdr)
142 if total <= 0:

Callers 1

prepare_input_tensorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected