Special case for REGION_TO_DESCRIPTION when nothing is detected
This commit is contained in:
1 parent
fc11f4d7af
commit
19bf417810
1 file changed
+3
@@ -165,6 +165,9 @@ def from_florence_2(
|
||||
result, str
|
||||
), f"Expected string as <REGION_TO_CATEGORY> result, got {type(result)}"
|
||||
|
||||
if result == "No object detected.":
|
||||
return np.empty((0, 4), dtype=np.float32), np.array([]), None, None
|
||||
|
||||
pattern = re.compile(r"<loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)>")
|
||||
match = pattern.search(result)
|
||||
assert (
|
||||
|
||||
Reference in new issue
Block a user