Skip to main content

Semantic noise suppression demo controlled by Gemma/Gemma-compatible models served through vLLM.

Project description

QuietPlace vLLM

QuietPlace is a package for safety-aware semantic noise suppression. The package keeps the AST event classifier, deterministic DSP executor, metrics, and plotting code as a reusable Python library, then uses a Jupyter notebook as the public demo surface.

Gemma/Gemma-compatible inference is called through a vLLM OpenAI-compatible server.

Chapter 0 — Install the package

  1. Clone the repository
git clone https://github.com/akaliutau/quietplace.git
cd quietplace
  1. Create and activate a Conda environment
conda create -n quietplace python=3.12 -y
conda activate quietplace
  1. Install dependencies
pip install -r requirements.txt

Chapter 1 — Put the trained AST classifier in the hard-coded location

The demo assumes the AST classifier is already trained and exported with save_pretrained().

Hard-coded pointer:

/kaggle/input/quietplace-policy-ast/quietplace_policy_ast

This is defined in:

quietplace/config.py

Expected contents:

config.json
model.safetensors or pytorch_model.bin
preprocessor_config.json
policy_map.json        # optional but recommended

Chapter 2 — Start vLLM instead of Ollama

Example local server:

vllm serve google/gemma-4-e2b-it \
  --host 0.0.0.0 \
  --port 8000 \
  --dtype auto \
  --api-key EMPTY

The package calls:

http://localhost:8000/v1/chat/completions

via the official openai Python client. If your vLLM model/tool parser does not support native tool calls, the controller falls back to JSON parsing and the deterministic DSP executor still only runs whitelisted actions.

Chapter 3 — Create a realistic demo input

Best competition input: combine held-out dataset clips so the demo has known ground-truth segments.

quietplace make-demo-scene \
  --traffic-path /datasets/fsd50k/traffic_heldout.wav \
  --siren-path /datasets/urbansound8k/fold10/siren_heldout.wav \
  --speech-path /data/recorded_help.wav \
  --out data/demo_scene

No dataset files available? Use the deterministic synthetic fallback:

quietplace make-demo-scene --out data/demo_scene

Outputs:

data/demo_scene/quietplace_realistic_demo_scene.wav
data/demo_scene/events_demo.json
data/demo_scene/scene_manifest.json

Chapter 4 — Run the package pipeline

With the generated event table:

quietplace run data/demo_scene/quietplace_realistic_demo_scene.wav \
  --events-json data/demo_scene/events_demo.json \
  --backend auto \
  --vllm-base-url http://localhost:8000/v1 \
  --vllm-api-key EMPTY \
  --vllm-model google/gemma-4-e2b-it \
  --out runs/quietplace_demo

To force vLLM and fail if the server is down:

quietplace run data/demo_scene/quietplace_realistic_demo_scene.wav \
  --events-json data/demo_scene/events_demo.json \
  --backend vllm \
  --out runs/quietplace_demo

Outputs:

runs/quietplace_demo/original.wav
runs/quietplace_demo/suppressed.wav
runs/quietplace_demo/events.json
runs/quietplace_demo/controller_policy.json
runs/quietplace_demo/features.json
runs/quietplace_demo/segment_metrics.csv
runs/quietplace_demo/bandpower_metrics.csv
runs/quietplace_demo/metrics_summary.json

Chapter 5 — Generate charts for the video/writeup

quietplace charts data/demo_scene/quietplace_realistic_demo_scene.wav \
  --events-json data/demo_scene/events_demo.json \
  --backend auto \
  --out runs/quietplace_demo \
  --charts-out runs/quietplace_demo/charts

Charts:

01_before_after_spectrograms.png
02_waveform_ab.png
03_segment_metrics.png
04_bandpower_metrics.png

Chapter 6 — Create writeup chapters from the run

quietplace chapters \
  --run-dir runs/quietplace_demo \
  --out reports/chapters

This creates draft markdown chapters:

reports/chapters/01_problem.md
reports/chapters/02_architecture.md
reports/chapters/03_results.md
reports/chapters/04_demo_script.md

Use these as the structure for the Kaggle writeup and video narration.

Project structure

quietplace/audio.py        # audio IO, event schema, spectral features
quietplace/classifier.py   # hard-coded AST classifier wrapper
quietplace/controller.py   # vLLM/OpenAI-compatible policy controller
quietplace/dsp.py          # deterministic suppressor executor
quietplace/metrics.py      # calm-zone and preservation metrics
quietplace/viz.py          # notebook charts
quietplace/demo_scene.py   # realistic scene builder / synthetic fallback
quietplace/pipeline.py     # end-to-end orchestration
quietplace/cli.py          # commands used above
notebooks/00_quietplace_vllm_demo.ipynb

Build and publish the package

see the details in publish.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quietplace-0.2.4.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quietplace-0.2.4-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file quietplace-0.2.4.tar.gz.

File metadata

  • Download URL: quietplace-0.2.4.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for quietplace-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d686ab64bf2e5c3f67559980d3948add42be9175dc42c343ede8d4720bb83fbf
MD5 9588063d83f0bc1fa5e9488b546b45fe
BLAKE2b-256 e469e0a25b07b0c82eb53ce8fa2b8f81852a5e7f12343859467be3bd183b7aa6

See more details on using hashes here.

File details

Details for the file quietplace-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: quietplace-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for quietplace-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a700200cf236043eaf9c53dff5ccaf09c631130868d861105c73d49abd2782f
MD5 3a11ce97fe7bde06b5c04ea08dce0da0
BLAKE2b-256 fccc5e24dcbd6c20e73f62c454ec310ee0bac43eec171d9fec267cdc3fd51bfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page