Pulse Mirror:將心跳描繪成你的肖像
Pulse Mirror: your heartbeat, drawn as a portrait of you
Pulse Mirror 使用手提電腦鏡頭和 Presage SmartSpectra SDK 偵測脈搏,並以面部特徵點繪製會隨心跳和呼吸變化的肖像。用戶可儲存 3 至 30 秒的 MP4 片段或 PNG 圖像,檔案只包含線條畫,不含人像照片或影片。SDK 會把脈搏、心率變異和呼吸的數據摘要傳送至 Presage,再轉交語言模型作 wellness check-in;此應用程式並非醫療器材。
This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
Pulse Mirror is a desktop app that finds your pulse through your laptop camera and shows it back to you in your own reflection. Once the SDK has a steady reading, your face flushes with each heartbeat and the whole picture swells a little as you breathe, so for once your pulse is something you can see and not only a number.
When you want to keep a moment, you can capture a clip anywhere from 3 to 30 seconds long. What you save holds no video of you at all. It's a hand-drawn portrait traced live from your face points, so your smile, your blinks, an open mouth and the direction you're looking all move the drawing the way they move your face. Red hatching across the cheeks beats with your pulse, a scratchy heart beats alongside it, and the caption reads something like "about 63 beats a minute" next to your name and the date. You can save the result as an mp4 or as a still PNG, and nothing is uploaded anywhere.
Demo
[Demo video link goes here. It shows the real app on a real face with the live pulse, followed by a capture and a save.]
Code
The code is at https://github.com/adr1en360/pulse-mirror and the README walks through setup: you need Node 22, then npm install, a free Presage key in a .env file, and npm start.
How It Responds to Human Signals
Pulse rate, confidence and the stable flag decide when the app considers your pulse found or lost, and they supply the "about N beats a minute" in the readout. The pulse waveform does the visible work: it drives the flush on your face, the hatching on the cheeks in the clip and the beat of the little heart. The breathing trace gives the picture its slow swell, the 478 face landmarks draw the face outline while the app is still searching and then the whole line portrait in the clip, and the SDK's validation hints show up as on-screen guidance such as "increase light on face".
As for the integration, the Electron main process binds the SDK's IPC channel, and the renderer creates a SmartSpectraSDK with the breathing, cardio and face metric bundles and feeds it the laptop camera. A pulse counts as found once its confidence reaches 40 with the stable flag set, and the app falls back to "can't find your pulse" after three seconds without one. If the network drops and takes the SDK with it, the app reconnects by itself and tells you it's doing so.
I should be straight about the limits. The flush is something the app draws from the live waveform, so it isn't magnified video, and in my tests the SDK reads a pulse from a recording of a real face too, which is why I make no claim that this proves anyone is live. The first reading usually takes 20 to 60 seconds, and longer on a weak connection, because the pulse model downloads when you start.
I also tried the SDK's expression scores and left them out, because in one test a smile scored "happy" in only 7% of readings, which was less than a neutral face got. The portrait shows your expression through the way your face points move instead, and it makes no claim about your emotions.
Prize Categories
I'm entering Most Creative or Delightful Use.
The idea started with old home movies, where a film leader counts you in before the picture begins. I borrowed that to turn the wait for your pulse into part of the experience, so the sweeping arm and the outline numeral are on screen while the app looks for you. I also wanted a way to share a heartbeat without sending a photo of your face, which is why the clip is a drawing, and the whole idea grew out of MIT's Medical Mirror, which put a heart rate on a reflection.
What I think makes it unusual is that the portrait is built from your face points, so it moves the way you do, and the only things it keeps of you are a line drawing, a heart rate and a name you typed.
Consent and Data Handling
The camera starts only after you press Start camera on a consent card written in plain language, and a "Camera on" mark stays on screen the whole time it runs. Stop or Escape turns it off. The app asks for only the camera and nothing else. The SDK analyses video on your computer, and this app doesn't record frames or upload them. The SDK does contact Presage's servers to check your access key and usage and to download its models, and I turned its telemetry off with enableTelemetry: false.
There's an AI feature I have to disclose too. According to Presage's documentation, while a session runs the SDK automatically sends short summaries of numbers derived from your pulse, heart-rate variability and breathing to Presage, which forwards them to a language model for a wellness check-in. Raw video and facial images never go out, only those derived numbers and a fixed prompt. My app doesn't request those summaries, display them or store them, and I couldn't find any setting in the SDK that switches the feature off, so the consent card in the app says so before the camera starts. The app calls no other AI service.
Nothing is stored unless you press Capture and then Save. A capture lives in memory as drawing data until you save or discard it, and closing the app discards it. Saving writes one mp4 or PNG wherever you choose, and that file holds no photo or video of you, only a drawing traced from your face points. A name you type goes into the caption of what you save and is never stored. There are no accounts, no server and nothing built in for sharing, so deleting a clip just means deleting the file.
Pulse Mirror is for curiosity and isn't a medical device. It makes no diagnosis, gives no health verdicts and shouldn't be used for medical decisions. It also has no covert mode: it only works with the camera indicator visible, on the person sitting at the computer.
來源:DEV Community · dev.to
