Web-based image annotation application This tool allows annotation of images using Amazon Mechanical Turk.. Tasks include:
-
Annotating photos with bounding boxes
-
Associating bound objects/photos with 3D meshes
-
Orienting a 3D mesh to match an object in a photo
-
Matching keypoints on the photo and a 3D mesh
This app is based on RoR (Ruby 2.1, Rails 4.0) and uses rTurk, a Ruby wrapper around the Amazon Mechanical Turk API.
-
Install Ruby 2.1.2, Rails 4.0.0, as specified here or here. (I actually did not use rvm (installed from source) because I couldn’t install a multiuser version)
-
Install sqlite3 and ruby gem.
sudo apt-get install sqlite3 libsqlite3-dev sudo gem install sqlite3-ruby
-
Clone this repository and run
bundle install rake db:migrate rake db:seed
-
You can run a local server for testing w/ localhost:3000.
-
Make sure the checked out repository has permissions allowing access by apache process (ensure group ownership is set to www-pub)
-
Create symlink in active apache DocumentRoot path (usually /var/www/) pointing to the SceneStudio/public directory
-
Install Phusion Passenger:
sudo gem install passenger yum install curl-devel httpd-devel sudo passenger-install-apache2-module
-
Edit your your Apache conf file to load Passenger module - see output from last step. An example:
LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.44 PassengerDefaultRuby /usr/local/bin/ruby </IfModule> -
Enable Apache rewrite module and ssh module
sudo a2enmod rewrite sudo a2enmod ssl
-
Add a VirtualHost to your Apache configuration. Make sure your VirtualHost root is to the public folder of the repo, and point the SSL configs to your .cert/.key file. <VirtualHost *:80>
RailsEnv development ServerName pascal3d.stanford.edu RewriteEngine On RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]</VirtualHost> <VirtualHost *:443>
RailsEnv development ServerName pascal3d.stanford.edu DocumentRoot /var/www/<base app folder>/public PassengerLoadShellEnvvars off PassengerLogLevel 3 PassengerUserSwitching off <Directory "/var/www/<base app folder>/public"> Options -MultiViews Allow from all </Directory> SSLEngine on SSLOptions +StrictRequire SSLCertificateFile <.cert file> SSLCertificateKeyFile <.key file></VirtualHost>
-
Enable your new site and restart Apache: sudo a2ensite www.yourapp.com sudo /etc/init.d/apache2 restart
Sign up for an account on AWS and and a Requester account for Mechanical Turk. You can test your MT HITS using requestersandbox.mturk.com/ and workersandbox.mturk.com/. Switch to sandbox/production by changing lib/rturk.rb
<li>Create a file config/config.yml to contain your AWS credentials - see example.config.yml in config/ for format. Do not check in/share this file
<ul>
<li>
Replace the Key ID and Access Key with your personal key (accessible from {here.}[https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key]).
</li>
<li>
You will also be able to set up the host base url for your server that AMT will attempt to load content from into an iframe. AMT loads our content as an ExternalQuestion type in an iframe. To prevent CSRF, if the iframe source is not using https Chrome will leave the iframe blank. Make sure the host base url starts with https://
</li>
</ul>
</li>
<li>
If you already have a server running, restart it (sudo service apache2 restart).
</li>
</ol>