Closed mz64 closed 6 years ago
minimal example or link on how to train your own models, ideally without Matlab
This isn't possible currently, it requires Piotr's Matlab Toolbox. It would be nice to get the training part in C++, but I haven't gotten around to it. I could probably add a pointer to the relevant toolbox scripts needed for training with a high level overview.
I assume that mat2cpb converts Matlab models to Cereal
Yes. Typically, I build w/ cvmatio
support as needed to convert new *.mat
models to a cereal *.cpb
(portable binary archive) format, and use a cereal
only build in a final application. This behavior can be controlled with the following CMake
options from the command line:
ACF_SERIALIZE_WITH_CVMATIO
ACF_SERIALIZE_WITH_CEREAL
minimal example on how to include the library (libacf?) in your own code
I can add more details, or pointers to existing documentation where needed. There are two main paths for integration: 1) build your application or library using Hunter, and the dependency will be handled automatically; 2) build ACF as a shared library (or framework) so it grabs the symbols it needs from the static dependencies and include the final acf.{dylib,so,framework}
in your application.
For now, here is a pointer to one of the training scripts that can be used as a starting point:
https://github.com/pdollar/toolbox/blob/master/detector/acfDemoCal.m
When you have your final model you can just convert it with mat2cpb --input=model.mat --output=model.cpb
then when you pass it as act-detect --model=model.cpb
it should load fine.
I admit the Matlab training is a pain, but there is a home license now that is pretty reasonable. If you run into issues with training or loading let know.
Thanks! Exactly what I needed. The main training script has pretty good documentation: https://github.com/pdollar/toolbox/blob/master/detector/acfTrain.m
I will try to train with on Octave + report back. If that works, I agree that C++ code for training is not required. The main issue with the MATLAB home license is the restriction against commercial projects.
Thanks! Exactly what I needed.
Great. For now, I've added short training and integration sections to the readme w/ some relevant links:
I agree that C++ code for training is not required.
It would be a nice addition though...
Update: Piotr's Matlab ACF scripts (git-1a3c9869033548a) do not work out-of-the-box in Octave (v.4.0), e.g.: error: ‘size_t’ was not declared in this scope
So far the issues seem to be related to C/C++ compiler settings in Octave. I will keep on digging + get back with if I can find a solution.
Piotr (in separate communication) seemed mildly sceptical about whether this is possible:
[...] I know parts of my code ran in octave. That being said it may be tough for some of the ACF as it uses SSE operations and makes assumptions about memory layout etc. that may be specific to Matlab.
Opinion: since there is no immediate way to train a model without relying on MATLAB, I think that you should leave this as an open issue.
Reasoning:
I will keep on digging + get back with if I can find a solution.
Okay, thanks for the update. That would be a nice option if it worked.
I think that you should leave this as an open issue.
Sure. Please open a new issue for the training feature.
Quick start | HOWTO is pretty self-explanatory and seems to find Lena :) but the following would be useful: