source: research/2008-displacement/README @ 2292

Last change on this file since 2292 was 2292, checked in by Sam Hocevar, 13 years ago
  • Put part3 and part4 results in the paper.
File size: 12.9 KB
Line 
1# List all my 4chan images
2find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev > 4chan-list.txt
3
4# Put all my 4chan images in 100 separate /tmp directories
5for x in $(seq -w 00 09); do echo $x; mkdir -p /tmp/4chan/$x; cp $(find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'$x'.???') /tmp/4chan/$x; done
6
7# Results for part 1
8for x in 1 2 3 4; do
9    grep '^\['$x part1/dionoea.txt | awk '{ e+=$4; ef+=$7; em+=$10; n++ } END { print e/n, ef/n, em/n }' | read a1 b1 c1
10    grep '^\['$x part1/4chan.txt | awk '{ e+=$4; ef+=$7; em+=$10; n++ } END { print e/n, ef/n, em/n }' | read a2 b2 c2
11    echo $(((3 * $a1 + $a2) / 4)) $(((3 * $b1 + $b2) / 4)) $(((3 * $c1 + $c2) / 4))
12done
13
14# Condorcet voting for phase 2 results
15#  - raster + E
16#  - raster + E_min
17#  - serpentine + E
18#  - serpentine + E_min
19for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
20for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
21for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
22for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
23
24# Get phase 3 and phase 4 stuff
25# .. from canard
26ssh canard.zoy.org "cd test-20080329; tar cz *raster.txt" | tar xz
27ssh canard.zoy.org "cd test-20080329; tar cz *serp.txt" | tar xz
28for x in *-raster.txt; do y="$x"; y="${y%%-raster.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part3/"$y".txt; done
29for x in *-serp.txt; do y="$x"; y="${y%%-serp.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part4/"$y".txt; done
30# .. from poulet (cpushare)
31scp poulet.zoy.org:cpushare/'test*-*.txt' .
32for f in test6-*.txt; do grep '###' $f|cut -f2 -d'`'|cut -f1 -d"'"|tr / .|while read i ; do sed -ne '/`'$i'/,/limit/p' $f | cut -b61- >| part3/$(echo $i | cut -f5 -d.).txt ; done; done; rm -f test6-*.txt
33for f in test7-*.txt; do grep '###' $f|cut -f2 -d'`'|cut -f1 -d"'"|tr / .|while read i ; do sed -ne '/`'$i'/,/limit/p' $f | cut -b61- >| part4/$(echo $i | cut -f5 -d.).txt ; done; done; rm -f test7-*.txt
34
35# Condorcet voting for part 3 and 4
36for x in part3/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
37for x in part3/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
38for x in part4/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
39for x in part4/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
40
41# Mean voting for part 3 and 4
42# Square mean voting is not interesting
43cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
44cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
45cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
46cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
47
48# root square mean voting... why not, after all?
49cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=sqrt($4); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
50cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=sqrt($8); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
51cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=sqrt($4); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
52cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=sqrt($8); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
53
54# Clever stuff (or not)
55cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
56cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
57cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
58cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
59
60# Plot lena displacement
61set contour
62unset surface
63set view 0,0
64set cntrparam levels discrete 0.31, 0.35, 0.42, 0.52, 0.7, 1, 1.5
65set xrange [-1:1]
66set yrange [1:-1]
67set mxtics 2
68set mytics 2
69set size square
70set xzeroaxis
71set yzeroaxis
72set xlabel "dx" font "Italic,32"
73splot 'part0/lena-values.txt' with lines
74
75
76#set border 0
77set style line 1 lt 1 lw 1
78set style line 2 lt 2 lw 1
79set style line 3 lt 3 lw 1
80set style line 4 lt 6 lw 1
81set style line 5 lt 1 lw 3
82set style line 6 lt 2 lw 3
83set style line 7 lt 3 lw 3
84set style line 8 lt 6 lw 3
85###
86###
87###
88###
89###  Stuff below here is deprecated or unsorted
90###
91###
92###
93###
94
95#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main | tee fs-4chan.txt
96#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main-jajuni | tee jajuni-4chan.txt
97#% cat /tmp/4chanlist.txt | xargs -n 1 ./main | tee -a fs-4chan.txt
98
99# Lena
100set hidden3d
101set grid
102unset colorbox
103splot "lena-min.txt" with lines lc 7 notitle
104set terminal epslatex color size 2.5,2 blacktext
105set tmargin screen 0.75
106set bmargin screen 0.25
107set lmargin screen 0.05
108set rmargin screen 0.95
109set output "lena-min.tex"
110splot "lena-min.txt" with lines lc 7 notitle
111unset output
112set term pop
113
114# Dans gnuplot
115set xrange [-.1:.4]
116set yrange [.45:-.05]
117set grid
118plot "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
119     "fs-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
120     "fs-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI", \
121     "fs-jylam.txt" using 6:7 lc 4 pt 7 ps .08 title "Jylam", \
122     "merge.txt" using 5:6 lc 7 ps .2 with lines
123#plot "fs-textures.txt" using 6:7 lc 3 pt 7 ps .2, "fs-aerials.txt" using 6:7 lc 3 pt 7 ps .2, "fs-misc.txt" using 6:7 lc 7 pt 7 ps .2, "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .2
124
125# Histogramme de la tache Floyd-Steinberg
126sed -ne 's/.* for //p' fs-*txt | ./xy2d >| histo-fs.txt
127# Et ensuite dans gnuplot:
128set xrange [-.1:.4]
129set yrange [.4:-.1]
130set grid
131set lmargin screen 0.05
132set bmargin screen 0.15
133set tmargin screen 0.95
134set rmargin screen 0.95
135unset colorbox
136set pm3d explicit map interpolate 1.8,1.8
137set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
138unset key
139#splot "histo-fs.txt" notitle
140set terminal epslatex color size 1.8,1.8 blacktext
141set output "fs-histo.tex"
142splot "histo-fs.txt" notitle
143unset output
144set term pop
145
146set xrange [-.1:.9]
147set yrange [.95:-.05]
148set grid
149plot "jajuni-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
150     "jajuni-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
151     "jajuni-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
152
153# Histogramme de la tache JaJuNi
154sed -ne 's/.* for //p' jajuni*txt | ./xy2d-jajuni >| histo-jajuni.txt
155# Et ensuite dans gnuplot:
156set xrange [-.1:.9]
157set yrange [.9:-.1]
158set grid
159set lmargin screen 0.05
160set bmargin screen 0.15
161set tmargin screen 0.95
162set rmargin screen 0.95
163unset colorbox
164set pm3d explicit map interpolate 1.8,1.8
165set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
166unset key
167#splot "histo-jajuni.txt" notitle
168set terminal epslatex color size 1.8,1.8 blacktext
169set output "jajuni-histo.tex"
170splot "histo-jajuni.txt" notitle
171unset output
172set term pop
173
174# Test de merde
175set xrange [0:5]
176set yrange [0:5]
177set grid
178plot "fs-uscsipi.txt" using 2:4 lc 1 pt 7 ps .5, "fs-4chan.txt" using 2:4 lc 7 pt 7 ps .5, "fs-tobefred.txt" using 2:4 lc 3 pt 7 ps .5
179
180# Ostromoukhov
181set xrange [-.2:.2]
182set yrange [.3:-.1]
183set grid
184plot "ostro-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
185     "ostro-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
186     "ostro-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
187
188# Histogramme de la tache Ostro
189sed -ne 's/.* for //p' ostro*txt | ./xy2d-ostro >| histo-ostro.txt
190# Et ensuite dans gnuplot:
191set xrange [-.2:.2]
192set yrange [.3:-.1]
193set grid
194set lmargin screen 0.05
195set bmargin screen 0.15
196set tmargin screen 0.95
197set rmargin screen 0.95
198unset colorbox
199set pm3d explicit map interpolate 1.8,1.8
200set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
201unset key
202splot "histo-ostro.txt" notitle
203set terminal epslatex color size 1.8,1.8 blacktext
204set output "ostro-histo.tex"
205splot "histo-ostro.txt" notitle
206unset output
207set term pop
208
209# Optimum
210set xrange [-.5:.2]
211set yrange [.6:-.1]
212set grid
213plot "optimum-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
214     "optimum-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
215     "optimum-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
216
217# Histogramme de la tache Optimum
218sed -ne 's/.* for //p' optimum*txt | ./xy2d-optimum >| histo-optimum.txt
219# Et ensuite dans gnuplot:
220set xrange [-.5:.2]
221set yrange [.6:-.1]
222set grid
223set lmargin screen 0.05
224set bmargin screen 0.15
225set tmargin screen 0.95
226set rmargin screen 0.95
227unset colorbox
228set pm3d explicit map interpolate 1.8,1.8
229set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
230unset key
231splot "histo-optimum.txt" notitle
232set terminal epslatex color size 1.8,1.8 blacktext
233set output "optimum-histo.tex"
234splot "histo-optimum.txt" notitle
235unset output
236set term pop
237
238# Serpentine Optimum
239set xrange [-.3:.3]
240set yrange [.5:-.1]
241set grid
242plot "serpopt-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
243     "serpopt-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
244     "serpopt-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
245
246# Histogramme de la tache Serpentine Optimum
247sed -ne 's/.* for //p' serpopt*txt | ./xy2d-serpopt >| histo-serpopt.txt
248# Et ensuite dans gnuplot:
249set xrange [-.3:.3]
250set yrange [.6:-.1]
251set grid
252set lmargin screen 0.05
253set bmargin screen 0.15
254set tmargin screen 0.95
255set rmargin screen 0.95
256unset colorbox
257set pm3d explicit map interpolate 1.8,1.8
258set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
259unset key
260splot "histo-serpopt.txt" notitle
261set terminal epslatex color size 1.8,1.8 blacktext
262set output "serpopt-histo.tex"
263splot "histo-serpopt.txt" notitle
264unset output
265set term pop
266
267# Combinaison jajuni / Floyd-Steinberg
268set xrange [-.1:.4]
269set yrange [.9:-.1]
270set grid
271plot "fs-4chan.txt" using 6:7 lc 2 pt 7 ps .1 title "Floyd-Steinberg", "jajuni-tobefred.txt" using 6:7 lc 1 pt 7 ps .1 title "Jarvis-Judice-Ninke"
272
273######################## Trucs en cours ########################
274
275# Lancés sur canard:
276boat.png elaine.png texture[2345].png
277
278# Lancés sur poulet :
279./main /var/www/net/tobefred/www/htdocs/media/romane_bohringer.jpg | tee out-bohringer.txt ; ./main /var/www/net/tobefred/www/htdocs/media/juliette_binoche_05.jpg | tee out-binoche.txt ; ./main /var/www/net/tobefred/www/htdocs/media/kate_beckinsale02.jpg | tee out-beckinsale.txt
280
281#### Pour les out-*
282scp canard.zoy.org:out-'*'.txt .
283for x in out-*.txt; do sort -k7 $x | head -20 ; done | cut -f1 -d: | sort | uniq -c | sort -n
284
285###
286### Conversion du vieux format de résultats (deprecated)
287cat -n $x | sed 's/^  *[0-9]*\([0-9]\)[[:space:]]*/[\1] /; s/....###/###/; s/\[[27]/[1/; s/\[[38]/[2/; s/\[[49]/[3/; s/\[[50]/[4/'
288
289#
Note: See TracBrowser for help on using the repository browser.