-
Notifications
You must be signed in to change notification settings - Fork 0
/
one_click_ntire19_rsr.sh
47 lines (42 loc) · 1.35 KB
/
one_click_ntire19_rsr.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
#!/usr/bin/env bash
# Author: Wenyi Tang
# Date: Mar. 18 2019
# Email: wenyitang@outlook.com
_RSR_TEST_DIR=${RSR_TEST_DIR}
_RSR_SAVE_DIR=${RSR_SAVE_DIR}
if [ ${RSR_TEST_DIR:0:1} != '/' ];then
_RSR_TEST_DIR=`pwd`/${RSR_TEST_DIR}
fi
if [ ${RSR_SAVE_DIR:0:1} != '/' ];then
_RSR_SAVE_DIR=`pwd`/${RSR_SAVE_DIR}
fi
if [ -z ${_PATCH_SIZE} ];
then
_PATCH_SIZE=768
fi
if [ -z ${_STRIDE} ];
then
_STRIDE=760
fi
if [ ! -e VideoSuperResolution ];
then
git clone https://github.com/LoSealL/VideoSuperResolution -b ntire_2019
fi
pushd VideoSuperResolution
if [ ! -e setup.py ];
then
echo " [!] Can't find setup.py file! Make sure you are in the right place!"
fi
echo "RSR_TEST_DIR=${_RSR_TEST_DIR}"
echo "RSR_SAVE_DIR=${_RSR_SAVE_DIR}"
echo "Patch size=${_PATCH_SIZE}, stride=${_STRIDE}"
pip install -q -e .
python prepare_data.py --filter=rsr -q
echo " [*] Model extracted into Results/rsr/save"
python VSR/Tools/DataProcessing/NTIRE19RSR.py --ref_dir=${_RSR_TEST_DIR} --patch_size=${_PATCH_SIZE} --stride=${_STRIDE} --save_dir=${_RSR_SAVE_DIR}/1/
pushd VSRTorch
python eval.py rsr --cuda --ensemble -t=${_RSR_SAVE_DIR}/1/
popd
python VSR/Tools/DataProcessing/NTIRE19RSR.py --ref_dir=${_RSR_TEST_DIR} --patch_size=${_PATCH_SIZE} --stride=${_STRIDE} --results=Results/rsr/1/ --save_dir=${_RSR_SAVE_DIR}/2/
echo " [*] Processing done. Results are in ${_RSR_SAVE_DIR}/2/"
popd