Skip to content

Commit 43f2d0c

Browse files
authoredFeb 3, 2020
gpu support (#326)
* gpu support * remove duplicate packages * modifications for npm * works without registry modification on other network
1 parent 1bd9acc commit 43f2d0c

File tree

6 files changed

+105
-10
lines changed

6 files changed

+105
-10
lines changed
 

‎Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ FROM node:10 as build-stage
33
WORKDIR /workspace/
44
COPY ./client /workspace/client
55

6-
RUN npm install -g --quiet \
7-
@vue/cli@3.3.0 \
8-
@vue/cli-service@3.3.0
6+
RUN npm install -g @vue/cli@3.3.0
7+
RUN npm install -g @vue/cli-service@3.3.0
98

109
COPY ./client/package* /workspace/
1110

@@ -29,4 +28,3 @@ ENV DEBUG=false
2928

3029
EXPOSE 5000
3130
CMD gunicorn -c webserver/gunicorn_config.py webserver:app --no-sendfile --timeout 180
32-

‎backend/Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Backend environment docker image
2-
FROM python:3.6
2+
FROM tensorflow/tensorflow:1.14.0-gpu-py3
3+
4+
RUN apt-get update
5+
RUN apt-get install -y git
36

47
WORKDIR /workspace/
58

@@ -12,14 +15,13 @@ RUN pip install -r requirements.txt && \
1215
pip install pycocotools
1316

1417
# Install maskrcnn
15-
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \
16-
cd /tmp/maskrcnn && \
17-
pip install -r requirements.txt && \
18-
python3 setup.py install
18+
RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn
19+
#RUN cd /tmp/maskrcnn && pip install -r requirements.txt
20+
RUN cd /tmp/maskrcnn && python3 setup.py install
1921

2022
# Install DEXTR
2123
RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \
2224
cd /tmp/dextr && \
23-
pip install -r requirements.txt && \
2425
python setup.py install
2526

27+
RUN apt-get -y -o Dpkg::Options::="--force-confmiss" install --reinstall netbase

‎backend/requirements.txt

+9
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ pytest-ordering==0.6
1616
imantics==0.1.9
1717
flask-socketio==3.3.2
1818
celery==4.2.2
19+
20+
scipy
21+
Pillow
22+
matplotlib
23+
keras==2.1.1
24+
h5py
25+
imgaug
26+
IPython[all]
27+
jupyter

‎build_gpu.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker build -f ./backend/Dockerfile . -t jsbroks/coco-annotator:python-env --no-cache
2+
docker build . -t annotator_webclient_gpu --no-cache
3+
docker build -f ./backend/workers/Dockerfile . -t annotator_workers_gpu --no-cache

‎db/.gitkeep

Whitespace-only changes.

‎docker-compose.gpu.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
version: "3"
2+
3+
networks:
4+
cocoannotator:
5+
external: false
6+
7+
services:
8+
webserver:
9+
image: annotator_webclient_gpu
10+
container_name: annotator_webclient
11+
restart: "no"
12+
ports:
13+
- "5000:5000"
14+
environment:
15+
- SECRET_KEY=RandomSecretKeyHere
16+
- FILE_WATCHER=true
17+
- NAME=Test Annotator
18+
- MASK_RCNN_FILE=/models/mask_rcnn_coco.h5
19+
# # Default coco classes (order matters)
20+
- MASK_RCNN_CLASSES=
21+
BG,person,bicycle,car,motorcycle,airplane,
22+
bus,train,truck,boat,traffic light,
23+
fire hydrant,stop sign,parking meter,bench,bird,
24+
cat,dog,horse,sheep,cow,elephant,bear,
25+
zebra,giraffe,backpack,umbrella,handbag,tie,
26+
suitcase,frisbee,skis,snowboard,sports ball,
27+
kite,baseball bat,baseball glove,skateboard,
28+
surfboard,tennis racket,bottle,wine glass,cup,
29+
fork,knife,spoon,bowl,banana',apple,
30+
sandwich,orange,broccoli,carrot,hot dog,pizza,
31+
donut,cake,chair,couch,potted plant,bed,
32+
dining table,toilet,tv,laptop,mouse,remote,
33+
keyboard,cell phone,microwave,oven,toaster,
34+
sink,refrigerator,book,clock,vase,scissors,
35+
teddy bear,hair drier,toothbrush
36+
volumes:
37+
- "./datasets:/datasets"
38+
- "./models:/models"
39+
depends_on:
40+
- database
41+
- workers
42+
networks:
43+
- cocoannotator
44+
workers:
45+
container_name: annotator_workers
46+
image: annotator_workers_gpu
47+
volumes:
48+
- "./backend/config:/workspace/config"
49+
- "./backend/webserver:/workspace/webserver"
50+
- "./backend/workers:/workspace/workers"
51+
- "./backend/database:/workspace/database"
52+
- "./datasets:/datasets"
53+
depends_on:
54+
- messageq
55+
- database
56+
ports:
57+
- 5555:5555
58+
networks:
59+
- cocoannotator
60+
messageq:
61+
image: rabbitmq:3
62+
container_name: annotator_message_q
63+
environment:
64+
- RABBITMQ_DEFAULT_USER=user
65+
- RABBITMQ_DEFAULT_PASS=password
66+
ports:
67+
- 5672:5672
68+
networks:
69+
- cocoannotator
70+
database:
71+
image: mongo:4.0
72+
container_name: annotator_mongodb
73+
restart: "no"
74+
environment:
75+
- MONGO_DATA_DIR=/data/db
76+
- MONGO_LOG_DIR=/dev/null
77+
volumes:
78+
- "./db:/data/db"
79+
ports:
80+
- "27017:27017"
81+
command: "mongod --smallfiles --logpath=/dev/null"
82+
networks:
83+
- cocoannotator

0 commit comments

Comments
 (0)
Please sign in to comment.