MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / __next__

Method __next__

slowfast/visualization/demo_loader.py:268–293  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 self.write_queue[task.id] = (was_read, copy.deepcopy(task))
267
268 def __next__(self):
269 # If there is nothing in the task queue.
270 if self.read_queue.qsize() == 0:
271 return self.not_end, None
272 else:
273 with self.put_id_lock:
274 put_id = self.put_id
275 was_read, task = None, None
276 # If mode is to predict most recent read clip.
277 if self.num_skip == 0:
278 # Write all previous clips to write queue.
279 with self.write_lock:
280 while True:
281 was_read, task = self.read_queue.get()
282 if task.id == put_id:
283 break
284 self.write_queue[task.id] = (was_read, task)
285 else:
286 was_read, task = self.read_queue.get()
287 # If we reach the end of the video.
288 if not was_read:
289 # Put to write queue.
290 with self.write_lock:
291 self.write_queue[put_id] = was_read, copy.deepcopy(task)
292 task = None
293 return was_read, task
294
295 def get_fn(self):
296 while not self.stopped:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected