-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_data.sh
executable file
·75 lines (66 loc) · 3.19 KB
/
get_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
# Flags
GET_KTH=true
GET_WEIZMANN=false
GET_KTH_NORM_STATS=true
SET_UP_KTH_TRAIN_TEST_SPLIT=true
mkdir -p data
# Get KTH
if [ "$GET_KTH" = true ]; then
echo "Getting KTH dataset..."
mkdir -p data/kth
wget -P data/kth http://www.nada.kth.se/cvap/actions/walking.zip
wget -P data/kth http://www.nada.kth.se/cvap/actions/jogging.zip
wget -P data/kth http://www.nada.kth.se/cvap/actions/running.zip
wget -P data/kth http://www.nada.kth.se/cvap/actions/boxing.zip
wget -P data/kth http://www.nada.kth.se/cvap/actions/handwaving.zip
wget -P data/kth http://www.nada.kth.se/cvap/actions/handclapping.zip
for f in data/kth/*.zip; do
dir=${f%.zip}
unzip -d "./$dir" "./$f"
rm $f
done
wget -O data/kth/sequences.txt http://www.nada.kth.se/cvap/actions/00sequences.txt
if [ "$SET_UP_KTH_TRAIN_TEST_SPLIT" = true ]; then
echo "Configuring KTH train/test split..."
for action in walking jogging running boxing handwaving handclapping; do
mkdir -p data/kth/train/${action}
for i in $(seq -f "%02g" 1 16); do
mv data/kth/${action}/person${i}* data/kth/train/${action}
done
mkdir -p data/kth/test/${action}
for i in $(seq -f "%02g" 17 25); do
mv data/kth/${action}/person${i}* data/kth/test/${action}
done
rmdir data/kth/${action}
done
fi
if [ "$GET_KTH_NORM_STATS" = true ]; then
echo "Getting precomputed KTH norm stats..."
wget -P data/kth https://github.com/ohjay/hmm_activity_recognition/files/3036370/norm_stats.zip --no-check-certificate
unzip -d data/kth data/kth/norm_stats.zip
rm data/kth/norm_stats.zip
fi
fi
# Get Weizmann
if [ "$GET_WEIZMANN" = true ]; then
echo "Getting Weizmann dataset..."
mkdir -p data/weizmann
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/walk.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/run.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/jump.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/side.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/bend.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/wave1.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/wave2.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/pjump.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/jack.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/skip.zip
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/classification_masks.mat
wget -P data/weizmann http://www.wisdom.weizmann.ac.il/~vision/VideoAnalysis/Demos/SpaceTimeActions/DB/backgrounds.zip
for f in data/weizmann/*.zip; do
dir=${f%.zip}
unzip -d "./$dir" "./$f"
rm $f
done
fi