jsky
jsky

Reputation: 2217

Cant run sloth annotation tool

Im trying to use annotation tool Sloth. how do i get the program to run?

JMAIR-3:sloth user$ which python
/usr/local/bin/python
JMAIR-3:sloth user$ python --version
Python 2.7.10
JMAIR-3:sloth user$ brew install PyQt
Warning: pyqt-4.11.4 already installed
JMAIR-3:sloth user$ ls
COPYING     LICENSE     README.md   build       doc     examples    scripts     setup.py    sloth       tests
JMAIR-3:sloth user$ sloth
-bash: sloth: command not found
JMAIR-3:sloth user$ sudo python setup.py install 
Password:
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin/sloth to 755
running install_data
running install_egg_info
Removing /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sloth-1.0-py2.7.egg-info
Writing /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sloth-1.0-py2.7.egg-info
JMAIR-3:sloth user$ sloth
-bash: sloth: command not found
JMAIR-3:sloth user$ sloth examples/example1_labels.json
-bash: sloth: command not found


 python sloth
/usr/local/opt/python/bin/python2.7: can't find 'main' module in 'sloth'

Upvotes: 4

Views: 1916

Answers (3)

Sten
Sten

Reputation: 91

complete installation "sloth" under Windows:

  1. conda create -n slo_py35 python=3.5

  2. activate slo_py35 git config --global http.proxy http://proxy.xxx.de:port #only if proxy available pip install git+https://github.com/cvhciKIT/sloth.git

  3. conda install -c anaconda pyqt=4.11.4 conda install scikit-image #or if it does not work, take: pip install scikit-image

  4. conda env list #shows the path to the installation for example: D:\...\anaconda3\envs\slo_py35\

  5. run sloth: D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth

  6. run sloth with the included example: D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth D:\xxx\examples\example1_labels.json

possible problems: FileNotFoundError: No such file or directory: 'D:\...\anaconda3\envs\slo_py35\lib\site-packages\sloth\gui\labeltool.ui'

solutions: the ui-file exists and is just in the wrong place D:\...\anaconda3\envs\slo_py35\sloth\gui\labeltool.ui The ui-file only needs to be copied to the correct path, see error message, then it runs.

Upvotes: 0

inversion
inversion

Reputation: 1304

The following works on Windows, with an Anaconda python 3.5 build (and installs all the dependencies):

pip install git+https://github.com/cvhciKIT/sloth.git
conda install -c anaconda pyqt=4.11.4
conda install scikit-image

Upvotes: 3

Leandro Gomide
Leandro Gomide

Reputation: 1008

Sloth is an executable Python script . So, to run it you can call it from terminal:

PATH_PREFIX_TO_YOUR_PYTHON/Python27/Lib/site-packages/sloth/bin/sloth

You might add sloth script directory to your PATH , by editing yout .bashrc file:

export PATH=$PATH:PUT_PATH_TO_SLOTH_HERE

And then run source .bashrc in order for changes to take effect. After that, typing sloth in a terminal window should open the GUI.

In Windows, I managed to run it using Git Bash (Git installation for Windows provides a Bash emulator by default) . In a Git Bash terminal Window, use the following (you may need to chage if your Python installation directory is different):

/c/Python27/Lib/site-packages/sloth/bin/sloth

Upvotes: 2

Related Questions