Project Info
Inspiration
TuneAI was born out of a deep appreciation for the art of visual storytelling and the recognition that audio plays in enhancing the impact of videos. Our motivation to create TuneAI lies in the desire to provide content creators, filmmakers, and videographers with a powerful tool that simplifies the process of generating background audio and sound effects, making it more accessible and efficient than ever before.
What it does
TuneAI is an intelligent visual content to audio generator tool. We provide users with access to generative AI technology to create unique musical samples based on the context of their images or videos. Our model analyzes the video for its mood, tone, objects, scenery, and a variety of other contextual elements, and generates music based on a suitable genre, instrumentation, style, etc. Our music is sure to inspire you!
How we built it
After the video file is uploaded, we splice the video into multiple frames which are then analyzed by Salesforce BLIP image-to-text model, which gives us a list of image descriptors. These are then passed on to OpenAI GPT, which takes the image descriptors and comes up with the musical prompt, which is fed into Meta's MusicGen. The audio generated by MusicGen can be edited to fit the video. This whole pipeline is squashed into a function which is served on the backend (Flask). We used React to build our frontend and deployed on Vercel. Intel Cloud Max Series GPU allows us to perform inferencing at speed, allowing us to generate the audio in reasonable time.
Challenges we ran into
Complex tasks: how do we ... do video understanding? ... translate that understanding into a type of music? ... how do we define or generate music? We answered all of these questions after a thorough investigation of current methods, models, and applications. Model selection: Making decisions to select the best models for our choice of architecture and design constraints (compute speed and memory and accuracy tradeoffs). Attempts to fine tune our models: We are venturing into rather new territory in the generative AI space for videos and audio. There are limited datasets that would allow us to tune (Example: In targeting our model for short form content, we wanted to use Tiktok videos to fine-tune the BLIP model. However, we cannot easily analyze sentiment or understand moods with a "describe what you see" type of model, especially since Tiktok present a lot of social trends. Video descriptors and metadata also do not provide much context. This proved to be unreliable upon testing and set us back initially.) A second challenge was to figure out a way to increase the speed of inference, by setting up our environment in Intel Cloud as none of us had deep infrastructure experience . A huge shout-out to Rahul from Intel who helped us through some parts of the cloud setup, allowing us to use Max Series GPUs and 4th gen Xeon Processors for model training and inference.
Accomplishments we're proud of
Producing the first video-to-audio GenAI model pipeline in under 3 days. Overcoming various technical and non-technical obstacles along the way (overloaded network, laptop memory limit, little sleep) to produce a fully functioning web application which content creators, videographers and filmmakers can now use for audio inspiration.
What we learned
State of the art generative AI Picked up new tech stack and skills: first time using Flask and websockets, experimented OpenAI prompt generation, learned about Transformer models. Quick problem solving, iterating, and pivoting if blocked.
What's next
Accept longer form content, which would require access to more powerful compute (i.e. Intel Developer Cloud). Allow users to control the music generation process, providing additional context or specifications to their use cases. Fine tune the captioning model to understand context and moods for more agreeable generations. Speed up inference process by optimizing prompt generation.
TuneAI: Video/Image to Audio
Generative AI technology for audio content creation.
Going from Video to Audio, an example process:
Visual Input: Video background party
One Snapshot:
Captions with Blip: ['purple light shining on a crowd of people at a concert', 'purple light shining on a crowd of people at a concert', 'crowd of people at a concert with their hands in the air']
Prompt generation with OpenAI: EDM, Energetic, Pop with pulsating beats, synths, and euphoric crowd samples.
Audio generation with MusicGen: 10s music
Other Video Sources
Australia vs USA | Women's Beach Volleyball Gold Medal Match | Tokyo Replays Video background party Fly Me To The Moon - Stringspace Jazz Band Eating at Grand Central Oyster Bar NYC. Tourist Trap? or Classic Restaurant?
Analysis
View
Metric
- 19
- 14
- 11
- 3
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
- HTMLIn code
- Hugging FaceIn code
- JavaScriptIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- FlaskClaimed
- OpenAIClaimed
- VercelClaimed
7 of 10 appear in the indexed code. 3 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
34 KB
Source files
21
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
ryanmckim/CalHacks2023
63 files · 55.6 MB · @ e680fb3
Structure
Interface
4 files · 6%Screens, components and styles rendered to the user.
Application logic
13 files · 21%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
- Python29%
- YAML23%
- JavaScript19%
- Markdown14%
- CSS10%
- HTML5%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements/requirements.txt
pypi · 153- accelerate
- anyio
- argon2-cffi
- argon2-cffi-bindings
- arrow
- asttokens
- async-lru
- attrs
- av
- Babel
- backcall
- backports.functools-lru-cache
- beautifulsoup4
- bleach
- Bottleneck
- Brotli
- certifi
- cffi
- +135 more
frontend/package.json
npm · 10- @testing-library/jest-dom
- @testing-library/react
- @testing-library/user-event
- axios
- http-proxy-middleware
- react
- react-dom
- react-router-dom
- react-scripts
- web-vitals
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
Command-line pipeline for video/image to audio (gen_model.py)Verified
Generative AI technology for audio content creation, going from video to audio
Claimed on readmehigh confidencegen_model.py:125— main() ties together create_snapshots, caption_snapshots, openai_prompt, and generate_audio into one runnable pipeline for .mp4 and .jpg inputs
Example outputs (party.wav, captions, prompt) for sample videosVerified
README shows captions with BLIP, prompt generation with OpenAI, and generated audio for a party video example
Claimed on readmemedium confidencebackend/audio/party.wav— Referenced example output file exists in the repodata/party_snapshot.jpg— Referenced example snapshot image exists in the repo
Frame extraction from videoVerified
After upload the video file is spliced into multiple frames
Claimed on Devposthigh confidenceutilities.py:44— create_snapshots() uses cv2.VideoCapture to save frames at an interval
Music generation with Meta MusicGenVerified
The musical prompt is fed into Meta's MusicGen to produce audio
Claimed on Devposthigh confidenceutilities.py:39— MusicgenForConditionalGeneration.from_pretrained('facebook/musicgen-small') loadedutilities.py:112— generate_audio() runs the MusicGen model and writes a wav file via scipy
OpenAI GPT prompt generation from captionsVerified
Image descriptors are passed to OpenAI GPT which generates the musical prompt
Claimed on Devposthigh confidenceutilities.py:91— openai_prompt() sends captions to gpt-3.5-turbo via openai.ChatCompletion.create and returns a music-description string
React frontend video/image upload UIVerified
We used React to build our frontend
Claimed on Devposthigh confidencefrontend/src/VideoInput.js:17— React component with file input, handleUpload posts the file via axios to the Flask backendfrontend/src/pages/Demo.js:11— Demo page renders the VideoInput upload component
Video/image to caption extraction via BLIPVerified
Video is spliced into frames analyzed by Salesforce BLIP image-to-text model to produce descriptors
Claimed on Devposthigh confidenceutilities.py:24— BlipProcessor/BlipForConditionalGeneration loaded from Salesforce/blip-image-captioning-largeutilities.py:73— caption_snapshots() runs BLIP over each frame jpg and returns captions
Flask backend serving generated audio for uploaded contentCode-supported
Upload a video, and TuneAI will give you the perfect musical accompaniment
Claimed on Devposthigh confidencebackend/server.py:30— upload_video() saves the uploaded file but only has a comment '# send file path to ML model' with no actual call into gen_model.py/utilities.pybackend/server.py:7— get_audio only serves pre-generated audio for a hardcoded mapping of 3 filenames (nature_img.jpg, party.mp4, xmas.mp4), not for arbitrary uploads
End-to-end pipeline squashed into a single backend function, served by FlaskClaimed only
This whole pipeline is squashed into a function which is served on the backend (Flask)
Claimed on Devposthigh confidenceSocket.io for streaming/real-time audio deliveryClaimed only
Built with socket.io; first time using Flask and websockets
Claimed on Devposthigh confidenceIntel Cloud Max Series GPU for inference speedBlocked
Intel Cloud Max Series GPU allows us to perform inferencing at speed
Claimed on Devpostmedium confidenceVercel deployment of frontendBlocked
Deployed on Vercel
Claimed on Devpostmedium 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.