Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve trimap_module with cython #7

Open
MG-Arnaud opened this issue Dec 27, 2019 · 0 comments
Open

Improve trimap_module with cython #7

MG-Arnaud opened this issue Dec 27, 2019 · 0 comments

Comments

@MG-Arnaud
Copy link

MG-Arnaud commented Dec 27, 2019

Hello,

Thank you for your work, it's very useful.

I have develop a solution for the optimization part with cython.
I will share you the file to paste in folder where the trimap module is located. You need to dezip it.
And in trimap_module.py add theses lines :
from trimap.faster_remake import set_value

And replace (in trimap function) this :
for i in range(0,row):
for j in range (0,col):
if (remake[i,j] != 0 and remake[i,j] != 255):
remake[i,j] = 127
by this :
remake = np.array(set_value(remake, 127))

You can change the value if you want.

Hope that's help.

Have a good day and enjoy :)

faster_remake.cpython-36m-x86_64-linux-gnu.zip

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant