Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files119 unmodified lines120121122123124125126127128129130131119 unmodified linesfor line in result[0]:# Check how many values are returned (2 or 3) and unpack accordinglyif len(line) == 3:box, text, _ = line # When 3 values are returnedelif len(line) == 2:box, text = line # When only 2 values are returned# Store the recognized text and bounding boxesfinal_text += ' ' + textboxes.append(box)# Draw the bounding box119 unmodified lines120121122123124125126127128129130131119 unmodified linesfor line in result[0]:# Check how many values are returned (2 or 3) and unpack accordinglyif len(line) == 3:box, (text, confidence), _ = line # When 3 values are returnedelif len(line) == 2:box, (text, confidence) = line # When only 2 values are returned# Store the recognized text and bounding boxesfinal_text += ' ' + text # Extract the text from the tupleboxes.append(box)# Draw the bounding box
utility/utils.py+3-3