opencv: Algorithm::load() not available for script wrappers

Transferred from http://code.opencv.org/issues/4279

|| be rak on 2015-04-14 14:32
|| Priority: Normal
|| Affected: branch 'master' (3.0-dev)
|| Category: ml
|| Tracker: Bug
|| Difficulty: 
|| PR: 
|| Platform: Any / Any

Algorithm::load() not available for script wrappers

while trying to fix the ml-related python samples, i found
that it's impossible to load a serialized state from python atm.

adding a respective method like:

CV_WRAP static Ptr<SVM> load(const String &fn)
{
    return Algorithm::load<SVM>(fn);
}

to each of the ml classes would fix it, but hopefully there might be a better way (without changing the interface)

History

Vadim Pisarevsky on 2015-04-27 11:12
-   Category set to ml
Maksim Shabunin on 2015-04-29 09:21
-   Target version set to 3.0

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 24 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I found that you can use

self.model = cv2.ml.SVM_load(filename)

instead.

What about KNN_load() which is still missing in opencv-python (3.2.0.7)?

Can someone please solve this bug? it’s kind of urgent

Has anyone fixed this??

I’m still having this issue on 3.3 (Mac, installed via Homebrew, cv2.__version__ reports 3.3.0). cv2.face.LBPHFaceRecognizer_create().load doesn’t exist.

Apparently they just never ended up writing the wrapper for this. My vote, use sci-kit. I ended up doing this and it worked a lot better anyways. I also used PIL for the loading and saving of the trained network.

Could anyone share the current status of this issue?