diff --git a/Dockerfile b/Dockerfile index bacfc3b2..325ee79b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,8 @@ FROM node:10 as build-stage WORKDIR /workspace/ COPY ./client /workspace/client -RUN npm install -g --quiet \ - @vue/cli@3.3.0 \ - @vue/cli-service@3.3.0 +RUN npm install -g @vue/cli@3.3.0 +RUN npm install -g @vue/cli-service@3.3.0 COPY ./client/package* /workspace/ @@ -29,4 +28,3 @@ ENV DEBUG=false EXPOSE 5000 CMD gunicorn -c webserver/gunicorn_config.py webserver:app --no-sendfile --timeout 180 - diff --git a/backend/Dockerfile b/backend/Dockerfile index 1ec98c3f..a30d67d4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,8 @@ # Backend environment docker image -FROM python:3.6 +FROM tensorflow/tensorflow:1.14.0-gpu-py3 + +RUN apt-get update +RUN apt-get install -y git WORKDIR /workspace/ @@ -12,14 +15,13 @@ RUN pip install -r requirements.txt && \ pip install pycocotools # Install maskrcnn -RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn && \ - cd /tmp/maskrcnn && \ - pip install -r requirements.txt && \ - python3 setup.py install +RUN git clone --single-branch --depth 1 https://github.com/matterport/Mask_RCNN.git /tmp/maskrcnn +#RUN cd /tmp/maskrcnn && pip install -r requirements.txt +RUN cd /tmp/maskrcnn && python3 setup.py install # Install DEXTR RUN git clone --single --depth 1 https://github.com/jsbroks/dextr-keras.git /tmp/dextr && \ cd /tmp/dextr && \ - pip install -r requirements.txt && \ python setup.py install +RUN apt-get -y -o Dpkg::Options::="--force-confmiss" install --reinstall netbase diff --git a/backend/requirements.txt b/backend/requirements.txt index cd431702..d1e54e30 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -16,3 +16,12 @@ pytest-ordering==0.6 imantics==0.1.9 flask-socketio==3.3.2 celery==4.2.2 + +scipy +Pillow +matplotlib +keras==2.1.1 +h5py +imgaug +IPython[all] +jupyter diff --git a/build_gpu.sh b/build_gpu.sh new file mode 100755 index 00000000..587389b3 --- /dev/null +++ b/build_gpu.sh @@ -0,0 +1,3 @@ +docker build -f ./backend/Dockerfile . -t jsbroks/coco-annotator:python-env --no-cache +docker build . -t annotator_webclient_gpu --no-cache +docker build -f ./backend/workers/Dockerfile . -t annotator_workers_gpu --no-cache diff --git a/db/.gitkeep b/db/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docker-compose.gpu.yml b/docker-compose.gpu.yml new file mode 100644 index 00000000..5b6bcdd4 --- /dev/null +++ b/docker-compose.gpu.yml @@ -0,0 +1,83 @@ +version: "3" + +networks: + cocoannotator: + external: false + +services: + webserver: + image: annotator_webclient_gpu + container_name: annotator_webclient + restart: "no" + ports: + - "5000:5000" + environment: + - SECRET_KEY=RandomSecretKeyHere + - FILE_WATCHER=true + - NAME=Test Annotator + - MASK_RCNN_FILE=/models/mask_rcnn_coco.h5 + # # Default coco classes (order matters) + - MASK_RCNN_CLASSES= + BG,person,bicycle,car,motorcycle,airplane, + bus,train,truck,boat,traffic light, + fire hydrant,stop sign,parking meter,bench,bird, + cat,dog,horse,sheep,cow,elephant,bear, + zebra,giraffe,backpack,umbrella,handbag,tie, + suitcase,frisbee,skis,snowboard,sports ball, + kite,baseball bat,baseball glove,skateboard, + surfboard,tennis racket,bottle,wine glass,cup, + fork,knife,spoon,bowl,banana',apple, + sandwich,orange,broccoli,carrot,hot dog,pizza, + donut,cake,chair,couch,potted plant,bed, + dining table,toilet,tv,laptop,mouse,remote, + keyboard,cell phone,microwave,oven,toaster, + sink,refrigerator,book,clock,vase,scissors, + teddy bear,hair drier,toothbrush + volumes: + - "./datasets:/datasets" + - "./models:/models" + depends_on: + - database + - workers + networks: + - cocoannotator + workers: + container_name: annotator_workers + image: annotator_workers_gpu + volumes: + - "./backend/config:/workspace/config" + - "./backend/webserver:/workspace/webserver" + - "./backend/workers:/workspace/workers" + - "./backend/database:/workspace/database" + - "./datasets:/datasets" + depends_on: + - messageq + - database + ports: + - 5555:5555 + networks: + - cocoannotator + messageq: + image: rabbitmq:3 + container_name: annotator_message_q + environment: + - RABBITMQ_DEFAULT_USER=user + - RABBITMQ_DEFAULT_PASS=password + ports: + - 5672:5672 + networks: + - cocoannotator + database: + image: mongo:4.0 + container_name: annotator_mongodb + restart: "no" + environment: + - MONGO_DATA_DIR=/data/db + - MONGO_LOG_DIR=/dev/null + volumes: + - "./db:/data/db" + ports: + - "27017:27017" + command: "mongod --smallfiles --logpath=/dev/null" + networks: + - cocoannotator