Cant 运行 树懒标注工具

Cant run sloth annotation tool

我正在尝试使用注释工具 Sloth。 我如何让程序进入 运行?

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'

Sloth 是一个可执行的 Python 脚本。因此,对于 运行 您可以从终端调用它:

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

您可能 add sloth script directory to your PATH ,通过编辑您的 .bashrc 文件:

export PATH=$PATH:PUT_PATH_TO_SLOTH_HERE

然后 运行 source .bashrc 以使更改生效。之后,在终端 window 中输入 sloth 应该会打开 GUI。

在Windows中,我设法运行它使用Git Bash(Windows的Git安装默认提供了一个Bash模拟器) 。在 Git Bash 终端 Window 中,使用以下命令(如果您的 Python 安装目录不同,您可能需要更改):

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

以下在 Windows 上运行,使用 Anaconda python 3.5 构建(并安装所有依赖项):

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

完成安装 "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. 运行树懒: D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth

  6. 运行 包含示例的树懒: D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth D:\xxx\examples\example1_labels.json

可能的问题: FileNotFoundError: No such file or directory: 'D:\...\anaconda3\envs\slo_py35\lib\site-packages\sloth\gui\labeltool.ui'

解决方案:ui-文件存在,只是在错误的地方 D:\...\anaconda3\envs\slo_py35\sloth\gui\labeltool.ui ui-文件只需要复制到正确的路径,查看错误信息,然后运行s.