Commit 01a923b26c5d9118e16ac3b25d8f87ea208f156c
1 parent
0a8576dc
Add INRIAPerson dataset
Showing
3 changed files
with
61 additions
and
0 deletions
data/INRIAPerson/README.md
0 → 100644
scripts/downloadDatasets.sh
| ... | ... | @@ -35,6 +35,24 @@ if [ ! -d ../data/BioID/img ]; then |
| 35 | 35 | rm *.eye description.txt BioID-FaceDatabase-V1.2.zip |
| 36 | 36 | fi |
| 37 | 37 | |
| 38 | +# INRIA person | |
| 39 | +if [ ! -d ../data/INRIAPerson/img ]; then | |
| 40 | + echo "Downloading INRIA person dataset..." | |
| 41 | + if hash curl 2>/dev/null; then | |
| 42 | + curl -OL http://pascal.inrialpes.fr/data/human/INRIAPerson.tar | |
| 43 | + else | |
| 44 | + wget http://pascal.inrialpes.fr/data/human/INRIAPerson.tar | |
| 45 | + fi | |
| 46 | + tar -xf INRIAPerson.tar | |
| 47 | + mkdir ../data/INRIAPerson/img ../data/INRIAPerson/sigset | |
| 48 | + ./writeINRIAPersonSigset.sh Train > ../data/INRIAPerson/sigset/train.xml | |
| 49 | + ./writeINRIAPersonSigset.sh Test > ../data/INRIAPerson/sigset/test.xml | |
| 50 | + ./writeINRIAPersonSigset.sh train_64x128_H96 > ../data/INRIAPerson/sigset/train_normalized.xml | |
| 51 | + ./writeINRIAPersonSigset.sh test_64x128_H96 > ../data/INRIAPerson/sigset/test_normalized.xml | |
| 52 | + mv INRIAPerson/* ../data/INRIAPerson/img | |
| 53 | + rm -r INRIAPerson* | |
| 54 | +fi | |
| 55 | + | |
| 38 | 56 | # KTH |
| 39 | 57 | if [ ! -d ../data/KTH/vid ]; then |
| 40 | 58 | echo "Downloading KTH..." | ... | ... |
scripts/writeINRIAPersonSigset.sh
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +writePresentation() | |
| 4 | +{ | |
| 5 | + pres="\t\t<presentation Label=\"pos\" file-name=\"$1/pos/$2\"" | |
| 6 | + if [ "$#" -eq 6 ]; then | |
| 7 | + pres="$pres>" | |
| 8 | + width=$(($5-$3)) | |
| 9 | + height=$(($6-$4)) | |
| 10 | + pres="$pres\n\t\t\t<data:bbox height=\"$height\" width=\"$width\" x=\"$3\" y=\"$4\" />" | |
| 11 | + pres="$pres\n\t\t</presentation>" | |
| 12 | + else | |
| 13 | + pres="$pres />" | |
| 14 | + fi | |
| 15 | + printf "$pres\n" | |
| 16 | +} | |
| 17 | +# for xargs calling bash below | |
| 18 | +export -f writePresentation | |
| 19 | +SEDREGEX='s/.*(\([0-9]*\), \([0-9]*\)) - (\([0-9]*\), \([0-9]*\))/writeIt \1 \2 \3 \4/' | |
| 20 | + | |
| 21 | +echo '<?xml version="1.0" encoding="UTF-8"?>' | |
| 22 | +echo '<biometric-signature-set>' | |
| 23 | +for fullpath in INRIAPerson/$1/pos/*; do | |
| 24 | + filename=$(basename "$fullpath") | |
| 25 | + echo -e "\t<biometric-signature name=\"${filename%.*}\">" | |
| 26 | + if [ -d INRIAPerson/$1/annotations ]; then | |
| 27 | + annotation="INRIAPerson/$1/annotations/${filename%.*}.txt" | |
| 28 | + grep 'Bounding box' $annotation | sed "$SEDREGEX" | xargs -n 5 bash -c "writePresentation $1 $filename \$@" | |
| 29 | + else | |
| 30 | + writePresentation $1 $filename | |
| 31 | + fi | |
| 32 | + echo -e '\t</biometric-signature>' | |
| 33 | +done | |
| 34 | +for fullpath in INRIAPerson/$1/neg/*; do | |
| 35 | + filename=$(basename "$fullpath") | |
| 36 | + echo -e "\t<biometric-signature name=\"${filename%.*}\">" | |
| 37 | + echo -e "\t\t<presentation Label=\"neg\" file-name=\"$1/neg/$filename\" />" | |
| 38 | + echo -e '\t</biometric-signature>' | |
| 39 | +done | |
| 40 | +echo '</biometric-signature-set>' | ... | ... |