forked from DayBreak-u/chineseocr_lite
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DayBreak-u#219 from Pad0y/master
fixed dbnet OOM and rewrite Dockerfile
- Loading branch information
Showing
12 changed files
with
258 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Python template | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
FROM python:3.6 | ||
ENV LANG C.UTF-8 | ||
FROM centos:7.2.1511 | ||
|
||
COPY . /chineseocr_lite | ||
LABEL Author="Pad0y<github.com/Pad0y>" | ||
|
||
WORKDIR /chineseocr_lite | ||
ENV LANG C.UTF-8 LC_ALL=C.UTF-8 | ||
|
||
RUN PIP_INSTALL="pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/" && \ | ||
$PIP_INSTALL \ | ||
torch==1.2.0 \ | ||
torchvision==0.4.0 \ | ||
&& \ | ||
$PIP_INSTALL -r requirements.txt | ||
COPY . /data/project/ | ||
WORKDIR /data/project/ | ||
|
||
CMD python app.py 8080 | ||
RUN yum -y update \ | ||
&& yum -y install gcc gcc-c++ wget make git libSM-1.2.2-2.el7.x86_64 libXrender libXext\ | ||
&& yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel \ | ||
&& yum -y install python3-devel centos-release-scl scl-utils-build \ | ||
&& yum -y install devtoolset-7-gcc* \ | ||
&& echo 'source /opt/rh/devtoolset-7/enable' >> ~/.bash_profile \ | ||
&& source ~/.bash_profile \ | ||
&& scl enable devtoolset-7 bash | ||
|
||
|
||
RUN pip3 install --user -U pip -i https://pypi.tuna.tsinghua.edu.cn/simple/ \ | ||
&& pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ | ||
|
||
|
||
RUN source ~/.bash_profile && pip3 install -r requirements.txt \ | ||
&& pip3 install ./resource/torch-1.2.0+cpu-cp36-cp36m-manylinux1_x86_64.whl \ | ||
&& pip3 install ./resource/torchvision-0.4.0+cpu-cp36-cp36m-manylinux1_x86_64.whl | ||
|
||
RUN source ~/.bash_profile && cd ./psenet/pse && make clean && make | ||
RUN yum clean all && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /data/project/resource | ||
|
||
EXPOSE 5000 | ||
EXPOSE 8000 | ||
|
||
CMD python3 flask_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.