Perilon commited on
Commit
bdf78b8
·
1 Parent(s): fcc772b
Files changed (3) hide show
  1. Dockerfile +1 -2
  2. get_transcription_with_amazon.py +6 -6
  3. pig.txt +1 -1
Dockerfile CHANGED
@@ -40,5 +40,4 @@ RUN ls -la /app && \
40
  which gunicorn && \
41
  pip list
42
 
43
- # Run with flask development server instead of gunicorn for simplicity
44
- CMD ["python", "/app/flask_app.py"]
 
40
  which gunicorn && \
41
  pip list
42
 
43
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "flask_app:app"]
 
get_transcription_with_amazon.py CHANGED
@@ -1,5 +1,6 @@
1
  #!/usr/bin/env python3
2
 
 
3
  import boto3
4
  import json
5
  import os
@@ -140,12 +141,11 @@ def get_word_timestamps(video_path: str) -> List[Dict[str, str]]:
140
  cleanup_files(audio_path, s3_path)
141
 
142
  def main() -> None:
143
- base_dir = os.path.join(
144
- str(pathlib.Path.home()),
145
- "andrew_messaround",
146
- "vsl_speech_to_signing_alignment",
147
- "boundary_annotation_webapp"
148
- )
149
  video_filename = args.video_id + ".mp4" # Source video file (with .mp4)
150
  video_path = os.path.join(base_dir, "data", "videos", video_filename)
151
 
 
1
  #!/usr/bin/env python3
2
 
3
+ import argparse
4
  import boto3
5
  import json
6
  import os
 
141
  cleanup_files(audio_path, s3_path)
142
 
143
  def main() -> None:
144
+ parser = argparse.ArgumentParser(description="Get word-level timestamps using Amazon Transcribe")
145
+ parser.add_argument("video_id", help="Video ID to transcribe")
146
+ args = parser.parse_args()
147
+
148
+ base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
 
149
  video_filename = args.video_id + ".mp4" # Source video file (with .mp4)
150
  video_path = os.path.join(base_dir, "data", "videos", video_filename)
151
 
pig.txt CHANGED
@@ -115,7 +115,7 @@ Building webapp
115
  2 warnings found (use docker --debug to expand):
116
   - SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "SECRET_KEY") (line 25)
117
  - SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "BYPASS_AUTH") (line 24)
118
- Recreating 3aed3e7bb19b_vsl_boundary_annotation_and_alignment_tool_webapp_1 ...
119
 
120
  ERROR: for 3aed3e7bb19b_vsl_boundary_annotation_and_alignment_tool_webapp_1 'ContainerConfig'
121
 
 
115
  2 warnings found (use docker --debug to expand):
116
   - SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "SECRET_KEY") (line 25)
117
  - SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "BYPASS_AUTH") (line 24)
118
+ Recreating 3aed3e7bb19b_vsl_boundary_annotation_and_alignment_tool_webapp_1 ...
119
 
120
  ERROR: for 3aed3e7bb19b_vsl_boundary_annotation_and_alignment_tool_webapp_1 'ContainerConfig'
121