Archived
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
26 lines
1.1 KiB
C++
26 lines
1.1 KiB
C++
/* imaging.h -- image arithmetic done the way PIL does it, so a picture reaches the model exactly
|
|
* as the reference pipeline's would.
|
|
*
|
|
* Resize: PIL's Image.resize with LANCZOS, bit for bit. Per-axis coefficients are computed in
|
|
* double (support 3x the downscale, normalised to sum one) and converted to 22-bit fixed point;
|
|
* a horizontal then a vertical pass run over 8-bit values, rounding and clipping each output.
|
|
* RGBA is premultiplied by alpha first and divided back after, as PIL does. Diffusers'
|
|
* VaeImageProcessor resizes this way.
|
|
*
|
|
* Composite: Image.paste(picture, mask=alpha) onto white, each channel
|
|
* (c * a + 255 * (255 - a)) / 255 with PIL's rounding. The reference flattens a transparent
|
|
* picture this way for an RGB text encoder. */
|
|
#pragma once
|
|
#include "mm/media.h"
|
|
|
|
namespace rad {
|
|
namespace mm {
|
|
|
|
/* `src` resized to w x h. */
|
|
void resize_lanczos_rgba(const FrameRGBA& src, int32_t w, int32_t h, FrameRGBA* out);
|
|
/* `src` over an opaque white ground. */
|
|
void composite_white(const FrameRGBA& src, Frame* out);
|
|
|
|
} /* namespace mm */
|
|
} /* namespace rad */
|