napatswift commited on
Commit
64c406a
1 Parent(s): 63f4c57
Files changed (3) hide show
  1. Dockerfile +31 -0
  2. app.py +1 -0
  3. requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
6
+ WORKDIR /code
7
+
8
+ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
9
+ COPY ./requirements.txt /code/requirements.txt
10
+
11
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
+ RUN pip install openmim
13
+ RUN mim install -U mmengine 'mmcv>=2.0.0rc1'
14
+ RUN pip install 'mmdet>=3.0.0rc0' 'mmocr>=1.0.0rc0'
15
+
16
+ # Set up a new user named "user" with user ID 1000
17
+ RUN useradd -m -u 1000 user
18
+ # Switch to the "user" user
19
+ USER user
20
+ # Set home to the user's home directory
21
+ ENV HOME=/home/user \
22
+ PATH=/home/user/.local/bin:$PATH
23
+
24
+ # Set the working directory to the user's home directory
25
+ WORKDIR $HOME/app
26
+
27
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
28
+ COPY --chown=user . $HOME/app
29
+ RUN ls
30
+
31
+ CMD ["python", "main.py"]
app.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from mmocr.ocr import MMOCR
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio