Skip to content

Commit c402963

Browse files
committed
Add inference tests for RF-DETR+ XLarge and 2XLarge models with parameterized resolutions
1 parent 4211494 commit c402963

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/test_version.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@
88
import numpy as np
99
import pytest
1010

11-
from rfdetr_plus import RFDETRXLarge
11+
from rfdetr_plus import RFDETR2XLarge, RFDETRXLarge
1212

1313

1414
@pytest.mark.gpu
15-
def test_model_inference() -> None:
16-
"""Test that we can instantiate RF-DETR+ XLarge and run inference."""
15+
@pytest.mark.parametrize(
16+
("model_class", "resolution"),
17+
[
18+
(RFDETRXLarge, 700),
19+
(RFDETR2XLarge, 880),
20+
],
21+
)
22+
def test_model_inference(model_class, resolution) -> None:
23+
"""Test that we can instantiate RF-DETR+ models and run inference."""
1724
# Instantiate and run inference
18-
rf_detr = RFDETRXLarge()
19-
dummy_image = np.random.randint(0, 255, (700, 700, 3), dtype=np.uint8)
25+
rf_detr = model_class()
26+
dummy_image = np.random.randint(0, 255, (resolution, resolution, 3), dtype=np.uint8)
2027

2128
# Run inference - this verifies the model can be instantiated and used
2229
predictions = rf_detr.predict(dummy_image, conf_threshold=0.1)

0 commit comments

Comments
 (0)