-
Notifications
You must be signed in to change notification settings - Fork 25
/
simple_run.sh
executable file
·80 lines (70 loc) · 3.07 KB
/
simple_run.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
76
77
78
79
80
#!/bin/bash
# Download and unzip DAVIS train/val if it is not already there (~800MB)
if [ ! -d "./data/DAVIS" ]; then
echo "################# DOWNLOADING DAVIS DATA #################"
wget -P ./data https://data.vision.ee.ethz.ch/csergi/share/davis/DAVIS-2017-trainval-480p.zip
echo "################# UNZIPPING DAVIS DATA #################"
unzip ./data/DAVIS-2017-trainval-480p.zip -d ./data
fi
# Download and unzip weights if they are not already there (~3GB)
if [ ! -d "./weights/PReMVOS_weights" ]; then
echo "################# DOWNLOADING WEIGHTS #################"
wget -P ./weights https://www.vision.rwth-aachen.de/media/resource_files/PReMVOS_weights.zip
echo "################# UNZIPPING WEIGHTS #################"
unzip ./weights/PReMVOS_weights.zip -d ./weights
fi
# Run method on sequences defined in ./seq_to_run.txt
# Calculate optical flow
FLOW_LOC=./output/intermediate/flow
if [ ! -d "$FLOW_LOC" ]; then
echo "################# GENERATING FLOW #################"
./code/optical_flow_net-PWC-Net/script_pwc_multi.py
fi
# Generate general proposals
GENERAL_PROP_LOC=./output/intermediate/general_proposals
if [ ! -d "$GENERAL_PROP_LOC" ]; then
echo "################# GENERATING GENERAL PROPOSALS #################"
PROP_NET_GENERAL_WEIGHTS=./weights/PReMVOS_weights/proposal_net/general_weights/proposal_general_weights
./code/proposal_net/train.py --forward "$GENERAL_PROP_LOC" --agnostic --second_head --forward_dataset DAVIS --load "$PROP_NET_GENERAL_WEIGHTS" --davis_name "$PWD/seq_to_run.txt"
fi
# Generate specific proposals
SPECIFIC_PROP_LOC=./output/intermediate/specific_proposals
if [ ! -d "$SPECIFIC_PROP_LOC" ]; then
echo "################# GENERATING SPECIFIC PROPOSALS #################"
PROP_NET_SPECIFIC_WEIGHTS=./weights/PReMVOS_weights/proposal_net/specific_weights/proposal_specific_weights
./code/proposal_net/train.py --forward "$SPECIFIC_PROP_LOC" --agnostic --second_head --forward_dataset DAVIS --load "$PROP_NET_SPECIFIC_WEIGHTS" --davis_name "$PWD/seq_to_run.txt"
fi
# Combine general and specific proposals
COMBINED_PROP_LOC=./output/intermediate/combined_proposals
if [ ! -d "$COMBINED_PROP_LOC" ]; then
echo "################# GENERATING COMBINED PROPOSALS #################"
./code/proposal_net/combine_general_and_specific.py
fi
# Refine proposals
REFINED_PROP_LOC=./output/intermediate/refined_proposals
if [ ! -d "$REFINED_PROP_LOC" ]; then
echo "################# GENERATING REFINED PROPOSALS #################"
cd code
REFINEMENT_CONFIG=./refinement_net/configs/run
echo "$REFINEMENT_CONFIG"
./refinement_net/main.py "$REFINEMENT_CONFIG"
cd ..
fi
# Add ReID to proposals
ReID_PROP_LOC=./output/intermediate/ReID_proposals
if [ ! -d "$ReID_PROP_LOC" ]; then
echo "################# GENERATING ReID PROPOSALS #################"
cd code
ReID_CONFIG=./ReID_net/configs/run
echo "$ReID_CONFIG"
./ReID_net/main.py "$ReID_CONFIG"
cd ..
fi
# Run merging algorithm
MERGE_OUT_LOC=./output/final
if [ ! -d "$MERGE_OUT_LOC" ]; then
echo "################# Merging #################"
cd code
./MergeTrack/merge.py
cd ..
fi