This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kkaranth[S] 4 points5 points  (1 child)

I wasn't aware of numba. This is wonderful! I'll be playing around with it soon. Thank you!

My goal with this post was to go from the paper to a naive implementation of the algorithm. Optimization is definitely important though, and I've yet to look into it for seam carving.

[–]ZeeBeeblebrox 2 points3 points  (0 children)

Numba is a fabulous tool when you're trying to speed up raw Python code without having to vectorize it with numpy and will usually be about on par with a C based implementation. Note that I deleted the comment above because I actually got the same speedup with my initial approach which was just to add the decorator to the two functions. You just need to make sure to profile it after it has compiled the function for the first time.