Skip to content

Commit

Permalink
dependencies update and minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
geramanisn committed Aug 1, 2023
1 parent 4b89422 commit 79ef41b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 26 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.10'
python-version: '3.11.3'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,6 +28,8 @@ jobs:
- name: Show coverage report
run: coverage report
- name: Run linter
run: pylint --disable=E1101 denoising_inpainting_lbp/
if: always()
run: pylint denoising_inpainting_lbp/
- name: Run type checker
run: mypy --ignore-missing-imports denoising_inpainting_lbp/
if: always()
run: mypy denoising_inpainting_lbp/
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ venv/
**/.mypy_cache
denoising_inpainting_lbp.egg-info/
*.log
*.png
!images/*.png
coverage/
docs/
scripts/
.coverage
*.png
!images/*.png
4 changes: 1 addition & 3 deletions denoising_inpainting_lbp/denoising_inpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
logger.setLevel(logging.INFO)


# pylint: disable=too-many-arguments
# pylint: disable-next=too-many-arguments
def denoise_inpaint(image_path: str,
mask_image_path: str,
n_iterations: int,
Expand Down Expand Up @@ -59,8 +59,6 @@ def denoise_inpaint(image_path: str,
logger.info('Done!')


# pylint: enable=too-many-arguments

def _loopy_belief_propagation(
observed_image: np.ndarray,
mask_image: np.ndarray,
Expand Down
4 changes: 2 additions & 2 deletions denoising_inpainting_lbp/image_damager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _add_noise(image: np.ndarray,


def _calculate_missing_part_points(
shape: Tuple[int, ...]) -> Tuple[Tuple[int, int], Tuple[int, int]]:
shape: Tuple[int, int]) -> Tuple[Tuple[int, int], Tuple[int, int]]:
"""Create the coordinates of the destroyed portion of the image."""
missing_part_height = random.randint(
int(shape[0] * IMAGE_PERCENTAGE_TO_DESTROY_LOW),
Expand All @@ -84,7 +84,7 @@ def _calculate_missing_part_points(

def _create_mask_image(
missing_part_points: Tuple[Tuple[int, int], Tuple[int, int]],
shape: Tuple[int, ...]) -> np.ndarray:
shape: Tuple[int, int]) -> np.ndarray:
"""Create the mask image.
The mask image indicates which pixels have been damaged.
Expand Down
1 change: 0 additions & 1 deletion denoising_inpainting_lbp/markov_random_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(self,

self._smoothness_cost = np.empty((self._N_LABELS, self._N_LABELS),
dtype=np.int64)

for i in range(self._N_LABELS):
for j in range(self._N_LABELS):
self._smoothness_cost[i, j] = (
Expand Down
15 changes: 7 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
opencv-python==4.7.0.72
numpy==1.24.2
matplotlib==3.7.1
pyqt5==5.15.9
pytest==7.3.0
coverage==7.2.3
pylint==2.17.2
mypy==1.2.0
opencv-python==4.8.0.74
numpy==1.25.2
matplotlib==3.7.2
pytest==7.4.0
coverage==7.2.7
pylint==2.17.5
mypy==1.4.1
9 changes: 9 additions & 0 deletions scripts/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from denoising_inpainting_lbp import image_damager
from denoising_inpainting_lbp import denoising_inpainting

image_damager.damage_image('images/boat.pnp', 0, 0.1)
denoising_inpainting.denoise_inpaint('images/house-damaged.png',
'images/house-mask.png',
1,
5,
37580519.6)
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
from setuptools import setup

setup(name='denoising_inpainting_lbp',
version='0.1.0',
version='1.0.0',
packages=['denoising_inpainting_lbp'],
author='Nick Geramanis',
author_email='[email protected]',
description=('Loopy Belief Propagation algorithm '
'for denoising and inpainting greyscale images'),
url='https://github.com/NickGeramanis/denoising-inpainting-lbp',
license='GPLV3',
python_requires='==3.10.10',
install_requires=['opencv-python==4.7.0.72',
'numpy==1.24.2',
'matplotlib==3.7.1',
'pyqt5==5.15.9'])
python_requires='==3.11.3',
install_requires=['opencv-python==4.8.0.74',
'numpy==1.25.2',
'matplotlib==3.7.2'])

0 comments on commit 79ef41b

Please sign in to comment.