bipinkrish commited on
Commit
8c1124a
·
verified ·
1 Parent(s): db4babb

Upload 6 files

Browse files
Files changed (4) hide show
  1. Dockerfile +2 -9
  2. app.py +2 -2
  3. text2sign.py +1 -1
  4. text2sign.sh +23 -0
Dockerfile CHANGED
@@ -4,17 +4,10 @@ RUN apt update -y
4
  RUN apt install -y wget zip unzip
5
 
6
  COPY . .
 
7
  RUN pip3 install -r requirements.txt
8
 
9
-
10
- # Spoken 2 Sign
11
- RUN pip3 install --pre -f https://dist.mxnet.io/python 'mxnet==2.0.0b20220206'
12
-
13
- RUN wget https://github.com/SignBridgeApp/models/releases/download/v0.0/spoken2symbol.zip
14
- RUN unzip spoken2symbol.zip
15
- RUN rm spoken2symbol.zip
16
- RUN apt install -y sentencepiece
17
-
18
 
19
  # Start
20
  EXPOSE 7860
 
4
  RUN apt install -y wget zip unzip
5
 
6
  COPY . .
7
+ RUN chmod 777 text2sign.sh
8
  RUN pip3 install -r requirements.txt
9
 
10
+ RUN ./text2sign.sh
 
 
 
 
 
 
 
 
11
 
12
  # Start
13
  EXPOSE 7860
app.py CHANGED
@@ -15,7 +15,7 @@ def translate_text():
15
 
16
 
17
  @route("/sign2img")
18
- def covert_text():
19
  sign = request.query.get("sign", None)
20
  if not sign:
21
  response.status_code = 400
@@ -28,7 +28,7 @@ def covert_text():
28
 
29
  @route("/")
30
  def index():
31
- return {"Server": "OK"}
32
 
33
 
34
  if __name__ == "__main__":
 
15
 
16
 
17
  @route("/sign2img")
18
+ def convert_text():
19
  sign = request.query.get("sign", None)
20
  if not sign:
21
  response.status_code = 400
 
28
 
29
  @route("/")
30
  def index():
31
+ return {"signbridge-server": "OK"}
32
 
33
 
34
  if __name__ == "__main__":
text2sign.py CHANGED
@@ -7,7 +7,7 @@ warnings.filterwarnings("ignore")
7
 
8
 
9
  DEVICE = mx.cpu()
10
- MODEL_FOLDER = "spoken2symbol"
11
  SPM_PATH = MODEL_FOLDER + "/spm.model"
12
 
13
 
 
7
 
8
 
9
  DEVICE = mx.cpu()
10
+ MODEL_FOLDER = "text2sign"
11
  SPM_PATH = MODEL_FOLDER + "/spm.model"
12
 
13
 
text2sign.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ URL="https://github.com/SignBridgeApp/models/releases/download/v0.0/text2sign.zip"
4
+ ZIP_FILE="text2sign.zip"
5
+ TARGET_DIR="text2sign"
6
+
7
+ if [ ! -d "$TARGET_DIR" ]; then
8
+ echo "Downloading and extracting $ZIP_FILE..."
9
+
10
+ if [ ! -d "$ZIP_FILE" ]; then
11
+ wget -q "$URL"
12
+ else
13
+ echo "Zip $ZIP_FILE already exists. Skipping download."
14
+ fi
15
+
16
+ unzip -q "$ZIP_FILE" && rm "$ZIP_FILE"
17
+ fi
18
+ else
19
+ echo "Directory $TARGET_DIR already exists. Skipping download and extraction."
20
+ fi
21
+
22
+ pip3 install --pre -f https://dist.mxnet.io/python 'mxnet==2.0.0b20220206'
23
+ apt install -y sentencepiece