# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. 0. read ../README.txt and make sure you have "Prerequisites" 1. provide conf.xml file. As there is s sample conf file "conf.xml.sample", copy it to conf.xml and modify conf.xml appropriately. $ cp conf.xml.sample conf.xml $ vi conf.xml 2. build alike (in the parent directory of this directory) $ ant $ sbt clean package 3. change to this directory $ cd demo 4. download ukbench image file $ mkdir ukbench $ cd ukbench $ wget http://www.vis.uky.edu/~stewe/ukbench/ukbench.zip 5. unzip the zip file $ unzip ukbench.zip 6. remove existing intermediate and result files of demo # go back to demo directory $ cd .. $ ant clean 7. run extractor program # before running the program, desc directory needs to be created $ mkdir desc $ export PYTHONPATH=../src/python; python run_desc_extractor.py If you use Mac OS X and got "ImportError: No module named cv2" despite the fact that you've installed opencv +python27 via MacPorts, you may want to set your PYTHONPATH environment variable to fix this problem: # look for the place where cv2 module installed via MacPorts $ sudo port contents opencv|grep py $ export PYTHONPATH=$PYTHONPATH:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages If you use Mac OS X and got "segmentation fault" while running above, your python that was already installed with shipment couldn't suite the version of the opencv+python27 you've installed via MacPorts. To use MacPorts's version of python27, check the directory python27 installed and set your PATH environment variable: $ which python # look for the place where python27 command installed via MacPorts $ sudo port contents python27|grep bin $ export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH # rerun the above $ python run_desc_extractor.py 8. if you want to run mahout on hadoop distributed environment, do the following, otherwise, go to 9. (1) install Hadoop, set HADOOP_HOME environment variable (2) copy $HADOOP_HOME/conf to demo/hadoop-conf $ cp -R $HADOOP_HOME/conf hadoop-conf (3) set JAVA_HOME and HADOOP_CLASSPATH in demo/hadoop-conf/hadoop-env.sh. HADOOP_CLASSPATH should include all jar files in lib of parent directory and demo/hadoop-conf directory (4) set core-site.xml, hdfs-site.xml and mapred-site.xml appropriately in demo/hadoop-conf directory (5) set HADOOP_CONF_DIR environment variable to demo/hadoop-conf (6) execute hadoop namenode -format and start-all.sh 9. run clustering and vector quantization programs. You can choose use of (1) Mahout or (2) Spark for clustering # # (1) If you prefer Mahout # $ ant piv # kmeans may take tens of minutes $ ant kmeans $ ant clusterdump # # (2) If you prefer Spark (um, it takes 4 and half hours on my MacBook) # IMPORTANT: You need to install Spark 1.0.1 beforehand # $ spark-submit --jars ../apache-alike-0.2.job --class org.apache.alike.KMeansClusteringExecutor ../target/scala-2.10/alike-spark_2.10-0.2.jar # After (1) or (2), do the following for vector quantization $ ant qv 10. goto Solr site, download Solr 4.9.0 or superior and unzip # Apache Solr web site and download solr-4.9.0.tgz or superior http://lucene.apache.org/solr/ # unzip $ tar xvzf solr-4.9.0.tgz 11. startup Solr server $ cd solr-4.9.0/example $ java -Dsolr.solr.home=../../solrhome -jar start.jar 12. index demo vector quantization data $ ./post.sh solr-demo-data.xml 13. startup demo web server $ python demoserver.py 14. access to http://localhost:8080/ in your web browser and enjoy the demo!