MCPcopy
hub / github.com/OpenMotionLab/MotionGPT / pool_job_with_desc

Function pool_job_with_desc

mGPT/render/visualize.py:263–280  ·  view source on GitHub ↗
(pool, iterator, desc, max_, save_path_format, isij)

Source from the content-addressed store, hash-verified

261 import multiprocessing
262
263 def pool_job_with_desc(pool, iterator, desc, max_, save_path_format, isij):
264 with tqdm(total=max_, desc=desc.format("Render")) as pbar:
265 for data in iterator:
266 plot_3d_motion_dico(data)
267 # for _ in pool.imap_unordered(plot_3d_motion_dico, iterator):
268 # pbar.update()
269 if isij:
270 array = np.stack([[
271 load_anim(save_path_format.format(i, j), timesize)
272 for j in range(nats)
273 ] for i in tqdm(range(nspa), desc=desc.format("Load"))])
274 return array.transpose(2, 0, 1, 3, 4, 5)
275 else:
276 array = np.stack([
277 load_anim(save_path_format.format(i), timesize)
278 for i in tqdm(range(nats), desc=desc.format("Load"))
279 ])
280 return array.transpose(1, 0, 2, 3, 4)
281
282 pool = None
283 # if True:

Callers 2

generate_by_videoFunction · 0.85

Calls 2

plot_3d_motion_dicoFunction · 0.85
load_animFunction · 0.85

Tested by

no test coverage detected