Spaces:
Runtime error
Runtime error
Commit
·
97df94d
1
Parent(s):
62c1fed
process video
Browse files- detector/utils.py +1 -0
detector/utils.py
CHANGED
|
@@ -43,6 +43,7 @@ def detect_chars(img):
|
|
| 43 |
img = cv2.resize(img, (640, 320))
|
| 44 |
detect = model_chars(img)
|
| 45 |
records = detect.pandas().xyxy[0].to_dict(orient='records')
|
|
|
|
| 46 |
text = ''
|
| 47 |
if records:
|
| 48 |
records = sorted(records, key=lambda d: d['xmin'])
|
|
|
|
| 43 |
img = cv2.resize(img, (640, 320))
|
| 44 |
detect = model_chars(img)
|
| 45 |
records = detect.pandas().xyxy[0].to_dict(orient='records')
|
| 46 |
+
records = filter(lambda d: d['confidence'] > 0.7, records)
|
| 47 |
text = ''
|
| 48 |
if records:
|
| 49 |
records = sorted(records, key=lambda d: d['xmin'])
|