Skip to content

Conversation

catsmells
Copy link

Description

Added visualize_predictions.py to the RF-DETR repository (https://github.com/roboflow/rf-detr/tree/develop/rfdetr) to enable visualization of model predictions on sample images, improving user onboarding and debugging. The script loads a pre-trained RF-DETR model, runs inference on images in a specified directory, and saves annotated outputs with bounding boxes and labels using supervision. Motivation: enhance usability for developers testing RF-DETR performance. Dependencies: numpy, opencv-python, supervision, pillow, rfdetr.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

Tested by running python visualize_predictions.py --weights path/to/weights.pth --input-dir sample_images --output-dir output --confidence 0.5 with a COCO sample dataset. Verified annotated images in the output directory displayed correct bounding boxes and labels for detected objects.

Any specific deployment considerations

Requires pre-trained RF-DETR model weights and a directory with supported image formats (.jpg, .jpeg, .png). No additional costs or secrets required.

Docs

  • Docs updated? What were the changes:
    Added section for visualize_predictions.py, detailing usage, command-line arguments (--weights, --input-dir, --output-dir, --confidence), and example command: python visualize_predictions.py --weights weights.pth --input-dir images/ --output-dir output/.

I have read the CLA Document and I sign the CLA.

Adding testing visualizer.
@CLAassistant
Copy link

CLAassistant commented Sep 7, 2025

CLA assistant check
All committers have signed the CLA.

@catsmells
Copy link
Author

I have read the CLA Document and I sign the CLA.

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

Successfully merging this pull request may close these issues.

2 participants