-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
48 lines (36 loc) · 1.18 KB
/
install.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
#!/bin/bash
# run.sh
# --
# Setup environment
conda create -y -n rsp_env python=3.7
conda activate rsp_env
# Dependencies
conda install -y numpy==1.18.1
conda install -y -c pytorch pytorch=1.4.0 torchvision cudatoolkit=10.1
pip install albumentations
pip install tifffile
# Model code
pip install git+https://github.com/cfld/amdim.git --ignore-installed
pip install -e .
# --
# Download models
function download_google_drive {
SRC=$1
DST=$2
echo "$SRC -> $DST"
curl -c /tmp/cookies "https://drive.google.com/uc?export=download&id=$SRC" > /tmp/intermezzo.html
DL_LINK=$(cat /tmp/intermezzo.html |\
grep -Po 'uc-download-link" [^>]* href="\K[^"]*' |\
sed 's/\&/\&/g'
)
curl -L -b /tmp/cookies https://drive.google.com$DL_LINK > $DST
}
# amdim
mkdir -p weights/amdim
download_google_drive 15ikQ_P5KTWzmW8KDw_8H3ToCYlPzET79 weights/amdim/amdim_weights_dummy.pth
# moco_r50/naip
mkdir -p weights/moco_r50
download_google_drive 1TxmvNV6PDn_hlFVMWfU_Gg2uxP1LbhWo weights/moco_r50/moco_naip_v0.pth.tar
# moco_r50/sentinel
mkdir -p weights/moco_r50
download_google_drive 1KQnQfONom9Ymp_6lJdWC_-vJkpbVtG4P weights/moco_r50/moco_sentinel_v0.pth.tar