行人计数—搭环境

  1. 更新安装器
    apt-get update

  2. 安装git
    apt-get install git

  3. 安装ffmpeg
    sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
    sudo apt-get update
    sudo apt-get install ffmpeg

  4. 安装opencv
    opencv安装步骤,大概花到一个小时

  5. 安装Tracking-with-darkflow
    1 - Clone this repository : git clone https://github.com/bendidi/Tracking-with-darkflow.git
    2 - Initialize all submodules: git submodule update --init --recursive
    3 - Go to darkflow directory and do in place build: python setup.py build_ext --inplace
    step3:
    提示:ImportError: No module named Cython.Build

Error: cython没安装

sudo pip install Cython --install-option="--no-cython-compile"
再执行step3, ok


  • 运行python run-file.py 之前,先做一些准备

下载tensorflow的权重文件

cd Tracking-with-darkflow/deep_sort
下载地址
tar -zxvf resource.tgz

下载yolo的权重文件

cd Tracking-with-darkflow/darkflow
mkdir bin
cd bin
wget https://pjreddie.com/media/files/yolo.weights

使用修改后git的最新配置文件

git clone https://github.com/hailigu/pedestrian-attr.git
cp ~/gongjia/pedestrian-attr/code/Tracking-with-darkflow/* Tracking-with-darkflow/

使用修改后git的最新darkflow文件

rm -rf Tracking-with-darkflow/darkflow
ln -s ~/gongjia/pedestrian-attr/code/darkflow Tracking-with-darkflow/darkflow

Error: sklearn 不能import

sudo pip install sklearn

Error: 找不到numpy.h gcc 出错
行人计数—搭环境_第1张图片
image.png

export CFLAGS=-I/usr/local/lib/python2.7/dist-packages/numpy/core/include

最后执行:
python run-file.py


https://github.com/hailigu/pedestrian-attr/tree/master/code/all-with-control

你可能感兴趣的:(行人计数—搭环境)