Removed the definition of basename, which confuses an existing system one.
[folded-ctf.git] / run.sh
diff --git a/run.sh b/run.sh
index 42dc58b..cf4fe33 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -1,25 +1,34 @@
 #!/bin/bash
 
-#########################################################################
-# This program is free software: you can redistribute it and/or modify  #
-# it under the terms of the version 3 of the GNU General Public License #
-# as published by the Free Software Foundation.                         #
-#                                                                       #
-# This program is distributed in the hope that it will be useful, but   #
-# WITHOUT ANY WARRANTY; without even the implied warranty of            #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      #
-# General Public License for more details.                              #
-#                                                                       #
-# You should have received a copy of the GNU General Public License     #
-# along with this program. If not, see <http://www.gnu.org/licenses/>.  #
-#                                                                       #
-# Written by Francois Fleuret, (C) IDIAP                                #
-# Contact <francois.fleuret@idiap.ch> for comments & bug reports        #
-#########################################################################
 
-MAIN_URL="http://www.idiap.ch/folded-ctf"
+########################################################################
+#                                                                      #
+#  folded-ctf is an implementation of the folded hierarchy of         #
+#  classifiers for object detection, developed by Francois Fleuret     #
+#  and Donald Geman.                                                  #
+#                                                                     #
+#  Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/   #
+#  Written by Francois Fleuret <francois.fleuret@idiap.ch>            #
+#                                                                     #
+#  This file is part of folded-ctf.                                   #
+#                                                                     #
+#  folded-ctf is free software: you can redistribute it and/or modify  #
+#  it under the terms of the GNU General Public License version 3 as   #
+#  published by the Free Software Foundation.                          #
+#                                                                     #
+#  folded-ctf is distributed in the hope that it will be useful, but   #
+#  WITHOUT ANY WARRANTY; without even the implied warranty of         #
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   #
+#  General Public License for more details.                           #
+#                                                                     #
+#  You should have received a copy of the GNU General Public License   #
+#  along with folded-ctf.  If not, see <http://www.gnu.org/licenses/>. #
+#                                                                     #
+########################################################################
+
+MAIN_URL="http://www.idiap.ch/folded-ctf/"
 
-######################################################################
+#########################################################################
 # Compiling
 
 make -j -k
@@ -31,7 +40,7 @@ fi
 
 echo
 
-######################################################################
+#########################################################################
 # Generating the pool file
 
 DATA_PATH=./rmk-data
@@ -77,13 +86,13 @@ else
 
 fi
 
-######################################################################
-# Running the computation per se
-
 RESULT_DIR=./results
 
 case $1 in
 
+    #####################################################################
+    ## Generate illustrating pictures
+
     pics)
 
         SEED=0
@@ -92,14 +101,18 @@ case $1 in
 
         if [[ -d "${EXPERIMENT_RESULT_DIR}" ]]; then
 
-            for n in -1 0 2501 2504; do
+            # Value of -1 corresponds to saving the images with the
+            # ground-truth or the pi-referentials alone, while other
+            # values show registered pi-feature windows.
+
+            for npf in -1 0 2500; do
 
                 ./folding --random-seed=${SEED} \
                     --pool-name=${POOL_NAME} \
-                    --result-path=${EXPERIMENT_RESULT_DIR} \
+                    --result-path=/tmp/ \
                     --detector-name=${EXPERIMENT_RESULT_DIR}/default.det \
-                    --nb-images=1 \
-                    --material-feature-nb=${n} \
+                    --nb-images=63 \
+                    --material-feature-nb=${npf} \
                     open-pool \
                     read-detector \
                     write-pool-images
@@ -114,6 +127,9 @@ case $1 in
 
         ;;
 
+    #####################################################################
+    ## Run the full computation
+
     valgrind|"")
 
         if [[ ! -d ${RESULT_DIR} ]]; then
@@ -131,10 +147,13 @@ case $1 in
                 if [[ $? == 0 ]]; then
 
                     if [[ $MODE == "h+b" ]]; then
-                        OPTS="${OPTS} --force-head-belly-independence=yes"
+                        OPTS="--force-head-belly-independence=yes"
+                    else
+                        OPTS=""
                     fi
 
                     if [[ $1 == "valgrind" ]]; then
+                        # The valgrind operation runs a simpler computation in valgrind
                         OPTS="${OPTS} --nb-classifiers-per-level=1 --nb-weak-learners-per-classifier=10"
                         OPTS="${OPTS} --proportion-for-train=0.1 --proportion-for-validation=0.025 --proportion-for-test=0.01"
                         OPTS="${OPTS} --wanted-true-positive-rate=0.1"
@@ -155,7 +174,7 @@ case $1 in
 
                 else
 
-                    echo "${EXPERIMENT_RESULT_DIR} exists, aborting experiment."
+                    echo "${EXPERIMENT_RESULT_DIR} exists, cancelling that run."
 
                 fi