1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

ml/python: fix digits samples(3.4)

This commit is contained in:
berak
2020-01-13 12:26:28 +01:00
parent c2096771cb
commit a718f2e6ea
2 changed files with 22 additions and 12 deletions
+9 -5
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python
'''
Digit recognition from video.
Run digits.py before, to train and save the SVM.
Usage:
digits_video.py [{camera_id|video_file}]
'''
# Python 2/3 compatibility
from __future__ import print_function
@@ -28,11 +36,7 @@ def main():
print('"%s" not found, run digits.py first' % classifier_fn)
return
if True:
model = cv.ml.SVM_load(classifier_fn)
else:
model = cv.ml.SVM_create()
model.load_(classifier_fn) #Known bug: https://github.com/opencv/opencv/issues/4969
model = cv.ml.SVM_load(classifier_fn)
while True:
_ret, frame = cap.read()