Skip to content

Commit

Permalink
Make linters happpy
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelPeczek-Roboflow committed Nov 1, 2024
1 parent 7997a98 commit 1e5774e
Showing 1 changed file with 41 additions and 7 deletions.
48 changes: 41 additions & 7 deletions tests/inference/models_predictions_tests/test_owlv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ def test_owlv2():
{
"image": image,
"boxes": [
{"x": 223, "y": 306, "w": 40, "h": 226, "cls": "post", "negative": False},
{
"x": 223,
"y": 306,
"w": 40,
"h": 226,
"cls": "post",
"negative": False,
},
],
}
],
Expand All @@ -42,17 +49,37 @@ def test_owlv2():
assert abs(532 - posts[3].x) < 1.5
assert abs(572 - posts[4].x) < 1.5


# test we can handle multiple (positive and negative) prompts for the same image
request = OwlV2InferenceRequest(
image=image,
training_data=[
{
"image": image,
"boxes": [
{"x": 223, "y": 306, "w": 40, "h": 226, "cls": "post", "negative": False},
{"x": 247, "y": 294, "w": 25, "h": 165, "cls": "post", "negative": True},
{"x": 264, "y": 327, "w": 21, "h": 74, "cls": "post", "negative": False},
{
"x": 223,
"y": 306,
"w": 40,
"h": 226,
"cls": "post",
"negative": False,
},
{
"x": 247,
"y": 294,
"w": 25,
"h": 165,
"cls": "post",
"negative": True,
},
{
"x": 264,
"y": 327,
"w": 21,
"h": 74,
"cls": "post",
"negative": False,
},
],
}
],
Expand All @@ -76,7 +103,14 @@ def test_owlv2():
{
"image": image,
"boxes": [
{"x": 223, "y": 306, "w": 40, "h": 226, "cls": "post", "negative": False}
{
"x": 223,
"y": 306,
"w": 40,
"h": 226,
"cls": "post",
"negative": False,
}
],
},
{
Expand All @@ -89,4 +123,4 @@ def test_owlv2():
)

response = OwlV2().infer_from_request(request)
assert len(response.predictions) == 5
assert len(response.predictions) == 5

0 comments on commit 1e5774e

Please sign in to comment.