Skip to content

Commit 77438bf

Browse files
authored
Update lib download to point at invoke-ai, and to be a bit more forgiving (#1)
* Cleaning up lib download * Add patchmatch_available and clean up failed library load * Further code cleanup * Update version string to match tag * Update docs
1 parent 4d55a64 commit 77438bf

File tree

4 files changed

+216
-186
lines changed

4 files changed

+216
-186
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
/patchmatch/*.so
33
__pycache__
44
*.py[cod]
5+
.scratch/
6+
*.dll
7+
*.so

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
PatchMatch based Inpainting
2-
=====================================
1+
# PatchMatch based Inpainting
32
This library implements the PatchMatch based inpainting algorithm. It provides both C++ and Python interfaces.
43
This implementation is heavily based on the implementation by Younesse ANDAM:
5-
(younesse-cv/PatchMatch)[https://github.com/younesse-cv/PatchMatch], with some bugs fix.
4+
(younesse-cv/PatchMatch)[https://github.com/younesse-cv/PatchMatch], with some bug fixes, and updates.
65

7-
Usage
8-
-------------------------------------
6+
## Usage
97

108
You need to first install OpenCV to compile the C++ libraries. Then, run `make` to compile the
119
shared library `libpatchmatch.so`.
@@ -15,9 +13,10 @@ For Python users (example available at `examples/py_example.py`)
1513
```python
1614
import patch_match
1715

18-
image = ... # either a numpy ndarray or a PIL Image object.
19-
mask = ... # either a numpy ndarray or a PIL Image object.
20-
result = patch_match.inpaint(image, mask, patch_size=5)
16+
if patch_match.patchmatch_available:
17+
image = ... # either a numpy ndarray or a PIL Image object.
18+
mask = ... # either a numpy ndarray or a PIL Image object.
19+
result = patch_match.inpaint(image, mask, patch_size=3)
2120
```
2221

2322
For C++ users (examples available at `examples/cpp_example.cpp`)
@@ -36,8 +35,7 @@ int main() {
3635
```
3736

3837

39-
README and COPYRIGHT by Younesse ANDAM
40-
-------------------------------------
38+
## README and COPYRIGHT by Younesse ANDAM
4139
@Author: Younesse ANDAM
4240

4341
@Contact: younesse.andam@gmail.com
@@ -55,10 +53,8 @@ The algorithm is presented in the following paper
5553
Copyright (c) 2010-2011
5654

5755

58-
Requirements
59-
-------------------------------------
56+
## Requirements
6057

6158
To run the project you need to install Opencv library and link it to your project.
6259
Opencv can be download it here
6360
http://opencv.org/downloads.html
64-

0 commit comments

Comments
 (0)