Skip to content

Speedup by using Numba CUDA #2

@bmabir17-asj

Description

@bmabir17-asj

For my use case(Large image size) the current processing takes a lot of time. I found that get_dark_channel and get_transmission functions takes a lot of time to process. Thus i decided to change the numba to use cuda by doing the below changes following this reference

@cuda.jit
    def get_dark_channel(self, radius=7):
@cuda.jit
    def get_transmission(self, radius=7, omega=0.95):

and called those as

    import sys
    hr = HazeRemoval()
    hr.open_image(sys.argv[1])
    #################### For CUDA
    # Set the number of threads in a block
    threadsperblock = 32 
    # Calculate the number of thread blocks in the grid
    blockspergrid = (hr.src.size + (threadsperblock - 1)) // threadsperblock
    ####################
    hr.get_dark_channel[blockspergrid, threadsperblock]()
    hr.get_air_light()
    hr.get_transmission[blockspergrid, threadsperblock]()
    hr.guided_filter()
    hr.recover()
    hr.show()

But i am getting the fllowing error

TypeError: Failed in nopython mode pipeline (step: fix up args)
Signature mismatch: 0 argument types given, but function takes 2 arguments

Has anyone tried to do this?

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