Skip to content

Improve trimap_module with cython #7

@MG-Arnaud

Description

@MG-Arnaud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions