Project Info
A Real-Time Veterinary Microscopy Copilot Tempus transforms a Raspberry Pi 5 running QNX into an intelligent microscopy workstation. It captures live specimens, detects blood cells, measures visible structures, and gives veterinary laboratory technicians a dedicated interface for reviewing and correcting results. Those human-verified corrections create a feedback loop that can continuously improve future versions of the model. Tempus does not just analyze specimens—it learns from the people who understand them.
Inspiration
Veterinary microscopy remains highly manual. Laboratory technicians inspect specimens, count cells, document observations, and transfer their findings between disconnected systems. This takes time, introduces inconsistency, and makes collaboration difficult. We asked: Could an affordable, real-time microscope assistant accelerate this workflow while still keeping the laboratory technician in control? That question became Tempus. What It Does Tempus can: Stream live microscope imagery Detect red blood cells, white blood cells, and platelets Draw real-time detection overlays Count visible cellular structures Measure cell area and specimen coverage Describe basic morphology Generate AI-assisted observations Let technicians confirm, reject, or correct detections Save verified annotations for future model training Preserve findings for reports and historical comparison Tempus is a decision-support and documentation platform—not an autonomous diagnostic system. System Architecture The Raspberry Pi and QNX handle deterministic camera acquisition and hardware control. The connected workstation currently runs the YOLO model, OpenCV analysis, API, and Tempus dashboard. A human-in-the-loop feedback system allows laboratory technicians to verify the model’s output before corrections are included in a future training dataset. Data Flow QNX captures a raw NV12 camera frame. A custom C bridge packages the frame and its metadata. The frame travels through an authenticated SSH tunnel. FastAPI converts it into an OpenCV image. YOLO detects visible blood cells. OpenCV calculates measurements and morphology features. Tempus displays the results to the technician. The technician confirms, rejects, or corrects each result. Verified corrections are saved as training annotations. Curated annotations improve future model versions. Human Feedback Loop The laboratory technician remains the final authority. The review page is designed to let a technician: Confirm a correct detection Change an incorrect cell class Adjust a bounding box Remove a false detection Add a cell the model missed Attach a note to an unusual structure Mark the specimen as unsuitable for training Corrections are not immediately learned from blindly. They first enter a curated dataset where they can be reviewed, anonymized, versioned, and validated before retraining. This prevents a single mistake from silently changing the production model. Why the Feedback Loop Matters Blood-cell appearance varies across: Species Staining methods Microscope optics Camera settings Lighting conditions Specimen quality Clinical environments A model trained on one dataset may not generalize perfectly to every veterinary clinic. Tempus turns normal laboratory review into a structured learning opportunity. Over time, verified corrections can help the system become more representative of real veterinary specimens and local laboratory conditions. The AI assists the technician, and the technician improves the AI. Native QNX Camera Pipeline Tempus uses QNX 8.0 on a Raspberry Pi 5 to control the camera and embedded hardware. The QNX layer handles: Sony IMX708 sensor initialization 2304×1296 NV12 frame capture Camera buffers and timestamps Y and UV image planes GPIO control SPI communication Experimental local display output Python camera libraries were unavailable on the QNX image, so the acquisition system was implemented using QNX’s native C camera API. Secure Frame Transport The camera produces raw NV12 data rather than browser-ready images. We created a binary protocol containing: Frame identifier Width and height Y-plane stride UV-plane offset UV-plane stride Pixel format Payload size Raw image data Frames travel through an authenticated SSH tunnel rather than an exposed camera service. Blood-Cell Detection Tempus uses a custom YOLO model to identify: RBC WBC Platelet The model produces: Bounding boxes Cell classifications Confidence scores Total cell counts Counts by class OpenCV provides additional measurements, including: Visible area Specimen coverage Circularity Aspect ratio Solidity Contour irregularity These measurements provide descriptive visual information without claiming medical diagnosis. Technician Experience The Tempus dashboard provides: Live microscope video Detection overlays RBC, WBC, and platelet counts Confidence controls Area and coverage measurements Morphology summaries Capture and report controls The technician review page adds: Detection confirmation Class correction Bounding-box editing False-positive removal Missed-cell annotation Review notes Training-data consent controls Embedded Display Tempus also includes an experimental display path for a two-inch 240×320 ST7789 screen. The QNX display driver uses: SPI communication GPIO-controlled reset Data/command signaling Backlight control NV12-to-RGB565 conversion Real-time image downscaling Built With QNX 8.0, Raspberry Pi 5, Raspberry Pi Camera Module 3, Sony IMX708, QNX Sensor Framework, C, Python, FastAPI, WebSockets, OpenCV, Ultralytics YOLO, NumPy, React, Vite, SSH tunneling, SPI, GPIO, ST7789 display The Original Microscope Camera Challenge Our original AmScope MU1000 camera used a proprietary ToupTek USB protocol instead of standard UVC. We successfully: Identified its USB endpoints Queried its firmware and hardware versions Read its calibration EEPROM Reproduced its vendor handshake Received the expected 0x08 acknowledgement Full streaming still required an undocumented model-specific sensor initialization sequence. We completed the prototype using the officially supported Camera Module 3 while preserving the ToupTek work for a future native QNX driver. Challenges QNX Camera Integration Python camera libraries were unavailable, so we built a native C acquisition bridge using the QNX camera API. Raw Image Reconstruction The camera produced NV12 buffers with platform-specific offsets and strides. Tempus reconstructs each frame using the metadata supplied by QNX. Secure Networking Direct access to the custom frame port was unavailable. We transported frames through an authenticated SSH tunnel. Real-Time AI Camera acquisition and AI inference have different performance requirements. Separating them keeps QNX focused on reliable hardware control while the workstation handles inference. Trustworthy Feedback Human corrections must not be used as training data without review. Tempus separates technician feedback, dataset curation, model training, validation, and release. Accomplishments Booted QNX 8.0 on Raspberry Pi 5 Enabled live IMX708 camera capture Built a native C frame bridge Reconstructed full-color NV12 frames Connected the feed to a blood-cell YOLO model Created real-time detection analytics Built an interactive veterinary dashboard Designed a technician feedback loop Implemented an experimental ST7789 driver Reverse-engineered the initial ToupTek protocol What’s Next Finish the technician annotation interface Add authenticated reviewer accounts Store consented and anonymized specimens Add annotation quality checks Track dataset and model versions Measure model improvement across feedback cycles Run ONNX inference directly on QNX Complete the AmScope MU1000 driver Train on veterinary-specific species and specimens Add calibrated micrometer measurements Validate results with veterinary professionals Export findings into patient records Generate PDF reports Compare historical specimens Potential Impact Tempus points toward an affordable microscopy platform for: Faster laboratory documentation More consistent cell counting Remote collaboration Structured veterinary datasets Continuous expert-guided improvement Better access for smaller veterinary practices The most important part of Tempus is not that an AI can make predictions. It is that every prediction can be reviewed, corrected, and transformed into better knowledge. Tempus is a microscope, an AI assistant, and a learning system built around human expertise. Responsible Use Tempus is an experimental decision-support platform. It does not provide medical diagnoses and must not replace professional veterinary judgment, validated laboratory equipment, or appropriate clinical testing. Technician feedback should be curated and validated before being used for model training. Patient and clinic information must be protected through appropriate consent, access controls, and anonymization.
This repository has no readme, or GitHub could not be reached.
Analysis
View
Metric
- 38
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
7 of 7 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
172 KB
Source files
17
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
yordanoskassa/tempus
35 files · 13.1 MB · @ 2ddc798
Structure
Interface
1 file · 3%Screens, components and styles rendered to the user.
Application logic
15 files · 43%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python36%
- JavaScript30%
- CSS18%
- Markdown10%
- C5%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
frontend/package.json
npm · 11- react
- react-dom
- +9 more
backend/requirements.txt
pypi · 8- fastapi
- google-genai
- numpy
- opencv-python-headless
- python-dotenv
- python-multipart
- uvicorn
- websockets
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
AI-generated observations (Gemini analysis)Verified
Generate AI-assisted observations
Claimed on Devposthigh confidencebackend/main.py:504— _call_gemini_analysis sends image + detection context to Gemini 2.5 Flash for natural-language clinical analysis
Basic morphology descriptionVerified
Describe basic morphology
Claimed on Devposthigh confidencebackend/detector.py:141— classify_cell_morphology classifies contours into Sickle, Teardrop, Spherocyte, etc. using shape metrics
Blood cell detection (RBC/WBC/Platelet) via YOLOVerified
Detect red blood cells, white blood cells, and platelets
Claimed on Devposthigh confidencebackend/detector.py:343— Loads blood_cell_best.pt YOLO model and sets mode to blood_cellbackend/detector.py:12— BLOOD_CELL_COLORS defines Platelet/RBC/WBC classes used in detection output
Cell area and specimen coverage measurementVerified
Measure cell area and specimen coverage
Claimed on Devposthigh confidencebackend/main.py:473— avg_cell_area, min/max_cell_area, coverage_pct computed from bbox areas vs frame area
Cell counting (total and by class)Verified
Count visible cellular structures
Claimed on Devposthigh confidencebackend/main.py:461— _compute_analytics computes cell_count and class_counts from detections
Custom binary protocol for raw NV12 frame transportVerified
Binary protocol with frame id, width/height, Y/UV stride/offset, pixel format, payload size
Claimed on Devposthigh confidencecamera_bridge.c:4— 32-byte header documented and constructed with magic, width, height, stride, uv_offset, uv_stride, format, size fields
Experimental ST7789 embedded display outputVerified
Experimental display path for a two-inch 240x320 ST7789 screen with SPI, GPIO reset, NV12-to-RGB565 conversion, downscaling
Claimed on Devposthigh confidencelcd_display.py:61— _rgb_to_rgb565 converts RGB to RGB565; ST7789 class drives SPI/GPIO reset/backlight and resizes frames to 240x320
Live microscope video streamingVerified
Stream live microscope imagery
Claimed on Devposthigh confidencebackend/main.py:424— MJPEG streaming endpoint /camera/stream reads camera_frame and yields multipart JPEGbackend/main.py:191— _pi_camera_reader SSHes into the Pi and reads length-prefixed JPEG frames from cam_streamcam_stream.c:30— QNX camera callback compresses NV12 to JPEG and writes length-prefixed frames to stdout
Native QNX C camera acquisition (IMX708, NV12)Verified
QNX layer handles Sony IMX708 sensor init, NV12 frame capture via native C camera API
Claimed on Devposthigh confidencecam_stream.c:15— Includes camera/camera_api.h, opens camera, configures NV12 viewfinder format, and captures frames via camera_start_viewfindercamera_bridge.c:18— Second native C camera bridge also using camera_api.h with NV12 frame handling
OpenCV measurements: circularity, aspect ratio, solidity, contour irregularityVerified
OpenCV provides visible area, coverage, circularity, aspect ratio, solidity, contour irregularity
Claimed on Devposthigh confidencebackend/detector.py:105— classify_cell_morphology computes circularity, aspect ratio (via bounding rect), solidity (area/hull_area), and convexity defects
Real-time detection overlaysVerified
Draw real-time detection overlays
Claimed on Devposthigh confidencebackend/main.py:132— _draw_annotations draws bounding boxes, labels, confidence, morphology tags on frames
Technician dashboard (live video, overlays, counts, confidence controls, morphology summary, capture/report controls)Verified
Tempus dashboard provides live video, overlays, counts, confidence controls, area/coverage, morphology summaries, capture and report controls
Claimed on Devposthigh confidencefrontend/src/App.jsx:939— Dashboard renders MorphologyBars, DistributionDonut, ClassBreakdownChips alongside live feed and report generation controlsbackend/main.py:449— /confidence/{value} endpoint lets frontend adjust detector.conf_threshold
Voice assistant / voice-driven captureVerified
Not explicitly in Devpost list but implemented; described implicitly under 'AI-assisted observations' and built-with WebSockets
Claimed on Devposthigh confidencebackend/main.py:865— /ws/voice proxies browser audio to Deepgram Voice Agent and handles capture_and_analyze function callsfrontend/src/VoiceAgent.jsx:1— VoiceAgent component manages mic capture, websocket connection, and playback for the voice assistant
Authenticated SSH transport for framesCode-supported
Frames travel through an authenticated SSH tunnel rather than an exposed camera service
Claimed on Devpostmedium confidencebackend/main.py:198— Uses sshpass+ssh to run cam_stream remotely and pipe stdout back; this is SSH command execution/password auth over ssh, not an explicit port-forwarding tunnel, but does provide authenticated encrypted transport
Decision-support, not autonomous diagnostic system framingCode-supported
Tempus is a decision-support and documentation platform, not an autonomous diagnostic system
Claimed on readmemedium confidencebackend/main.py:537— Gemini prompt explicitly asks for descriptive, non-diagnostic clinical analysis, and report assessment text recommends technician review rather than issuing diagnoses
Preserve findings for reports and historical comparisonCode-supported
Preserve findings for reports and historical comparison
Claimed on Devpostmedium confidencefrontend/src/App.jsx:501— CapturesGallery keeps an in-session array of captures; no persistence to disk/DB found, so history does not survive a sessionbackend/main.py:718— /report generates a structured lab report JSON from current session data
Human-in-the-loop feedback / curated training pipelineClaimed only
Corrections enter a curated dataset before retraining; technician review page for confirm/reject/edit/annotate/note/consent
Claimed on Devposthigh confidenceSave verified annotations for model trainingClaimed only
Save verified annotations for future model training
Claimed on Devposthigh confidenceTechnician confirm/reject/correct detectionsClaimed only
Let technicians confirm, reject, or correct detections
Claimed on Devposthigh confidenceTechnician review page: class correction, bounding-box editing, false-positive removal, missed-cell annotation, review notes, training-data consent controlsClaimed only
The technician review page adds detection confirmation, class correction, bounding-box editing, false-positive removal, missed-cell annotation, review notes, training-data consent controls
Claimed on Devposthigh confidenceToupTek/AmScope MU1000 proprietary USB protocol reverse engineeringClaimed only
Identified USB endpoints, queried firmware/hardware versions, read calibration EEPROM, reproduced vendor handshake for AmScope MU1000
Claimed on Devposthigh confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.