Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pkl
37 changes: 37 additions & 0 deletions Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:18.04

WORKDIR /usr/src/app

ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PIP_NO_CACHE_DIR="false" PYTHONPATH="/usr/src/app/lib"

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python python-pip python-dev ffmpeg \
git gcc g++ build-essential cmake make pkg-config libatlas-base-dev gfortran unzip liblmdb-dev \
libgoogle-glog-dev \
libgtest-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libopenmpi-dev \
libsnappy-dev \
libprotobuf-dev \
protobuf-compiler \
libgflags-dev \
&& \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

RUN python -m pip install pip==19.2.3 setuptools==41.2.0 pip-tools==4.1.0 && \
python -m piptools sync

RUN git clone --recurse-submodules -j $(nproc) https://github.com/pytorch/pytorch.git && \
cd pytorch && \
git checkout 1eaa9f8 && \
git submodule update && \
USE_OPENCV=1 USE_FFMPEG=1 USE_LMDB=1 python setup.py install && \
cd .. && \
rm -rf pytorch

COPY . .
37 changes: 37 additions & 0 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM nvidia/cuda:10.1-cudnn7-runtime

WORKDIR /usr/src/app

ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PIP_NO_CACHE_DIR="false" PYTHONPATH="/usr/src/app/lib"

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python python-pip python-dev ffmpeg \
git gcc g++ build-essential cmake make pkg-config libatlas-base-dev gfortran unzip liblmdb-dev \
libgoogle-glog-dev \
libgtest-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libopenmpi-dev \
libsnappy-dev \
libprotobuf-dev \
protobuf-compiler \
libgflags-dev \
&& \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

RUN python -m pip install pip==19.2.3 setuptools==41.2.0 pip-tools==4.1.0 && \
python -m piptools sync

RUN git clone --recurse-submodules -j $(nproc) https://github.com/pytorch/pytorch.git && \
cd pytorch && \
git checkout 1eaa9f8 && \
git submodule update && \
USE_OPENCV=1 USE_FFMPEG=1 USE_LMDB=1 python setup.py install && \
cd .. && \
rm -rf pytorch

COPY . .
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
dockerimage ?= facebookresearch/vmz
dockerfile ?= Dockerfile.cpu
srcdir ?= $(shell pwd)
datadir ?= $(shell pwd)

install:
@docker build -t $(dockerimage) -f $(dockerfile) .

i: install


update:
@docker build -t $(dockerimage) -f $(dockerfile) . --pull --no-cache

u: update


run:
@docker run -it --rm --ipc=host -v $(srcdir):/usr/src/app -v $(datadir):/data --entrypoint=/bin/bash $(dockerimage)

r: run


gpu:
@docker run --runtime=nvidia -it --rm --ipc=host -v $(srcdir):/usr/src/app -v $(datadir):/data --entrypoint=/bin/bash $(dockerimage)

g: gpu


.PHONY: install i run r update u gpu g
22 changes: 22 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
numpy
opencv-contrib-python-headless
lmdb
flask
future
graphviz
hypothesis
jupyter
matplotlib
protobuf
pydot
python-nvd3
pyyaml
requests
scikit-image
scipy
six
tornado
pandas
sklearn
h5py
typing
Loading