Skip to content

Commit b4540a4

Browse files
author
Luan Pham
committed
[wip] enhance
1 parent 51c41d0 commit b4540a4

8 files changed

+31
-4
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ TABLE_DETECTION_PORT=9001
22
TABLE_RECOGNITION_PORT=9002
33
TEXT_DETECTION_PORT=9003
44
TEXT_RECOGNITION_PORT=9004
5+
APP=8501

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ data
88
.ipynb_checkpoints
99
cache
1010
debug
11+
__pycache__

docker-compose.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,18 @@ services:
2929
volumes:
3030
- ./text_recognition:/code
3131
restart: always
32+
streamlit:
33+
build: streamlit/
34+
environment:
35+
- TABLE_DETECTION_PORT="${TABLE_DETECTION_PORT}"
36+
- TABLE_RECOGNITION_PORT="${TABLE_RECOGNITION_PORT}"
37+
- TEXT_DETECTION_PORT="${TEXT_DETECTION_PORT}"
38+
- TEXT_RECOGNITION_PORT="${TEXT_RECOGNITION_PORT}"
39+
ports:
40+
- "${APP}:8501"
41+
volumes:
42+
- ./streamlit:/code
43+
restart: always
44+
depends_on:
45+
- text_recognition
46+
- table_recognition

streamlit/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.7
2+
3+
WORKDIR /code
4+
5+
COPY requirements.txt /code
6+
RUN pip install -r requirements.txt
7+
8+
COPY streamlit_app.py classes.py utility.py /code/
9+
10+
EXPOSE 8501
11+
CMD ["streamlit", "run", "streamlit_app.py"]

classes.py streamlit/classes.py

File renamed without changes.
File renamed without changes.

streamlit_app.py streamlit/streamlit_app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import numpy as np
66
import pandas as pd
77
import requests
8-
import streamlit as st
9-
from dotenv import load_dotenv
10-
118
from classes import read_tables_from_list, read_texts_from_list
9+
from dotenv import load_dotenv
1210
from utility import dump_excel, get_random_color, merge_text_table
1311

12+
import streamlit as st
13+
1414
# load env var
1515
load_dotenv()
1616
TABLE_DETECTION_PORT = env["TABLE_DETECTION_PORT"]

utility.py streamlit/utility.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import cv2
77
import numpy as np
8-
98
from classes import Table, Text
109

1110

0 commit comments

Comments
 (0)