Skip to content

mtmd : fix LightOnOCR image preprocessing - #20877

Merged
ngxson merged 1 commit into
ggml-org:masterfrom
DorianRudolph:fix-lighton
Mar 23, 2026
Merged

ngxson merged 1 commit into
ggml-org:masterfrom
DorianRudolph:fix-lighton

Conversation

@DorianRudolph

@DorianRudolph DorianRudolph commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

Uses longest edge bicubic resizing instead of the previous 1024 token limit and bilinear resizing. This is in line with the LightOnOCR
processor_config.json

    "resample": 3,
    "size": {
      "longest_edge": 1540
    }

This fixes the output with the LightOnOCR-2-1B-bbox model (using the GGUF by noctrex)

Before (boxes) university-physics-page745-before-hf
Before (markdown)
shock absorbers.

![image](image_1.png)277,70,670,243

**FIGURE 15.24** To counteract damping forces, you need to keep pumping a swing. (credit: Bob Mical)

**Figure 15.25** shows a mass $m$ attached to a spring with a force constant $k$ . The mass is raised to a position $A_0$ , the initial amplitude, and then released. The mass oscillates around the equilibrium position in a fluid with viscosity but the amplitude decreases for each oscillation. For a system that has a small amount of damping, the period and frequency are constant and are nearly the same as for SHM, but the amplitude gradually decreases as shown. This occurs because the non-conservative damping force removes energy from the system, usually in the form of thermal energy.

![image](image_2.png)240,295,740,465

**FIGURE 15.25** For a mass on a spring oscillating in a viscous fluid, the period remains constant, but the amplitudes of the oscillations decrease due to the damping caused by the fluid.

Consider the forces acting on the mass. Note that the only contribution of the weight is to change the equilibrium position, as discussed earlier in the chapter. Therefore, the net force is equal to the force of the spring and the damping force ( $F_D$ ). If the magnitude of the velocity is small, meaning the mass oscillates slowly, the damping force is proportional to the velocity and acts against the direction of motion ( $F_D = bv$ ). The net force on the mass is therefore

$$
ma = -bv - kx.
$$

Writing this as a differential equation in $x$ , we obtain

$$
\frac{d^2x}{dt^2} + b\frac{dx}{dt} + kx = 0.
\quad \text{15.23}
$$

To determine the solution to this equation, consider the plot of position versus time shown in **Figure 15.26**. The curve resembles a cosine curve oscillating in the envelope of an exponential function $A_0 e^{-\alpha t}$ where $\alpha = \frac{b}{2m}$ . The solution is
After (boxes) university-physics-page745-after-hf
After (markdown)
shock absorbers.

![image](image_1.png)310,103,700,295

**FIGURE 15.24** To counteract dampening forces, you need to keep pumping a swing. (credit: Bob Mical)

**Figure 15.25** shows a mass $m$ attached to a spring with a force constant $k$ . The mass is raised to a position $A_0$ , the initial amplitude, and then released. The mass oscillates around the equilibrium position in a fluid with viscosity but the amplitude decreases for each oscillation. For a system that has a small amount of damping, the period and frequency are constant and are nearly the same as for SHM, but the amplitude gradually decreases as shown. This occurs because the non-conservative damping force removes energy from the system, usually in the form of thermal energy.

![image](image_2.png)270,420,710,645

**FIGURE 15.25** For a mass on a spring oscillating in a viscous fluid, the period remains constant, but the amplitudes of the oscillations decrease due to the damping caused by the fluid.

Consider the forces acting on the mass. Note that the only contribution of the weight is to change the equilibrium position, as discussed earlier in the chapter. Therefore, the net force is equal to the force of the spring and the damping force ( $F_D$ ). If the magnitude of the velocity is small, meaning the mass oscillates slowly, the damping force is proportional to the velocity and acts against the direction of motion ( $F_D = -bv$ ). The net force on the mass is therefore

$$
ma = -bv - kx.
$$

Writing this as a differential equation in $x$ , we obtain

$$
m\frac{d^2x}{dt^2} + b\frac{dx}{dt} + kx = 0.
\quad \text{15.23}
$$

To determine the solution to this equation, consider the plot of position versus time shown in **Figure 15.26**. The curve resembles a cosine curve oscillating in the envelope of an exponential function $A_0e^{-\alpha t}$ where $\alpha = \frac{b}{2m}$ . The solution is

Input file page-745

The example files are from University Physics Volume 1 by OpenStax licensed under Creative Commons Attribution License v4.0

Demo script: https://gist.github.com/DorianRudolph/4c23020d87e7dac5441576b142b691f9

AI usage: I used codex with gpt-5.4 xhigh to find the cause of the issue and prepare the demo script.

@DorianRudolph
DorianRudolph requested a review from a team as a code owner March 22, 2026 22:30
@ngxson
ngxson merged commit d3ac030 into ggml-org:master Mar 23, 2026
48 checks passed
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants