#!/usr/bin/env ruby require 'erb' require 'rubygems' require 'json/pure' require 'fix_json' require 'json_utils' def main(dataset, method) for chunk in Dir["#{dataset}_chunks/#{method}/???_go"] create_slideshow(dataset, method, chunk) end end HTML_TEMPLATE =< Results for <%= pretty_method %> in the <%= pretty_dataset%> environment

Lazy Localization using the Frozen-Time Smoother (website)

Results for <%= pretty_method %> in the <%= pretty_dataset%> environment

Start the HTML animation. Animation in PDF format.


<%= body %>

Lazy Localization using a Frozen-Time Smoother (website)

EOF IMAGE_TEMPLATE =<
Input
<%=description%>

EOF def create_slideshow(dataset, method, chunk) a = read_all_objects(File.open(chunk).read) chunk_id=File.basename(chunk, "_go") body = "" a.each_with_index do |data, i| description = data['description'] description.gsub!(/_(\d+)/, '\1') label = "#{i}" next_img = "\##{i+1}" prev_img = i == 0 ? nil : "\##{i-1}" src = sprintf("%s-%03d.png", File.basename(chunk), i) body += ERB.new(IMAGE_TEMPLATE).result(binding) end pretty_method = {'fts1'=>'the Frozen-Time Filter', 'mcl1' => 'Monte Carlo Smoothing - 1', 'mcl1' => 'Monte Carlo Smoothing - 2'}[method] || method pretty_dataset = {'intel' => 'Intel', 'aces' => 'Aces'}[dataset] || dataset html = ERB.new(HTML_TEMPLATE).result(binding) out = "#{chunk}.html" File.open(out,'w') do |f| f.write html end $stderr.puts "Written on #{out}" end if ARGV.size == 2 dataset = ARGV[0] method = ARGV[1] main(dataset, method) elsif ARGV.size == 3 dataset = ARGV[0] method = ARGV[1] chunk = ARGV[2] create_slideshow(dataset, method, chunk) end