Skip to content

Commit 86efba1

Browse files
updates for clams 1.0.0
1 parent 912c085 commit 86efba1

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

Dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
FROM python:3.6-slim-buster
2-
3-
# Additional required files for openCV
4-
RUN apt-get update
5-
RUN apt-get install ffmpeg libsm6 libxext6 -y
1+
FROM ghcr.io/clamsproject/clams-python-opencv4:1.0.0
62

73
WORKDIR ./app
84

@@ -12,4 +8,4 @@ RUN pip install -r requirements.txt
128

139
COPY ./ ./
1410

15-
CMD ["python", "app.py"]
11+
CMD ["python", "app.py"]

requirements.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
spacy==2.3.2
2-
lapps==0.0.2
3-
clams-python==0.5.0
4-
opencv-python==4.4.0.44
2+
clams-python==1.0.0

utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def get_boxes(mmif):
120120
def get_document_type_short_form(document):
121121
"""Returns 'Video', 'Text', 'Audio' or 'Image' from the document type of
122122
the document."""
123-
document_type = os.path.split(str(document.at_type))[1]
123+
# Remove trailing "/v1" in newer @types
124+
at_type = re.sub(r"\/v\d*$", "", str(document.at_type))
125+
document_type = os.path.split(at_type)[1]
124126
return document_type[:-8]
125127

126128

@@ -235,7 +237,6 @@ def get_alignment_views(mmif):
235237
# Remder Media as HTML ------------
236238

237239
def html_video(vpath, vtt_srcview=None):
238-
print(vpath)
239240
vpath = url2posix(vpath)
240241
html = StringIO()
241242
html.write('<video id="vid" controls>\n')
@@ -311,7 +312,6 @@ def check_view_alignment(annotations):
311312
anno_stack.append(annotation.id)
312313
if len(anno_stack) == 3:
313314
if not (anno_stack[0]["source"] in anno_stack and anno_stack[0]["target"] in anno_stack):
314-
print(anno_stack)
315315
return False
316316
anno_stack = []
317317
return True

0 commit comments

Comments
 (0)