Archit Singh commited on
Commit
543c0ea
·
1 Parent(s): c6a033c

new: added dockerfile and app

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -0
  2. app.py +4 -6
  3. model.py +0 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ RUN pip install --upgrade pip
6
+ RUN pip install torch torchvision
7
+ RUN pip install -U openmim
8
+ RUN mim install mmengine
9
+ RUN mim install mmcv
10
+ RUN mim install mmdet
11
+
12
+ RUN git clone https://github.com/open-mmlab/mmocr.git
13
+ RUN cd mmocr
14
+ RUN pip install -v -e .
15
+
16
+ COPY . .
17
+
18
+ CMD ["python", "app.py"]
app.py CHANGED
@@ -1,7 +1,5 @@
1
- import streamlit as st
2
- from datasets import load_dataset
3
 
4
- dataset = load_dataset("katanaml-org/invoices-donut-data-v1")
5
- st.write(len(dataset))
6
- st.write(dir(dataset))
7
- st.write(type(dataset))
 
1
+ from mmocr.apis import MMOCRInferencer
 
2
 
3
+ infer = MMOCRInferencer(rec='svtr-small')
4
+ result = infer('demo/demo_text_recog.jpg', save_vis=True, return_vis=True)
5
+ print(result['predictions'])
 
model.py DELETED
File without changes