Update ice_install.sh
Browse files- ice_install.sh +75 -0
ice_install.sh
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pick your installation target: cuda11 or cuda10 or cpu
|
| 2 |
+
# Pick icevision version: if empty, the PyPi release version will be chosen. If you pass `master`, the GitHub master version will be chosen
|
| 3 |
+
|
| 4 |
+
# Examples
|
| 5 |
+
## Install cuda11 and icevsision master version
|
| 6 |
+
# !bash icevision_install.sh cuda11 master
|
| 7 |
+
|
| 8 |
+
## Install cpu and icevsision PyPi version
|
| 9 |
+
# !bash icevision_install.sh cpu
|
| 10 |
+
|
| 11 |
+
target="${1}"
|
| 12 |
+
case ${target} in
|
| 13 |
+
cuda10)
|
| 14 |
+
echo "Installing icevision + dependencices for ${1}"
|
| 15 |
+
echo "- Installing torch and its dependencies"
|
| 16 |
+
pip install torch==1.10.0+cu102 torchvision==0.11.1+cu102 torchtext==0.11.0 -f https://download.pytorch.org/whl/torch_stable.html --upgrade -q
|
| 17 |
+
|
| 18 |
+
echo "- Installing mmcv"
|
| 19 |
+
pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html --upgrade -q
|
| 20 |
+
;;
|
| 21 |
+
|
| 22 |
+
cuda11)
|
| 23 |
+
echo "Installing icevision + dependencices for ${1}"
|
| 24 |
+
echo "- Installing torch and its dependencies"
|
| 25 |
+
pip install torch==1.10.0+cu111 torchvision==0.11.1+cu111 torchtext==0.11.0 -f https://download.pytorch.org/whl/torch_stable.html --upgrade
|
| 26 |
+
|
| 27 |
+
echo "- Installing mmcv"
|
| 28 |
+
pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.10.0/index.html --upgrade -q
|
| 29 |
+
;;
|
| 30 |
+
|
| 31 |
+
cpu)
|
| 32 |
+
echo "Installing icevision + dependencices for ${1}"
|
| 33 |
+
echo "- Installing torch and its dependencies"
|
| 34 |
+
pip install torch=="1.10.0+cpu" torchvision=="0.11.1+cpu" torchtext==0.11.0 -f https://download.pytorch.org/whl/torch_stable.html
|
| 35 |
+
|
| 36 |
+
echo "- Installing mmcv"
|
| 37 |
+
pip install mmcv-full=="1.3.17" -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10.0/index.html --upgrade -q
|
| 38 |
+
;;
|
| 39 |
+
|
| 40 |
+
*)
|
| 41 |
+
echo "Coud not install icevision. Check out which torch and torchvision versions are compatible with your CUDA version"
|
| 42 |
+
exit -1 # Command to come out of the program with status -1
|
| 43 |
+
;;
|
| 44 |
+
esac
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
echo "- Installing mmdet"
|
| 48 |
+
pip install mmdet==2.17.0 --upgrade -q
|
| 49 |
+
|
| 50 |
+
echo "- Installing mmseg"
|
| 51 |
+
pip install mmsegmentation==0.20.2 --upgrade -q
|
| 52 |
+
|
| 53 |
+
icevision_version="${2}"
|
| 54 |
+
|
| 55 |
+
case ${icevision_version} in
|
| 56 |
+
master)
|
| 57 |
+
echo "- Installing icevision from master"
|
| 58 |
+
pip install git+https://github.com/airctic/icevision.git#egg=icevision[all] --upgrade -q
|
| 59 |
+
|
| 60 |
+
echo "- Installing icedata from master"
|
| 61 |
+
pip install git+https://github.com/airctic/icedata.git --upgrade -q
|
| 62 |
+
;;
|
| 63 |
+
|
| 64 |
+
*)
|
| 65 |
+
echo "- Installing icevision from PyPi"
|
| 66 |
+
pip install icevision[all] --upgrade -q
|
| 67 |
+
|
| 68 |
+
echo "- Installing icedata from PyPi"
|
| 69 |
+
pip install icedata --upgrade -q
|
| 70 |
+
;;
|
| 71 |
+
esac
|
| 72 |
+
|
| 73 |
+
# a workaround regarding opencv in colab issue: https://github.com/airctic/icevision/issues/1012
|
| 74 |
+
pip install opencv-python-headless==4.1.2.30
|
| 75 |
+
echo "icevision installation finished!"
|