We succeed installing the LabelMe code in Windows.
Here is a general guideline of what we did:
1) Downloaded the Labelme code package (the authors will send that).
2) Installed "Apache" for windows
3) Installed "Active Perl"
4) Installed Cygwin
5) Make sure that all of the above (except LabelMe) works OK first.
6) We change the config file of Apache (httpd.conf) by adding the following:
------------------------------------------------------------- ------
# Added by Juan from line 194
<Directory "C:/POSTDOC/LabelMe">
Options FollowSymLinks SymLinksIfOwnerMatch Indexes +Includes +ExecCGI
AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Added by Juan in line 325
Alias /LabelMe/ "C:/POSTDOC/LabelMe/"
# Added and changed by Juan (line 338)
#ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
ScriptAlias /cgi-bin/ "C:/POSTDOC/LabelMe/"
# Changed line 406
AddHandler cgi-script .cgi .pl
# Added and changed in line 417
AddType text/html .shtml
AddHandler server-parsed .shtml
AddOutputFilter INCLUDES .shtml
-----------------------------------------------------
7) We added the module "mod_rewrite" to the Active Perl version.
8) We changed and added to the file "Makefile" the following:
------------------------------------------------------------- ---------
#IMAGES_DIR=/afs/csail/group/vision/www/data/LabelMe/Test/Images
#ANNOTATIONS_DIR=/afs/csail/group/vision/www/data/LabelMe/Test/Annotations
IMAGES_DIR=/cygdrive/c/POSTDOC/LabelMe/Images/
ANNOTATIONS_DIR=/cygdrive/c/POSTDOC/LabelMe/Annotations/
---------------------------------------------------------- --------------
9) We run the command "make" on Cygwin, under the folder "LabelMe"
10) We changed all the "#! /usr/bin/.." by "#!c:/Perl/bin/perl.exe" in all the scripts under LabelMe
11) We add/changed the scipt "fetch_image.cgi". See below all the file after the changes
-------------------------------------------------------------- ------------
#!c:/Perl/bin/perl.exe
# Get STDIN:
read(STDIN,$collection,$ENV{'CONTENT_LENGTH'});
$fname = "DirLists/$collection.txt";
# Juan add:
if(!open(xFP,$fname)) {
print "Status: 404\n\n";
return;
}
$numlines = 0;
@lines = readline(xFP);
foreach $i (@lines) {
$numlines = $numlines + 1;
};
close(xFP);
# end Juan add
if(!open(FP,$fname)) {
print "Status: 404\n\n";
return;
}
# Juan remove:
#open(NUMLINES,"wc -l $fname |");
#$numlines = <NUMLINES>;
#($numlines,$bar) = split(" DirLists",$numlines);
#close(NUMLINES);
# end Juan remove
$line = int(rand($numlines))+1;
for($i=1; $i < $line; $i++) {
$garbage = readline(FP);
}
$fileinfo = readline(FP);
($im_dir,$im_file) = split(",",$fileinfo);
$im_file =~ tr/"\n"//d; # remove trailing newline
close(FP);
# Send back data:
print "Content-type: text/xml\n\n" ;
print "<out><dir>$im_dir</dir><file>$im_file</file></out>";
--------------------------------------------------------- -----------
12) Last things: Open your browser (we use Firefox) and enter the following url:
http://127.0.0.1/LabelMe/tool.htmlGood luck!
Thanks Antonio and the rest for this great application!
Mathias Kolsch and Juan Wachs