Skip to content

Commit

Permalink
remove keras and tf libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Oct 3, 2023
1 parent 3669733 commit ddae14f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
jobs:
test:
name: Unit tests
if: false # delete this line to enable automatic testing
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ FROM docker.io/python:3.11.0-slim-bullseye

LABEL org.opencontainers.image.authors="FNNDSC <[email protected]>" \
org.opencontainers.image.title="My ChRIS Plugin" \
org.opencontainers.image.description="A ChRIS plugin to do something awesome"
org.opencontainers.image.description="A ChRIS plugin to remove texts from image"

ARG SRCDIR=/usr/local/src/pl-image_textRemove
WORKDIR ${SRCDIR}

COPY requirements.txt .
RUN pip install -r requirements.txt
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y

COPY . .
ARG extras_require=none

RUN pip install ".[${extras_require}]" \
&& apt update && apt -y install ffmpeg libsm6 libxext6 \
&& cd / && rm -rf ${SRCDIR}
WORKDIR /

Expand Down
13 changes: 6 additions & 7 deletions image_textRemove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

from pathlib import Path
from argparse import ArgumentParser, Namespace, ArgumentDefaultsHelpFormatter
import matplotlib.pyplot as plt
import cv2
import math
import numpy as np
from chris_plugin import chris_plugin, PathMapper

__version__ = '0.2.1'
__version__ = '0.2.2'

DISPLAY_TITLE = r"""
_ _ _ _ ______
Expand Down Expand Up @@ -109,11 +108,11 @@ def inpaint_text(img_path, remove_all):

print("Removing fname, lname, MRN, DoB")
if remove_all:
print("Removing all texts")
import keras_ocr
pipeline = keras_ocr.pipeline.Pipeline()
# generate (word, box) tuples
box_list = pipeline.recognize([img])[0]
print("Place holder to use keras OCR(WIP)")
# import keras_ocr
# pipeline = keras_ocr.pipeline.Pipeline()
# # generate (word, box) tuples
# box_list = pipeline.recognize([img])[0]

mask = np.zeros(img.shape[:2], dtype="uint8")
for box in box_list:
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
chris_plugin==0.2.1
matplotlib
keras-ocr
tensorflow==2.12.0
opencv-python

0 comments on commit ddae14f

Please sign in to comment.