Halide compilation in HDRPlus project
Hi, Sorry to ask this question here but I don't know how I can do this. I need to run HDRPlus (https://github.com/timothybrooks/hdr-plus) to process images in run time, so I need to compile it once not every time I give him new images. I knew two ways to do that:
- using compile_jit() once, then call realize() more time. But how can I do that in this project?
- using compile_to_file() but I don't know also how to do that with this project?
thanks,
Reading over the code, to reuse that pipeline for more than a single input burst, I think the code would at least need to change it to accept ImageParams instead of Images. You'd then separate out the part that constructs the pipeline into something that gets called once only and does compile_jit. For each burst to process you'd bind the image params to concrete images and then realize the compiled Func. That's the smallest change to what's already there.
Generally for production code we use Generators and create static libraries AOT, rather than jitting, but that would involve rearranging a lot of this code.
Thank you for your reply, I did the following but didn't work: //It's just the steps: //this code called once { ImageParam imgParam{ UInt(16), 2, "input" }; imgParam.set(myImgs); Func alignment = align(imgParam); Func merged = merge(imgParam, alignment); Func finished = finish(merged, width, height, bp, wp, wb, c, g); finished.compile_jit(); }
//this code called for each burst { imgParam.set(myImgs); Buffer<uint8_t> output_img(3, width, height); finished.realize(output_img); }