forked from wkentaro/labelme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset_labelme_environment.sh
43 lines (33 loc) · 1.16 KB
/
set_labelme_environment.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
#!/bin/bash
sudo apt-get install -y curl
INSTALL_DIR=$(pwd)
if [ -e $INSTALL_DIR/.anaconda3 ]; then
echo "Anaconda3 is already installed: $INSTALL_DIR/.anaconda3"
exit 0
fi
TMPDIR=$(mktemp -d)
cd $TMPDIR
if [ "$(uname)" = "Linux" ]; then
wget -q 'https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh' -O miniconda3.sh
elif [ "$(uname)" = "Darwin" ]; then
wget -q 'https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh' -O miniconda3.sh
else
echo "[$(basename $0)] Unsupported platform: $(uname)"
exit 0
fi
bash ./miniconda3.sh -p $INSTALL_DIR/.anaconda3 -b
cd -
rm -rf $TMPDIR
source $INSTALL_DIR/.anaconda3/bin/activate
conda update -n base -y conda
conda install -n base -y pip # pip is uninstalled when conda is updated
source $INSTALL_DIR/.anaconda3/bin/deactivate
source .anaconda3/bin/activate
pip install -e .
pip install lxml
labelme_path=(`pwd`)
echo "" >> ~/.bashrc
echo "# labelme" >> ~/.bashrc
echo "alias labelme='cd $labelme_path && source .anaconda3/bin/activate && labelme'" >> ~/.bashrc
echo "alias labelme-cli='cd $labelme_path && source .anaconda3/bin/activate && cd labelme/cli'" >> ~/.bashrc
source ~/.bashrc