Ask Your Question

student5302's profile - activity

2019-08-03 15:36:50 -0500 received badge  Popular Question (source)
2015-11-03 04:15:23 -0500 received badge  Enthusiast
2015-11-02 14:19:01 -0500 commented question Opencv-3.0.0, python, SVM.load() is missing

@berak, could you suggest temporary fix/patch/solution?

2015-11-01 09:16:06 -0500 received badge  Editor (source)
2015-11-01 09:01:28 -0500 asked a question Opencv-3.0.0, python, SVM.load() is missing

Hi everybody, I have built opencv3.0.0 on my archlinux (x64) and use it in python3 script. Where is SVM.load() method now?

algoritms.py", line 80, in load
self.model.load(fn)
AttributeError: 'cv2.ml_SVM' object has no attribute 'load'

In

class StatModel(object):
    def load(self, fn):
        logging.info(dir(self.model))
        self.model.load(fn)

    def save(self, fn):
        self.model.save(fn)

    def serialize(self):
        data_path = tempfile.mktemp()
        self.save(data_path)

        with open(data_path, 'rb') as fd:
            data = fd.read()

        os.unlink(data_path)
        return data

    def deserialize(self, data):
        data_path = tempfile.mktemp()
        with open(data_path, 'wb') as fd:
            fd.write(data)

        self.load(data_path)
        os.unlink(data_path)

And maybe someone can suggests more suitable serialize/deserialize implementation?

2015-10-23 10:24:04 -0500 commented question Free parking space detection

@seidju, Will you do something that works, can you share the code?