Fix bug where florence2 returns normalized xyxy regions

This commit is contained in:
LinasKo 2024-07-05 13:14:27 +03:00
parent c40734fb8d
commit d3db15fcd0
1 changed files with 2 additions and 0 deletions

View File

@ -174,7 +174,9 @@ def from_florence_2(
match is not None
), f"Expected string to end in location tags, but got {result}"
w, h = resolution_wh
xyxy = np.array([match.groups()], dtype=np.float32)
xyxy *= np.array([w, h, w, h]) / 1000
result_string = result[: match.start()]
labels = np.array([result_string])
return xyxy, labels, None, None