labelImg macos 运行环境设置

labelImg macos 运行环境设置

MacOS brew 安装

文档

  1. 安装CLT for Xcode,检查git/bash/curl存在

    xcode-select --install
    

    xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates 此提示表示已经安装。

  2. 设置清华源环境变量

    export HOMEBREW_INSTALL_FROM_API=1
    export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
    export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
    export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
    export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
    export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
    
  3. 从镜像源安装 homebrew

    # 克隆仓库
    git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
    
    # 执行安装脚本
    /bin/bash brew-install/install.sh
    
    # 删除仓库
    rm -rf brew-install
    
  4. 写入本地用户 zsh profile

    (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> ~/.zprofile
    

labelImg 环境准备

文档

  1. brew 安装qt@5版本

    brew install qt@5
    
  2. 安装其它依赖

    brew install libxml2
    

运行项目

  1. 克隆项目

    git clone https://github.com/HumanSignal/labelImg.git
    
  2. 终端(Terminal)切换至labelImg目录

    # 一般会克隆至该目录,根据实际情况进行改变
    cd ~/labelImg
    
  3. 创建虚拟环境

    python3 -m venv .venv
    
  4. 激活虚拟环境

    source .venv/bin/activate
    
  5. 安装 python 包

    pip3 install -r requirements/requirements-linux-python3.txt -i https://mirror.baidu.com/pypi/simple
    
  6. 执行安装脚本

    # 执行预处理步骤
    make qt5py3
    
    # 启动脚本
    python3 labelImg.py
    
posted @ 2024-03-18 20:39  冬天之歌  阅读(42)  评论(0编辑  收藏  举报