-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_davis_list.sh
executable file
·31 lines (25 loc) · 1.08 KB
/
create_davis_list.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
make_list () {
DATA_PATH=$1
OUT_PATH=$2
FLOW_PATH=$3
for folder in `ls ${DATA_PATH}`; do
echo $folder
# list the images with full path under the folder
ls -1 ${DATA_PATH}${folder} | grep 'jpg' | awk -v prefix="${DATA_PATH}${folder}/" '{print prefix $0}' \
> ${OUT_PATH}${folder}'.txt'
# # first-second frame listings in separate files
head -n -1 ${OUT_PATH}${folder}'.txt' > ${OUT_PATH}${folder}'-first.txt'
tail -n +2 ${OUT_PATH}${folder}'.txt' > ${OUT_PATH}${folder}'-second.txt'
# # list of output .flow filenames (replace .jpg with .flo in ...-first.txt)
mkdir -p $FLOW_PATH$folder
ls -1 ${DATA_PATH}${folder} | grep 'jpg' | awk -v prefix="$FLOW_PATH$folder/" '{print prefix $0}' | \
sed -e 's/.jpg/.flo/g' | head -n -1 > ${OUT_PATH}${folder}'-flow-outputs.txt'
done
}
# For DAVIS dataset
DATA_PATH=data/DAVIS/DAVIS/JPEGImages/480p/
OUT_PATH=data/DAVIS/input-lists/
FLOW_PATH=data/DAVIS/output-flow/
mkdir -p ${OUT_PATH}
mkdir -p ${FLOW_PATH}
make_list ${DATA_PATH} ${OUT_PATH} ${FLOW_PATH}