diff --git a/Dockerfile b/Dockerfile index f4706de..6c34f97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Python version can be changed, e.g. # FROM python:3.8 # FROM docker.io/fnndsc/conda:python3.10.2-cuda11.6.0 -FROM docker.io/python:3.11.3-slim-bullseye +FROM docker.io/python:3.11.0-slim-bullseye LABEL org.opencontainers.image.authors="FNNDSC " \ org.opencontainers.image.title="My ChRIS Plugin" \ @@ -15,8 +15,9 @@ RUN pip install -r requirements.txt COPY . . ARG extras_require=none -RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y + RUN pip install ".[${extras_require}]" \ + && apt update && apt -y install ffmpeg libsm6 libxext6 \ && cd / && rm -rf ${SRCDIR} WORKDIR / diff --git a/app.py b/app.py index 521c993..56999ac 100755 --- a/app.py +++ b/app.py @@ -56,14 +56,11 @@ def main(options: Namespace, inputdir: Path, outputdir: Path): # # Refer to the documentation for more options, examples, and advanced uses e.g. # adding a progress bar and parallelism. - mapper = PathMapper.file_mapper(inputdir, outputdir, glob=options.pattern, suffix='.count.txt') + mapper = PathMapper.file_mapper(inputdir, outputdir, glob="dcm") for input_file, output_file in mapper: # The code block below is a small and easy example of how to use a ``PathMapper``. # It is recommended that you put your functionality in a helper function, so that # it is more legible and can be unit tested. - data = input_file.read_text() - frequency = data.count(options.word) - output_file.write_text(str(frequency)) pipeline = keras_ocr.pipeline.Pipeline() final_image = inpaint_text(input_file, pipeline) img_rgb = cv2.cvtColor(final_image, cv2.COLOR_BGR2RGB) diff --git a/requirements.txt b/requirements.txt index f11a414..0d4aaf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ chris_plugin==0.2.1 matplotlib -keras_ocr -tensorflow +keras-ocr +tensorflow==2.12.0 +opencv-python