Open JD-2006 opened 11 months ago
Adding a progress bar that is more accurate and informative than the gradio one.
from tqdm import tqdm # Import tqdm # Process each frame with tqdm total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) for _ in tqdm(range(total_frames), desc="Processing Frames", unit="frames"): ret, frame = cap.read() if not ret: break with torch.no_grad(): outputs = predictor(frame)['instances'] results = DensePoseResultExtractor()(outputs) cmap = cv2.COLORMAP_VIRIDIS arr = cv2.applyColorMap(np.zeros((height, width), dtype=np.uint8), cmap) out_frame = Visualizer(alpha=1, cmap=cmap).visualize(arr, results) out.write(out_frame)
``
Hi @JD-2006,
Thanks for the suggestion. Please feel free to open a Pull Request with this feature and we will be happy to evaluate and merge it!
Cheers! Will do.
Adding a progress bar that is more accurate and informative than the gradio one.
``