复现activitynet2016未剪辑视频分类冠军算法模型:

代码链接:https://github.com/yjxiong/anet2016-cuhk

系统:ubuntu

装上unzip和cmake

复现activitynet2016未剪辑视频分类冠军算法模型:https://github.com/yjxiong/anet2016-cuhk

主要通过脚本安装https://github.com/yjxiong/anet2016-cuhk/blob/master/build_all.sh

环境准备如下:

  1. 安装anaconda
  2. 安装caffe
  3. 安装tensorflow
  4. 安装opencv

脚本有一些地方运行不了,整理的之后步骤如下:

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101



#!/usr/bin/env bash
# TODO: add compilation steps

# update the submodules: Caffe and Dense Flow
git submodule update --remote

# install Caffe dependencies
sudo apt-get -qq install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev
不对!!!!!!!!!!sudo apt-get -qq install --no-install-recommends libboost1.55-all-dev
改成sudo apt-get -qq install --no-install-recommends libboost-all-dev
sudo apt-get -qq install libgflags-dev libgoogle-glog-dev liblmdb-dev

# install Dense_Flow dependencies
sudo apt-get -qq install libzip-dev

# install common dependencies: OpenCV
# adpated from OpenCV.sh
version="2.4.13"

echo "Building OpenCV" $version
mkdir 3rd-party/
cd 3rd-party/

echo "Installing Dependenices"
不对!!!!!!!!!sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils

改成sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils

echo "Downloading OpenCV" $version

echo "Installing OpenCV" $version
unzip OpenCV-$version.zip
cd opencv-$version
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

!!!!!!!!!!
在这里Makefile.config加入:
LINKFLAGS := -Wl,-rpath,/root/anaconda3/lib
!!!!!!!!!!
??????????cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D BUILD_TIFF=ON -D WITH_OPENGL=ON..

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D BUILD_TIFF=ON ..

cp lib/cv2.so ../../../
echo "OpenCV" $version "built"

# build dense_flow
cd ../../../

echo "Building Dense Flow"
cd lib/dense_flow
mkdir build
cd build
OpenCV_DIR=../../../3rd-party/opencv-$version/build/ cmake .. -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF
make -j
!!!!!!!!需要下载
echo "Dense Flow built"

https://github.com/jaejunlee0538/openfabmap/issues/3


# build caffe
echo "Building Caffe"
cd ../../caffe-action
mkdir build
cd build
OpenCV_DIR=../../../3rd-party/opencv-$version/build/ cmake .. -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF

!!!!!!!!!!!!!!!改成
OpenCV_DIR=../../../3rd-party/opencv-$version/build/ cmake .. -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF -D BUILD_TIFF=ON
然后如果你装了anaconda包的话,删除anaconda/lib/下面的 libm https://blog.csdn.net/ccemmawatson/article/details/42004105
sudo rm -rf libm*

make -j32
echo "Caffe Built"
cd ../../../

# install python packages
pip install -r py_requirements.txt

# setup for web demo
mkdir tmp

# copy website files to the folder
wget -O 3rd-party/bootstrap-fileinput.zip https://github.com/kartik-v/bootstrap-fileinput/zipball/master
cd 3rd-party
unzip bootstrap-fileinput.zip
mv kartik-v-bootstrap-* Bootstrap-fileinput

!!!!!!!!!!!cannot move 'kartik-v-bootstrap-fileinput-61c9523' to 'Bootstrap-fileinput/kartik-v-bootstrap-fileinput-61c9523': Directory not empty

cp -r Bootstrap-fileinput/js ../static/js
cp Bootstrap-fileinput/css/* ../static/css/


export ANET_HOME=/root/anet2016-cuhk

Comments

⬆︎TOP