npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trillboards/edge-sensing

v0.2.1

Published

Camera, audio, ONNX inference, and audience metrics for Trillboards Edge AI SDK

Readme

@trillboards/edge-sensing

On-device audience sensing with ONNX models. Face detection, gaze tracking, emotion analysis, age/gender classification, audio event detection, and attention scoring — all running locally on the device.

Install

npm install @trillboards/edge-sensing

What This Does

Runs computer vision and audio ML models directly on DOOH/CTV hardware. No cloud calls. No PII leaves the device. Outputs aggregated, anonymized audience metrics.

  • Face Detection — BlazeFace ONNX model detects faces, bounding boxes, head pose (yaw/pitch/roll), eye openness, smile probability
  • Age/Gender — classifies viewers into 8 age ranges (0-12 through 65+) with gender confidence scores
  • Emotion Detection — 8 emotions (happy, surprised, neutral, sad, angry, fearful, disgusted, contempt) with sentiment scoring
  • Gaze Classification — categorizes viewer gaze as Direct, Partial, or Away
  • Attention Scoring — combines head pose + eye openness into attention score (0-1)
  • Audio Classification — YAMNet model classifies ambient sound events (speech, music, crowd noise, silence)
  • Foot Traffic Estimation — estimates venue occupancy from face count signals
  • VAS (Viewability Attention Score) — weighted composite of attention, emotion, body, and focus signals

Quick Start

import { AudienceSensingService, FaceDetector, AudioClassifier } from '@trillboards/edge-sensing';

// Full orchestrated service
const sensing = new AudienceSensingService({
  enabled: true,
  fps: 10,
  resolution: { width: 640, height: 480 }
});

sensing.on('metrics', (payload) => {
  console.log(`Faces: ${payload.faceCount}, Attention: ${payload.avgAttention}`);
});

await sensing.start();

Individual Components

// Face detection only
const detector = new FaceDetector({
  modelPath: './models/blazeface_128x128.onnx',
  executionProvider: 'cpu' // or 'openvino', 'directml', 'cuda'
});

const faces = await detector.detect(imageBuffer);
// → [{ bbox, yaw, pitch, roll, eyeOpen, smileProb, age: '25-34', gender: 'male', ... }]

// Audio classification only
const audio = new AudioClassifier({
  modelPath: './models/yamnet_classification.onnx',
  minConfidence: 0.3
});

const events = await audio.classify(audioBuffer);
// → [{ label: 'Speech', confidence: 0.87 }, { label: 'Music', confidence: 0.42 }]

Metrics & Scoring Functions

import {
  calculateAttentionScore,
  classifyGaze,
  calculateEngagement,
  computeVAS,
  calculateDwellTimeMetrics,
  getDaypart
} from '@trillboards/edge-sensing';

const attention = calculateAttentionScore(yaw, pitch, eyeOpenness); // → 0.0 - 1.0
const gaze = classifyGaze(yaw, pitch); // → 'Direct' | 'Partial' | 'Away'
const engagement = calculateEngagement(gazeSignals, poseSignals, emotionSignals);
const vas = computeVAS(attentionData, emotionData, bodyData, focusData);
const daypart = getDaypart(new Date()); // → 'morning' | 'afternoon' | 'evening' | 'night'

Execution Providers

| Provider | Platform | Speed | |----------|----------|-------| | cpu | Any | Baseline | | openvino | Intel iGPU | 2-3x faster | | directml | Windows GPU | 2-4x faster | | cuda | NVIDIA GPU | 5-10x faster |

ONNX Models

Download models before first run:

npx trillboards-edge download-models --dir ./models

Downloads:

  • blazeface_128x128.onnx — face detection (~1.2 MB)
  • yamnet_classification.onnx — audio classification (~3.5 MB)

License

MIT