Skip to content

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

@JD-2006

Description

@JD-2006

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
``

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions