Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Feature Suggestion ] Adding tqdm progress bar for more accurate completion time #15

Open
JD-2006 opened this issue Dec 9, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@JD-2006
Copy link

JD-2006 commented Dec 9, 2023

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)

ProgressBar
``

@tadeodonegana
Copy link
Member

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!

@tadeodonegana tadeodonegana self-assigned this Dec 9, 2023
@tadeodonegana tadeodonegana added the enhancement New feature or request label Dec 9, 2023
@JD-2006
Copy link
Author

JD-2006 commented Dec 10, 2023

Cheers! Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants