Skip to content

Commit eb49324

Browse files
committed
empty handle
1 parent 6ecf4b0 commit eb49324

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

captcha_recognizer/recognizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def identify_gap(self, source, is_single=False, conf=CONF_THRESHOLD, **kwargs):
136136
return box, box_conf
137137

138138
results_filtered = [result for result in results if result['class_id'] in classes]
139+
if not results_filtered:
140+
return box, box_conf
139141
box_with_max_conf = max(results_filtered, key=lambda x: x['confidence'])
140142

141143
return box_with_max_conf['box'], box_with_max_conf['confidence']

0 commit comments

Comments
 (0)