Spaces:
Sleeping
Sleeping
Upload 13 files
Browse files- Dockerfile +0 -2
- app.py +1 -9
- gloss2pose.sh +0 -1
Dockerfile
CHANGED
@@ -11,8 +11,6 @@ RUN ./gloss2sign.sh
|
|
11 |
RUN ./text2gloss.sh
|
12 |
RUN ./gloss2pose.sh
|
13 |
|
14 |
-
RUN chmod 777 / .
|
15 |
-
|
16 |
# Start
|
17 |
EXPOSE 7860
|
18 |
CMD ["python3", "app.py"]
|
|
|
11 |
RUN ./text2gloss.sh
|
12 |
RUN ./gloss2pose.sh
|
13 |
|
|
|
|
|
14 |
# Start
|
15 |
EXPOSE 7860
|
16 |
CMD ["python3", "app.py"]
|
app.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
import warnings
|
2 |
from time import time
|
3 |
-
import uuid
|
4 |
-
import os
|
5 |
import base64
|
6 |
from bottle import route, run, request, response
|
7 |
import spacy
|
@@ -144,13 +142,7 @@ def make_pose():
|
|
144 |
|
145 |
gloss2pose.scale_down(pose, 512)
|
146 |
p = PoseVisualizer(pose, thickness=2)
|
147 |
-
|
148 |
-
unqid = str(uuid.uuid4()) + ".png"
|
149 |
-
p.save_png(unqid, p.draw(transparency=True))
|
150 |
-
|
151 |
-
with open(unqid, "rb") as f:
|
152 |
-
img = f.read()
|
153 |
-
os.remove(unqid)
|
154 |
|
155 |
img_base64 = base64.b64encode(img).decode('utf-8')
|
156 |
return {"img": img_base64, "words": words, "time-taken": time() - start}
|
|
|
1 |
import warnings
|
2 |
from time import time
|
|
|
|
|
3 |
import base64
|
4 |
from bottle import route, run, request, response
|
5 |
import spacy
|
|
|
142 |
|
143 |
gloss2pose.scale_down(pose, 512)
|
144 |
p = PoseVisualizer(pose, thickness=2)
|
145 |
+
img = p.save_png(None, p.draw(transparency=True))
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
img_base64 = base64.b64encode(img).decode('utf-8')
|
148 |
return {"img": img_base64, "words": words, "time-taken": time() - start}
|
gloss2pose.sh
CHANGED
@@ -25,4 +25,3 @@ rm -rf pose-all/
|
|
25 |
|
26 |
apt install -y libgl1-mesa-glx
|
27 |
ldconfig
|
28 |
-
find / -name "libGL.so.1" 2>/dev/null
|
|
|
25 |
|
26 |
apt install -y libgl1-mesa-glx
|
27 |
ldconfig
|
|