Spaces:
Running

aditya-rAj19 commited on
Commit
ddb0022
·
1 Parent(s): 27e2136

Super-resolve the head only, which makes real SR affordable on CPU

Browse files

RealESRGAN was GPU-only: on CPU a 4x pass over the full frame takes ~20 minutes
here, so the free tier fell back to a plain Lanczos resize and the "4K" download
was pure interpolation.

Now that everything outside the changed region is composited straight from the
full-resolution original, the background is already native and has nothing for a
super-resolution model to reconstruct. Only the head came through the swap's
128x128 bottleneck, so RealESRGAN now runs on that crop alone and Lanczos covers
the rest, feathered at the crop edge.

Measured on the Library target (CPU, 1086x1448 -> 4344x5792): head-only SR takes
370s against ~1200s for the full frame, and high-frequency detail in the face
region rises from 5.9 to 19.9. GPU behaviour is unchanged when no bbox is given.

Not yet safe to deploy synchronously — 370s exceeds the request timeout. The
async job endpoint lands next.

2 files changed +86 -25
Files changed (2)
core/super_res.py+73-23
web_app.py+13-2