-
Notifications
You must be signed in to change notification settings - Fork 5
/
INSTALL
54 lines (46 loc) · 2.32 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Install instruction
1. Set up JAVA_HOME to point to the JDK installation if it doesn't already.
E.g.
% export JAVA_HOME=/opt/jdk1.7.0_09
2. Install the dependencies.
* Install colt as "colt" next to the jcp directory to support the
preset class path.
* Install org.JSON as "JSON/json.jar" next to the jcp directory to
support the preset class path.
* Install the Java port of libsvm as "libsvm-java/libsvm.jar" next
to the jcp directory to support the preset class path.
* Install liblinear-java as "liblinear-java/liblinear-java.jar" next
to the jcp directory to support the preset class path.
* Install OpenCV. OpenCV might be available as a binary package.
The OpenCV Core and ML modules and the Java bindings (jni) are required.
To build the JNI binding the option 'build shared libs' MUST be set to NO.
Use a recent Cmake.
Set up OCVJARDIR to point to the directory with the OpenCV Java jar
archive.
Set up OCVLIBDIR to point to the directories with the OpenCV JNI library
and, if required, the OpenCV libraries.
E.g.
% export OCVJARDIR=/opt/OpenCV/share/java/
% export OCVLIBDIR=/opt/OpenCV/share/OpenCV/java/:/opt/OpenCV/lib/
* Install the source of the C/C++ version of libsvm as "libsvm.git" next to
the jcp directory to support the preset include path in COMPILE.sh.
Build and copy libsvm.so into jcp/lib/.
The jcp/lib directory is created by the build system so it might not yet
exist. You can create it manually now to place libsvm.so into it.
3. Build jcp.
% ant all
4. Include jcp/build/jar/jcp.jar and the colt, JSON, Java libsvm, Java liblinear
and the OpenCV jars in the Java class path and the JNI library directories in
the java.library.path.
The jcp_train.sh and jcp_predict.sh scripts do this for the default
directory layout.
E.g.
% ./jcp_train.sh -h
% ./jcp_predict.sh -h
5. Using the bash front-end scripts a model can be created and saved using
% ./jcp_train.sh -m mnist_576_rbf_8vr.model ../pisvm-datasets/mnist_train_576_rbf_8vr.dat
And tested using
% ./jcp_predict.sh -m mnist_576_rbf_8vr.model ../pisvm-datasets/mnist_test_576_rbf_8vr.dat
Or just created and tested on a split of one data set without saving
the model:
% ./jcp_train.sh -v ../pisvm-datasets/mnist_train_576_rbf_8vr.dat