Browse Source

Merge branch 'feature/dlib' of lyq/openface-docker into master

liuyuqi 6 years ago
parent
commit
115ebfa315
6 changed files with 85 additions and 1 deletions
  1. 13 0
      .dockerignore
  2. 35 0
      Dockerfile
  3. 15 1
      README.md
  4. 10 0
      docker-compose.debug.yml
  5. 8 0
      docker-compose.yml
  6. 4 0
      requirements.txt

+ 13 - 0
.dockerignore

@@ -0,0 +1,13 @@
+node_modules
+npm-debug.log
+Dockerfile*
+docker-compose*
+.dockerignore
+.git
+.gitignore
+.env
+*/bin
+*/obj
+README.md
+LICENSE
+.vscode

+ 35 - 0
Dockerfile

@@ -0,0 +1,35 @@
+FROM daocloud.io/library/ubuntu:12.10
+
+LABEL Name=openface-docker Version=0.0.1
+EXPOSE 3000
+
+ENV ENV PATH="/workdir/frameworks/torch/src/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/cuda/bin"
+
+RUN apt-get update --fix-missing
+RUN apt-get -y install curl wget python python-numpy python-scipy python-dev python-pip git-core vim
+
+WORKDIR /app
+ADD . /app
+
+RUN mkdir -p ~/.pip
+RUN echo -e '\n\
+    [global] \n\
+    trusted-host=mirrors.aliyun.com \n\
+    index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
+    ' > ~/.pip/pip.conf
+
+RUN apt-get -y install libboost-python-dev cmake
+RUN pip install dlib
+
+# 暂时不要
+# RUN apt-get install git
+# RUN git clone --recursive https://github.com/cmusatyalab/openface.git src
+# RUN cd src; git checkout 0.2.1
+# RUN python setup.py install
+
+RUN python3 -m pip install -r requirements.txt
+
+RUN make clean 
+RUN rm -rf ~/.cache/pip
+
+# CMD ["python3", "-m", "openface-docker"]

+ 15 - 1
README.md

@@ -1,3 +1,17 @@
 # openface-docker
 
-openface人脸识别docker容器。
+openface人脸识别docker容器。由于windows中需要安装Cmake等繁琐手续,所以直接提供完好的docker环境。docker pull 即可服用。
+
+```
+docker pull hub.tencentyun.com/google/openface
+```
+
+```
+docker run -it hub.tencentyun.com/google/openface python
+
+
+
+improt cv2
+import dlib
+import openface
+```

+ 10 - 0
docker-compose.debug.yml

@@ -0,0 +1,10 @@
+version: '2.1'
+
+services:
+  openface-docker:
+    image: openface-docker
+    build:
+      context: .
+      dockerfile: Dockerfile
+    ports:
+      - 3000:3000

+ 8 - 0
docker-compose.yml

@@ -0,0 +1,8 @@
+version: '2.1'
+
+services:
+  openface-docker:
+    image: openface-docker
+    build: .
+    ports:
+      - 3000:3000

+ 4 - 0
requirements.txt

@@ -0,0 +1,4 @@
+opencv-python
+pandas
+tensorflow
+numpy