source: research/2008-displacement/README @ 2291

Last change on this file since 2291 was 2291, checked in by Sam Hocevar, 13 years ago
  • More fixes in the paper.
File size: 12.0 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
42cat 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
43cat 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
44cat 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
45cat 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
46
47# Clever stuff (or not)
48cat 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
49cat 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
50cat 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
51cat 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
52
53# Plot lena displacement
54set contour
55unset surface
56set view 0,0
57set cntrparam levels discrete 0.31, 0.35, 0.42, 0.52, 0.7, 1, 1.5
58set xrange [-1:1]
59set yrange [1:-1]
60set mxtics 2
61set mytics 2
62set size square
63set xzeroaxis
64set yzeroaxis
65set xlabel "dx" font "Italic,32"
66splot 'part0/lena-values.txt' with lines
67
68
69#set border 0
70set style line 1 lt 1 lw 1
71set style line 2 lt 2 lw 1
72set style line 3 lt 3 lw 1
73set style line 4 lt 6 lw 1
74set style line 5 lt 1 lw 3
75set style line 6 lt 2 lw 3
76set style line 7 lt 3 lw 3
77set style line 8 lt 6 lw 3
78###
79###
80###
81###
82###  Stuff below here is deprecated or unsorted
83###
84###
85###
86###
87
88#% 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
89#% 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
90#% cat /tmp/4chanlist.txt | xargs -n 1 ./main | tee -a fs-4chan.txt
91
92# Lena
93set hidden3d
94set grid
95unset colorbox
96splot "lena-min.txt" with lines lc 7 notitle
97set terminal epslatex color size 2.5,2 blacktext
98set tmargin screen 0.75
99set bmargin screen 0.25
100set lmargin screen 0.05
101set rmargin screen 0.95
102set output "lena-min.tex"
103splot "lena-min.txt" with lines lc 7 notitle
104unset output
105set term pop
106
107# Dans gnuplot
108set xrange [-.1:.4]
109set yrange [.45:-.05]
110set grid
111plot "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
112     "fs-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
113     "fs-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI", \
114     "fs-jylam.txt" using 6:7 lc 4 pt 7 ps .08 title "Jylam", \
115     "merge.txt" using 5:6 lc 7 ps .2 with lines
116#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
117
118# Histogramme de la tache Floyd-Steinberg
119sed -ne 's/.* for //p' fs-*txt | ./xy2d >| histo-fs.txt
120# Et ensuite dans gnuplot:
121set xrange [-.1:.4]
122set yrange [.4:-.1]
123set grid
124set lmargin screen 0.05
125set bmargin screen 0.15
126set tmargin screen 0.95
127set rmargin screen 0.95
128unset colorbox
129set pm3d explicit map interpolate 1.8,1.8
130set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
131unset key
132#splot "histo-fs.txt" notitle
133set terminal epslatex color size 1.8,1.8 blacktext
134set output "fs-histo.tex"
135splot "histo-fs.txt" notitle
136unset output
137set term pop
138
139set xrange [-.1:.9]
140set yrange [.95:-.05]
141set grid
142plot "jajuni-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
143     "jajuni-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
144     "jajuni-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
145
146# Histogramme de la tache JaJuNi
147sed -ne 's/.* for //p' jajuni*txt | ./xy2d-jajuni >| histo-jajuni.txt
148# Et ensuite dans gnuplot:
149set xrange [-.1:.9]
150set yrange [.9:-.1]
151set grid
152set lmargin screen 0.05
153set bmargin screen 0.15
154set tmargin screen 0.95
155set rmargin screen 0.95
156unset colorbox
157set pm3d explicit map interpolate 1.8,1.8
158set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
159unset key
160#splot "histo-jajuni.txt" notitle
161set terminal epslatex color size 1.8,1.8 blacktext
162set output "jajuni-histo.tex"
163splot "histo-jajuni.txt" notitle
164unset output
165set term pop
166
167# Test de merde
168set xrange [0:5]
169set yrange [0:5]
170set grid
171plot "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
172
173# Ostromoukhov
174set xrange [-.2:.2]
175set yrange [.3:-.1]
176set grid
177plot "ostro-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
178     "ostro-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
179     "ostro-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
180
181# Histogramme de la tache Ostro
182sed -ne 's/.* for //p' ostro*txt | ./xy2d-ostro >| histo-ostro.txt
183# Et ensuite dans gnuplot:
184set xrange [-.2:.2]
185set yrange [.3:-.1]
186set grid
187set lmargin screen 0.05
188set bmargin screen 0.15
189set tmargin screen 0.95
190set rmargin screen 0.95
191unset colorbox
192set pm3d explicit map interpolate 1.8,1.8
193set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
194unset key
195splot "histo-ostro.txt" notitle
196set terminal epslatex color size 1.8,1.8 blacktext
197set output "ostro-histo.tex"
198splot "histo-ostro.txt" notitle
199unset output
200set term pop
201
202# Optimum
203set xrange [-.5:.2]
204set yrange [.6:-.1]
205set grid
206plot "optimum-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
207     "optimum-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
208     "optimum-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
209
210# Histogramme de la tache Optimum
211sed -ne 's/.* for //p' optimum*txt | ./xy2d-optimum >| histo-optimum.txt
212# Et ensuite dans gnuplot:
213set xrange [-.5:.2]
214set yrange [.6:-.1]
215set grid
216set lmargin screen 0.05
217set bmargin screen 0.15
218set tmargin screen 0.95
219set rmargin screen 0.95
220unset colorbox
221set pm3d explicit map interpolate 1.8,1.8
222set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
223unset key
224splot "histo-optimum.txt" notitle
225set terminal epslatex color size 1.8,1.8 blacktext
226set output "optimum-histo.tex"
227splot "histo-optimum.txt" notitle
228unset output
229set term pop
230
231# Serpentine Optimum
232set xrange [-.3:.3]
233set yrange [.5:-.1]
234set grid
235plot "serpopt-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
236     "serpopt-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
237     "serpopt-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
238
239# Histogramme de la tache Serpentine Optimum
240sed -ne 's/.* for //p' serpopt*txt | ./xy2d-serpopt >| histo-serpopt.txt
241# Et ensuite dans gnuplot:
242set xrange [-.3:.3]
243set yrange [.6:-.1]
244set grid
245set lmargin screen 0.05
246set bmargin screen 0.15
247set tmargin screen 0.95
248set rmargin screen 0.95
249unset colorbox
250set pm3d explicit map interpolate 1.8,1.8
251set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
252unset key
253splot "histo-serpopt.txt" notitle
254set terminal epslatex color size 1.8,1.8 blacktext
255set output "serpopt-histo.tex"
256splot "histo-serpopt.txt" notitle
257unset output
258set term pop
259
260# Combinaison jajuni / Floyd-Steinberg
261set xrange [-.1:.4]
262set yrange [.9:-.1]
263set grid
264plot "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"
265
266######################## Trucs en cours ########################
267
268# Lancés sur canard:
269boat.png elaine.png texture[2345].png
270
271# Lancés sur poulet :
272./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
273
274#### Pour les out-*
275scp canard.zoy.org:out-'*'.txt .
276for x in out-*.txt; do sort -k7 $x | head -20 ; done | cut -f1 -d: | sort | uniq -c | sort -n
277
278###
279### Conversion du vieux format de résultats (deprecated)
280cat -n $x | sed 's/^  *[0-9]*\([0-9]\)[[:space:]]*/[\1] /; s/....###/###/; s/\[[27]/[1/; s/\[[38]/[2/; s/\[[49]/[3/; s/\[[50]/[4/'
281
282#
Note: See TracBrowser for help on using the repository browser.