0

I moved from python 2.7 to python 3.5

So, I had to use openCV 3.x.x.

The problem is that I cannot load SVM data.

For openCV 2.x.x, I could use

svm.load('filename')

However, for openCV 3.x.x, there is no load method.

I read this article.

But I could not find a method,

cv2.ml.SVM_load()

I think 3.1.0 is latest version, and I use it.

>>> cv2.__version__
'3.1.0'

How can I load svm data?

Community
  • 1
  • 1
SounBum Song
  • 225
  • 1
  • 3
  • 11

1 Answers1

0

Ok.. Additional infos to my answer:

Use the opencv master branch (currently 3.1.0-dev) of opencv

>>> import cv2
>>> cv2.__version__
'3.1.0-dev'

there is the method you're looking for

SVM_load(...)
    SVM_load(filepath) -> retval

in the output of

>>> help(cv2.ml)

I use it in production with Python 3.4.3+.

Community
  • 1
  • 1
Fabian
  • 3,139
  • 2
  • 23
  • 49
  • did you compile by yourself? Where can I download 3.1.0-dev? – SounBum Song Aug 17 '16 at 13:00
  • 1
    Yes, you need to clone the itseez/opencv repo from github. If you search online for "install opencv 3.1 with python3 on Ubuntu/Mac/etc" you will find some very good tutorials to compile opencv very simple and quickly. But make sure that you don't checkout other branches and stay on the master branch. – Fabian Aug 17 '16 at 13:27