Yes—if reading and writing intermediate images to disk is a bottleneck, you can opt for systems that build in-memory pipelines rather than file‐oriented dependency graphs. Instead of a build system like Make that treats each intermediate file as a separate artifact, these approaches allow you to:
- Maintain intermediate results in memory: This reduces or eliminates the overhead of disk I/O for intermediate images.
- Optimize execution: By “compiling” a pipeline into an efficient schedule, the system can reuse intermediate buffers, fuse operations, and schedule tasks to run in parallel when possible.
Here are a few options and approaches that can help you achieve this:
1. Halide
Halide is a domain‑specific language designed specifically for high‑performance image processing and computational photography. It lets you:
- Define a pipeline of image processing operations.
- Specify a “schedule” that controls how the computation is organized—this schedule automatically manages the allocation, reuse, and caching of intermediate buffers in memory.
- Achieve optimizations such as tiling, vectorization, and parallel execution.
Because Halide “compiles” your pipeline into efficient low‑level code, it doesn’t write out intermediate steps to disk unless you explicitly choose to do so.
2. Dataflow Programming and In‑Memory Pipelines
Many modern frameworks allow you to set up dataflow graphs (often used in machine learning and big‑data processing) in which all operations take place in memory. Some examples include:
- TensorFlow or PyTorch: Although primarily known for machine learning, both frameworks let you define computation graphs. You could, in principle, define a pipeline of image transformations where only the inputs and final outputs go to disk.
- DALI (NVIDIA Data Loading Library): This is a library designed for fast, pipelined data processing (primarily for deep learning). It minimizes disk I/O by keeping data in memory as it’s transformed, resized, and augmented.
- Apache Beam or Spark: Although more general-purpose and often used for large-scale data processing, they’re built around the idea of in‑memory transformations (with smart caching policies) and might be adapted for image processing pipelines.
3. Custom In‑Memory Pipelines
If your workflow is specialized, you might build your own pipeline using libraries available in your favorite programming language. For example, in Python: