Fixed a minor bug with region OCR always returning the first label with an erronious </s>

#25
Files changed (1) hide show
  1. processing_florence2.py +1 -0
processing_florence2.py CHANGED
@@ -722,6 +722,7 @@ class Florence2PostProcesser(object):
722
  bboxes = []
723
  labels = []
724
  text = text.replace('<s>', '')
 
725
  # ocr with regions
726
  parsed = re.findall(pattern, text)
727
  instances = []
 
722
  bboxes = []
723
  labels = []
724
  text = text.replace('<s>', '')
725
+ text = text.replace('</s>', '')
726
  # ocr with regions
727
  parsed = re.findall(pattern, text)
728
  instances = []