From a544572e8ac61a6098fd4e68382f0a55ab79ee16 Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Sat, 16 May 2026 22:23:04 -0600 Subject: [PATCH] more keybindings --- README.md | 28 ++++++++++-- pyproject.toml | 2 +- src/rmbg_as_a_service/static/index.html | 58 +++++++++++++++++++++++-- uv.lock | 2 +- 4 files changed, 82 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1b20c7d..d1ff432 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,37 @@ while a model downloads and loads. ### Web UI -Open **http://localhost:8000/** — a two-tab test page (handy over SSH): +Open **http://localhost:8000/** — a single-page test app (handy over SSH): - **Auto remove** — pick a model variant + resolution. - **Prompt segment** — type what to keep (e.g. `the dog`), tune the GroundingDINO box / text thresholds. -Both tabs support a transparency checkerboard preview, click-to-zoom lightbox, +Both modes support a transparency checkerboard preview, click-to-zoom lightbox, optional crop-to-subject, and download. +#### Keyboard shortcuts + +The UI is fully keyboard-drivable. Shortcuts are ignored while typing in a +field and while Ctrl/Cmd/Alt is held. + +| Key | Action | +|---------------------|-----------------------------------------------| +| `B` | Toggle the controls sidebar | +| `U` | Open the file picker to upload an image | +| `I` / `O` | Show the input / output image | +| `F` / `Z` | Open the zoom view for the visible image | +| `S` | Save (download PNG), once a result exists | + +In the zoom view: + +| Key | Action | +|---------------------------|-----------------------------------------| +| `F` / `Z` / `Esc` | Close the zoom view | +| `+` / `-` | Zoom in / out (1×–8×) | +| `0` | Reset zoom & pan | +| Arrows or `H` `J` `K` `L` | Pan (while zoomed past 1×) | + ## API ### `POST /predict` — automatic background removal @@ -108,7 +130,7 @@ make dev # uv sync + run the server locally src/rmbg_as_a_service/model.py BiRefNet / RMBG-2.0 wrapper + compositing src/rmbg_as_a_service/prompt_segment.py GroundingDINO + SAM pipeline src/rmbg_as_a_service/server.py LitServe /predict + /segment + web UI -src/rmbg_as_a_service/static/ web UI (index.html) +src/rmbg_as_a_service/static/ web UI (index.html + styles.css) scripts/client.py stdlib-only test client Dockerfile / compose.yml CUDA image + nvidia runtime Makefile build / run / test shortcuts diff --git a/pyproject.toml b/pyproject.toml index 8deba0a..f2a4812 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rmbg-as-a-service" -version = "0.0.2" +version = "0.0.3dev1" description = "Background removal as a GPU-accelerated API" readme = "README.md" requires-python = ">=3.12" diff --git a/src/rmbg_as_a_service/static/index.html b/src/rmbg_as_a_service/static/index.html index c475011..8088293 100644 --- a/src/rmbg_as_a_service/static/index.html +++ b/src/rmbg_as_a_service/static/index.html @@ -161,7 +161,7 @@