ml module is not exported to Python in OpenCV3 (Bug #3866)


Added by George Brown over 10 years ago. Updated almost 10 years ago.


Status:Done Start date:2014-08-14
Priority:Normal Due date:
Assignee:Andrey Pavlenko % Done:

0%

Category:python bindings
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty:Medium HW Platform:x64
Pull request:

Description

Seems most other modules/classes are, unsure why the ml module isn't. I've been tracking how code generation works with the CV_EXPORTS macros, but I'm uncertain what's going on here. From what I can tell, SVM should be exported as ml_SVM (as it has a bunch of stuff in the pyopencv_generated_types.h file), but its pyopencv_ml_SVM_getseters() and pyopencv_ml_SVM_methods() arrays are empty. Additionally its pyopencv_ml_SVM_Type.tp_base is NULL, when it should be &pyopencv_StatModel_type.

For comparison, the objdetect.hpp:CascadeClassifier class seems to be exported properly, so I'm using that for reference.

Relevant files:
/modules/python/src2/gen2.py
/modules/python/src2/hdr_parser.py


Related issues

related to Bug #4033: Activate ml module Python bindings in 3 release Done 2014-11-29

Associated revisions

Revision bd7c78ff
Added by Vadim Pisarevsky almost 10 years ago

Merge pull request #3866 from tdsmith:python-linkage

History

Updated by Dmitry Retinskiy over 10 years ago

Andrey, could you check this?
Thanks.

  • Status changed from New to Open
  • Category set to python bindings
  • Assignee set to Andrey Pavlenko

Updated by Maksim Shabunin almost 10 years ago

Most of the algorithms in the ml module has been wrapped in python in the latest 3.0-rc1 version. The only class left is ANN_MLP. generator script should be modified to support classes with `_` in their name, this activity will be tracked in #4033.

Use the following instruction to access the `ml` module:

import cv2.ml

Thus, marking this issue `done`.

  • Status changed from Open to Done
  • Target version set to 3.0
  • Difficulty set to Medium

Also available in: Atom PDF