Project Info
Inspiration
SOCIAL IMPACT Internet Cost by Country 2025 Machine learning–based video compression can shrink file sizes and cut bandwidth needs by up to 50%, directly lowering streaming infrastructure costs by 30–40%. By reducing the data required to deliver high-quality video, this technology makes online education, healthcare, and communication accessible to the 2.6 billion people still offline due to costly and limited internet access. We are motivated to actively work to bridge this digital divide in order to bring connection and opportunity to millions worldwide. DEMAND Why Buffering is Every Video Providers Worst Nightmare Twitch Shuts Down in South Korea Streaming Services Cutting Bitrates to Save Money Even before COVID-19, video providers were already losing massive engagement — a mere 1% increase in buffering time translated into about 2.9 billion hours of lost viewing in a single quarter. With the global video streaming market valued at roughly US$674 billion in 2024, even a slight reduction in viewer hours or increase in cost can equate to hundreds of millions in lost revenue or extra expense. At the same time, streaming platforms are taking desperate measures — slashing bitrate, reducing quality, and squeezing compression — to cut bandwidth and delivery costs that run into the billions annually across the industry. Mounting engagement risk plus soaring delivery cost creates a compelling demand for a solution that both preserves viewer experience and lowers data usage.
What it does
Our system rethinks video compression by mirroring how the human eye perceives importance in a scene. Rather than preserving every pixel equally, it identifies the regions that naturally capture attention—faces, motion, or areas of high contrast—and keeps those sections sharp, while less noticeable regions are transmitted at lower resolution. On the viewer’s side, these regions are simply scaled back up, creating a smooth but visibly adaptive level of detail across the frame. How we're unique What makes this approach unique is that it doesn’t just compress data: it compresses perception. Traditional codecs work uniformly across the screen, but this is the first model that embraces resolution variation as part of the design, keeping the experience realistic while using a fraction of the data. The effect is subtle yet powerful: scenes look natural, but the underlying file is dramatically smaller. The method has clear potential in both pre-processed content (YouTube and Netflix), where bandwidth directly affects cost, and live video (Zoom and FaceTime), where fluctuating network speeds are prevalent.
How we built it
We designed our system to mirror how the human eye selectively processes visual information, balancing computational efficiency with perceptual realism. Neural Saliency Detection: Implemented using ViNet, a PyTorch-based video saliency prediction model trained on DHF1K, Hollywood-2, and UCF-Sports datasets for visual attention, with additional fine-tuning on DIEM, AVAD, Coutrot-1/2, SumMe, and ETMD for visual saliency cues. The model outputs a spatiotemporal saliency heatmap for each frame, predicting where human gaze is most likely to focus based on motion, contrast, and semantic context. Preprocessing Pipeline: Frames are extracted, normalized, and batched using OpenCV and NumPy, converted into tensors, and passed through ViNet in float16 precision for GPU-optimized inference. Heatmap Postprocessing: Each saliency map is normalized and discretized into percentile bins (e.g., top 20%, 50%, 80%) to classify regions by visual importance. Server-Side Compression: A GPU-accelerated OpenGL fragment shader processes the frame using the saliency mask, preserving high-saliency pixels at full resolution while adaptively downsampling lower-saliency regions. The shader executes in parallel on the GPU using GLSL texelFetch operations for direct texture access, ensuring real-time throughput. Encoding Pipeline: The mixed-resolution output frame is encoded via FFmpeg (H.264/H.265), with saliency metadata embedded as sidecar data to guide client-side scaling. Client-Side Scaling: On playback, the client reads the saliency metadata and uses a lightweight OpenGL upscaling shader to scale low-resolution areas back up to the original frame size, maintaining smooth transitions between resolution zones.
Challenges we ran into
Real-Time Performance: Achieving frame-level saliency detection and GPU compression in real time was difficult. The PyTorch model alone could process only a few frames per second initially, so we experimented with quantizing it, optimizing batch loading, and pipelining the inference with shader execution. Shader Synchronization: Getting the OpenGL shader and PyTorch inference to share memory efficiently without stalling the baseten API was challenging, and we had to pivot approaches multiple times. Compression Artifacts: Early versions of the shader created visible seams and inaccurate pixels where resolution zones met. We had to fine-tune the saliency thresholds and interpolation filters to make transitions appear smoother while keeping data savings significant. Bandwidth Variability: Simulating unstable network conditions to test adaptive thresholding was harder than expected. We tested this by changing the resolution of the source video's frames randomly. Model Generalization: ViNet’s saliency predictions worked well for cinematic and YouTube-style videos but struggled with static or low-motion footage. We experimented with temporal smoothing and custom fine-tuning to improve stability across diverse content. Integration Overhead: Coordinating the PyTorch inference server, shader renderer, and FFmpeg encoder into one containerized pipeline required careful dependency management. Despite these challenges, each bottleneck led to a better understanding of how to balance neural inference, rendering, and compression in one real-time system.
Accomplishments we're proud of
and What We Learned Despite these challenges, we’ve achieved something remarkable: Functional Prototype: We built a fully operational system that dynamically adjusts video resolution in real time based on predicted viewer attention. Perceptual Compression: Our approach maintains sharpness where it matters most, proving that compression doesn’t have to be uniform to feel natural. Massive Efficiency Gains: Testing shows file sizes can be reduced by 2×–3× while retaining strong perceptual quality, dramatically lowering bandwidth and storage costs. GPU-Accelerated Pipeline: We achieved real-time performance by fusing a PyTorch saliency model with an OpenGL shader pipeline—compressing and transmitting frames at streaming speeds. Cross-Platform Applicability: The system runs efficiently for both pre-processed video (like streaming platforms) and live feeds, adapting dynamically to network fluctuations. End-to-End Integration: We combined deep learning, GPU rendering, and adaptive encoding into a single pipeline that can slot directly into existing video delivery workflows.
What's next
Salient Labs is committed to pushing the boundaries of machine learning–driven compression through rigorous experimentation and user testing, aiming for stable 50%+ efficiency and 95%+ satisfaction. As a research-oriented team, we plan to extend our work to other bandwidth and infrastructure challenges that limit global connectivity.
This repository has no readme, or GitHub could not be reached.
Analysis
View
Metric
- 20
- 7
- 4
- 4
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
- CSSIn code
- FastAPIIn code
- JavaScriptIn code
- MongoDBIn code
- Next.jsIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- Tailwind CSSIn code
- AWSClaimed
9 of 10 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
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
233 KB
Source files
35
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
k-kochhar/Salient
69 files · 108.7 MB · @ ca60929
Structure
Interface
6 files · 9%Screens, components and styles rendered to the user.
API & routing
6 files · 9%Request entry points: routes, handlers and controllers.
Application logic
19 files · 28%Domain rules, services and shared utilities.
Data & schema
8 files · 12%Schema definitions, migrations and data access.
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
- Python64%
- JavaScript27%
- Markdown8%
- CSS2%
- YAML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/requirements.txt
pypi · 12- boto3
- fastapi
- moderngl
- numpy
- opencv-python-headless
- python-dotenv
- requests
- scipy
- torch
- torchvision
- tqdm
- uvicorn[standard]
frontend/package.json
npm · 11- @aws-sdk/client-s3
- @aws-sdk/s3-request-presigner
- mongodb
- next
- react
- react-dom
- +5 more
backend/heatmap_generation/video-saliency/requirements.txt
pypi · 9- boto3
- moderngl
- numpy
- opencv-python-headless
- requests
- scipy
- torch
- torchvision
- tqdm
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
Amazon Web Services storage for original/processed videosVerified
Built with AWS; video storage and delivery uses S3
Claimed on Devposthigh confidencefrontend/src/app/api/upload/route.js:7— Uses @aws-sdk/client-s3 S3Client and presigned PutObjectCommand for uploadsbackend/app.py:110— boto3 S3 client used to download/upload processed videos server-side
Baseten-hosted model servingVerified
Uses Baseten to host/serve the saliency model, coordinating a PyTorch inference server with the shader renderer and encoder
Claimed on Devposthigh confidencebackend/heatmap_generation/video-saliency/model/model.py:214— Model class follows the Truss/Baseten model wrapper convention (load()/predict() methods) intended for Baseten deploymentbackend/app.py:72— BASETEN_API_URL/BASETEN_API_KEY env vars are used to call the hosted model via requests.post
End-to-end video upload -> S3 -> Baseten saliency -> foveated render -> S3 pipelineVerified
Functional prototype: system dynamically adjusts video resolution in real time based on predicted viewer attention, end-to-end integration combining deep learning, GPU rendering, and adaptive encoding
Claimed on Devposthigh confidencefrontend/src/app/api/upload/route.js:15— Generates presigned S3 upload URL and creates a MongoDB video recordfrontend/src/app/api/videos/[id]/process/route.js:44— Calls the FastAPI backend /api/process-video endpoint after upload finalizesbackend/app.py:243— process_pipeline calls Baseten for focal points, downloads from S3, applies FoveatedRenderer, and re-uploads the processed video to S3
GPU fragment-shader foveated compression preserving high-saliency pixelsVerified
Server-side OpenGL fragment shader processes frames using the saliency mask, keeping high-saliency pixels full-resolution and downsampling low-saliency regions in real time using GLSL texelFetch
Claimed on Devposthigh confidencebackend/Rendering/FoveatedShading/shaders/foveated_render_multi.glsl:24— GLSL fragment shader implements stride-based quadrant downsampling driven by foveal center distance thresholdsbackend/heatmap_generation/video-saliency/model/model.py:118— FoveatedRenderer class in the Baseten model wrapper renders each frame through this shader using detected focal points as centersbackend/Rendering/FoveatedShading/shaders/foveated_render_multi.glsl:38— Uses texture() (bilinear sampler) rather than texelFetch for the source read; texelFetch is used in the separate reconstruction shader, not this compression shader
Multi-fovea support (up to 3 focal regions)Verified
Adaptive thresholding scales with number of foveae/focal points to keep detail area constant across multiple regions
Claimed on Devposthigh confidencebackend/app.py:357— adjust_thresholds_for_multiple_foveae scales thresholds by 1/sqrt(num_foveae)backend/Rendering/FoveatedShading/shaders/foveated_render_multi.glsl:12— Shader supports up to 3 foveaCenter uniforms (numFoveae, foveaCenter0/1/2)
Neural saliency detection with ViNet modelVerified
Video saliency prediction implemented using ViNet, a PyTorch-based model trained on DHF1K, Hollywood-2, UCF-Sports and fine-tuned on other datasets, outputting spatiotemporal saliency heatmaps
Claimed on Devposthigh confidencebackend/heatmap_generation/model/Vinet_S_model.py:38— Implements BackBoneS3D and VideoSaliencyModel architecture matching ViNet-style S3D backbonebackend/heatmap_generation/video-saliency/model/model.py:71— Imports VideoSaliencyModel from vinet_model and loads a checkpoint named vinet_s_mvva_randomsplit.pt for inferencebackend/heatmap_generation/model/checkpoints/vinet_s_mvva_randomsplit.pt— Trained checkpoint file present in repo
Next.js frontendVerified
Built with Next.js
Claimed on Devposthigh confidencefrontend/next.config.mjs— Next.js config file presentfrontend/src/app/page.js— App Router structure (src/app) with route handlers under src/app/api
OpenGL used for GPU-accelerated renderingVerified
Built with OpenGL (via moderngl) for shader-based compression and reconstruction
Claimed on Devposthigh confidencebackend/Rendering/FoveatedShading/foveated_renderer.py:13— moderngl.create_standalone_context() used to compile and run GLSL shaders for rendering
Client-side reconstruction/upscaling shaderCode-supported
On playback, the client reads saliency metadata and uses a lightweight OpenGL upscaling shader to scale low-resolution areas back up, maintaining smooth transitions
Claimed on Devpostmedium confidencebackend/Rendering/ReconstructionPython/reconstruction_renderer.py:6— A ReconstructionRenderer GPU shader exists that reconstructs missing regions from foveated frames via spatial interpolationbackend/Rendering/ReconstructionPython/shaders/reconstruction_shader.glsl:40— GLSL shader uses texelFetch for neighbor sampling to fill in downsampled regionsfrontend/src/app/demo/page.js:11— The web demo is only a static toggle between two prerecorded video files (demo-original-video/demo-optimized-video), not a live client-side OpenGL reconstruction pipeline running in the browser
Heatmap postprocessing into percentile importance binsCode-supported
Saliency maps normalized and discretized into percentile bins (top 20%, 50%, 80%) to classify regions by visual importance
Claimed on Devpostmedium confidencebackend/heatmap_generation/video-saliency/model/model.py:736— Saliency map is min-max normalized and local-maxima peak detection extracts focal points with a radius/intensity, but no percentile-bin (20/50/80) discretization exists; the actual approach is peak/radius extraction, a different technique than described
Preprocessing pipeline (OpenCV/NumPy, float16 GPU inference)Code-supported
Frames extracted, normalized, batched with OpenCV/NumPy, converted to tensors, passed through ViNet in float16 precision for GPU-optimized inference
Claimed on Devpostmedium confidencebackend/heatmap_generation/video-saliency/model/model.py:703— Frames are resized with cv2, normalized with numpy mean/std, and converted to a torch tensor per clip; no explicit float16/.half() cast was found in this code path, so the float16 detail is unconfirmed
2x-3x file size reduction / 30-50% bandwidth savingsClaimed only
Testing shows file sizes reduced 2x-3x while retaining perceptual quality; up to 50% bandwidth reduction and 30-40% infrastructure cost cuts
Claimed on Devposthigh confidenceEncoding pipeline via FFmpeg (H.264/H.265) with sidecar saliency metadataClaimed only
Mixed-resolution output frame is encoded via FFmpeg (H.264/H.265), with saliency metadata embedded as sidecar data to guide client-side scaling
Claimed on Devposthigh confidenceFFmpeg used in encoding pipelineClaimed only
Built with FFmpeg (listed as 'ffmeg' in Built With)
Claimed on Devposthigh confidenceLive video / real-time low-latency use case (Zoom, FaceTime)Claimed only
Method applies to live video where fluctuating network speeds are prevalent (Zoom, FaceTime)
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.