Hi, I’m new to this list and to Numba!
I have a networking class that inherits from a library (Twisted) and I don’t even think to try to jit it. In its datagramRecieved
method, I get some part of the 3D image (coming from Lidar).
I implemented primitive denoising algorithm that compares tof (“time of flight” in ns) value in current frame to some (depth) previous frames:
@njit
def filter(row, col, tof, depth, thresh, limit, db):
miss = 0
for i in range(depth + 1):
if abs(tof - db[i][row][col]) >= limit:
miss += 1
if miss > thresh:
break
return miss
Where db is initialized as nested numba.typed List[List[List[int64]]].
When a frame is received completely a FIFO is applied:
@njit
def fifoStep(db):
mat = List()
for _ in range(NUM_OF_ROW):
ll = List()
for _ in range(NUM_OF_COL):
ll.append(65535)
mat.append(ll)
db.append(mat)
del db[0]
when I try to call from the datagramRecieved
method a @njit-ed function that parses the datagram and calls the above filter
and fifoStep
@njit-ed I get wrong indices in the db.
on the other hand it works correct w/o @njit but it is slow!
what I might been doing wrong?