Skip to content
Snippets Groups Projects
Commit 42c48c95 authored by venkata kolagotla's avatar venkata kolagotla :alien:
Browse files

Add docker file, fix protobuf conflict in CI/install

parent 4abda18e
No related branches found
No related tags found
1 merge request!8Add docker file, fix protobuf conflict in CI/install
......@@ -26,7 +26,6 @@ pytest:
script:
- pip install --upgrade pip
- python setup.py install
- pip install protobuf==3.20.0
- pip install pytest==5.3.2 pytest-cov==2.8.1
- pytest --cov-report term-missing --cov=unagi
......
# Use the python:3.8 base image
FROM python:3.8
# Set the working directory to /app
WORKDIR /app
# Copy the entire project into the Docker image
COPY . /app
# Install the necessary dependencies for each stage
RUN pip install --upgrade pip
# formatting check dependencies
RUN pip install pylama==8.4.1 pycodestyle==2.11.1 black=23.10.1
# type check dependencies
RUN pip install mypy==1.5.1
# test dependencies
RUN pip install pytest==5.3.2 pytest-cov==2.8.1
# docs dependencies
RUN pip install -r docs/requirements.txt
# install the UNAGI package
RUN pip install .
# Cleanup unnecessary files
RUN rm -rf .git
# Specify a non-root user
RUN useradd -m unagi_user
USER unagi_user
# Set the entry point to run the tests
ENTRYPOINT ["pytest", "--cov-report", "term-missing", "--cov=unagi"]
......@@ -8,3 +8,4 @@ Augmentor==0.2.3
Pillow==8.3.1
numpy==1.19.5
six==1.16.0
protobuf==3.20.0 # for tf version conflict
......@@ -10,7 +10,7 @@ with open("requirements.txt") as f:
setuptools.setup(
name="unagi",
version="0.4.2",
version="0.4.3",
author="Venkata Kolagotla",
author_email="vkolagotla@pm.me",
description="A package to perform U-net binarization on doc images",
......
......@@ -86,7 +86,7 @@ class ImageProcessor:
curr_x = 0
while (curr_x + self.size_x) <= max_x:
parts.append(
img[curr_y: curr_y + self.size_y, curr_x: curr_x + self.size_x] # noqa
img[curr_y: curr_y + self.size_y, curr_x: curr_x + self.size_x] # fmt: skip # noqa
)
curr_x += self.step_x
curr_y += self.step_y
......
from . import (augmentor_utils, callback_utils, img_processing_utils,
metric_utils, model_utils,)
from . import (
augmentor_utils,
callback_utils,
img_processing_utils,
metric_utils,
model_utils,
)
......@@ -174,7 +174,7 @@ class ImageUtils:
while (curr_y + size_y) <= max_y:
curr_x = 0
while (curr_x + size_x) <= max_x:
parts.append(img[curr_y : curr_y + size_y, curr_x : curr_x + size_x]) # noqa
parts.append(img[curr_y : curr_y + size_y, curr_x : curr_x + size_x]) # fmt: skip # noqa
curr_x += size_x
curr_y += size_y
return parts
......@@ -221,7 +221,7 @@ class ImageUtils:
curr_x = 0
while (curr_x + size_x) <= max_x:
try:
img[curr_y : curr_y + size_y, curr_x : curr_x + size_x] = imgs[i] # noqa
img[curr_y : curr_y + size_y, curr_x : curr_x + size_x] = imgs[i] # fmt: skip # noqa
except Exception:
i -= 1
i += 1
......@@ -332,7 +332,7 @@ class ImageUtils:
parts = tmp
img = ImageUtils.combine_imgs(parts, img.shape[0], img.shape[1])
img = img[
border_y : img.shape[0] - border_y, border_x : img.shape[1] - border_x # noqa
border_y : img.shape[0] - border_y, border_x : img.shape[1] - border_x # fmt: skip # noqa
]
img = img * 255.0
img = img.astype(np.uint8)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment