Lucid Sonic Dreams syncs GAN-generated visuals to music.

Overview

Lucid Sonic Dreams

Lucid Sonic Dreams syncs GAN-generated visuals to music. By default, it uses NVLabs StyleGAN2, with pre-trained models lifted from Justin Pinkney's consolidated repository. Custom weights and other GAN architectures can be used as well.

Sample output can be found on YouTube and Instagram.

Installation

This implementation has been teston on Python 3.6 and 3.7. As per NVLabs' TensorFlow implementation of StyleGAN2, TensorFlow 1.15 is required. TensorFlow 2.x is not supported.

To install, simply run:

pip install lucidsonicdreams

Usage

You may refer to the Lucid Sonic Dreams Tutorial Notebook for full parameter descriptions and sample code templates. A basic visualization snippet is also found below.

Basic Visualization

from lucidsonicdreams import LucidSonicDream


L = LucidSonicDream(song = 'song.mp3',
                    style = 'abstract photos')

L.hallucinate(file_name = 'song.mp4') 
Comments
  • where to place .pkl model files?

    where to place .pkl model files?

    Hi,

    Thanks for the fantastic repo,

    I really want to drop a custom .pkl model file into LucidSonicDreams and it isn't obvious to me where I should put it? I'm working in Colab for the time being.

    Thanks,

    Mark

    opened by markhanslip 1
  • Installing in Ubuntu 20.04 ?

    Installing in Ubuntu 20.04 ?

    Hi I tried now for hours to install Lucid Sonic Dreams in Ubuntu 20.04. How to install it correctly so that it works ? I tried it with anaconda but no luck....a little desperate now ! Update: Installed everything without errors. Used the setup.py to install dependencies. But now i am stuck. Where and how to execute this:

    from lucidsonicdreams import show_styles

    Show valid default style names. show_styles()

    or this ?

    "from lucidsonicdreams import LucidSonicDream

    L = LucidSonicDream(song = 'song.mp3', style = 'abstract photos')

    L.hallucinate(file_name = 'song.mp4') " ??

    Can someone enlighten me please ?

    opened by Colliwomple 0
  • Fix for broken Deps possibly?  Please advise!  LSD colab is BROKEN!  Thanks!

    Fix for broken Deps possibly? Please advise! LSD colab is BROKEN! Thanks!

    See - https://github.com/mikaelalafriz/lucid-sonic-dreams/compare/main...pollinations:lucid-sonic-dreams:main suggestion for pollinations to mod to self refer so their fixes they made can be used, otherwise its referring to the same broken changes that you have that are breaking the colabs for LSD.

    [fuse bias errors mostly to do with incompatibilities in breaking changes to several depenancies and potential v2 v3 python issues with v1/v2 tensorflow.]

    ITs fixable but we need to specify the old working dependencies from what i can see, not the new breaking ones. All this began after the default code attempted to integrate ADA from what i could see? Correct me if i am wrong thanks!

    opened by cleancoindev 1
  • Real time support

    Real time support

    Hi,

    First, thank you for your great work - it's incredible!

    I was wondering if, in your opinion, it would be possible to extend your work to generate the visuals in real-time. This would mean using streaming of audio data (or, possibly, MIDI) rather than pre-rendered files. I guess the frame rate can be a little low at 1024, but it would be still great to have this option for someone who has a lot of GPUs. Do you think it would be anyhow realistic?

    Keep up the amazing work!

    opened by lowlypalace 0
  • ModuleNotFoundError: No module named 'lucidsonicdreams'

    ModuleNotFoundError: No module named 'lucidsonicdreams'

    Im trying to run a test and this is the way i have the python file typed. Any help would be appreciated

    (command i input)= python proud.py (to run the python below)

    from lucidsonicdreams import LucidSonicDream

    L = LucidSonicDream(song = 'proud.mp3', style = 'abstract photos')

    L.hallucinate(file_name = 'proud.mp4', resolution = 360, start = 30, duration = 45)

    files.download("proud of you.mp4")

    Error im getting

    Traceback (most recent call last): File "proud.py" line 1 in from lucidsonicdreams import LucidSonicDream ModuleNotFoundError: No module named 'lucidsonicdreams

    Screenshot (4) '

    opened by Texagon 3
  • index out of bounds

    index out of bounds

    Hi! I am trying out the script in order to sync some images I have generated using VQGAN+CLIP to my audio. Here's the code:

    def load_imgs(noise_batch, class_batch):
        # just loads N images randomly
        return images
    
    L = LucidSonicDream('audio_5.mp3',
                        style = load_imgs, 
                        input_shape = 592,
                        num_possible_classes = 1000)
    
    L.hallucinate('video_sync.mp4',
                  output_audio = 'audio_sync.mp3',
                  speed_fpm = 3,
                  classes = [13, 14, 22, 24, 301, 84, 99, 100, 134, 143, 393, 394],
                  class_shuffle_seconds = 10, 
                  class_shuffle_strength = 0.1,
                  class_complexity = 0.5,
                  class_smooth_seconds = 4,
                  motion_react = 0.35,
                  flash_strength = 1)
                  #contrast_strength = 0.5)
    

    The error appears just at the end of the process:

    IndexError                                Traceback (most recent call last)
    <ipython-input-15-aeedb41e1387> in <module>()
         15               class_smooth_seconds = 4,
         16               motion_react = 0.35,
    ---> 17               flash_strength = 1)
         18               #contrast_strength = 0.5)
    
    2 frames
    /usr/local/lib/python3.7/dist-packages/lucidsonicdreams/main.py in apply_effect(self, array, index)
        742     '''Apply effect to image (array)'''
        743 
    --> 744     amplitude = self.spec[index]
        745     return self.func(array=array, strength = self.strength, amplitude=amplitude)
    
    IndexError: index 207 is out of bounds for axis 0 with size 207
    

    Any idea on how to avoid it? Thanks in advance!

    opened by shoegazerstella 0
Releases(v_04)
Code for "Multi-Time Attention Networks for Irregularly Sampled Time Series", ICLR 2021.

Multi-Time Attention Networks (mTANs) This repository contains the PyTorch implementation for the paper Multi-Time Attention Networks for Irregularly

The Laboratory for Robust and Efficient Machine Learning 68 Dec 17, 2022
WORD: Revisiting Organs Segmentation in the Whole Abdominal Region

WORD: Revisiting Organs Segmentation in the Whole Abdominal Region. This repository provides the codebase and dataset for our work WORD: Revisiting Or

Healthcare Intelligence Laboratory 71 Jan 07, 2023
TalkNet 2: Non-Autoregressive Depth-Wise Separable Convolutional Model for Speech Synthesis with Explicit Pitch and Duration Prediction.

TalkNet 2 [WIP] TalkNet 2: Non-Autoregressive Depth-Wise Separable Convolutional Model for Speech Synthesis with Explicit Pitch and Duration Predictio

Rishikesh (ऋषिकेश) 69 Dec 17, 2022
The devkit of the nuPlan dataset.

The devkit of the nuPlan dataset.

Motional 264 Jan 03, 2023
MASA-SR: Matching Acceleration and Spatial Adaptation for Reference-Based Image Super-Resolution (CVPR2021)

MASA-SR Official PyTorch implementation of our CVPR2021 paper MASA-SR: Matching Acceleration and Spatial Adaptation for Reference-Based Image Super-Re

DV Lab 126 Dec 20, 2022
Reusable constraint types to use with typing.Annotated

annotated-types PEP-593 added typing.Annotated as a way of adding context-specific metadata to existing types, and specifies that Annotated[T, x] shou

125 Dec 26, 2022
Official repository for "Exploiting Session Information in BERT-based Session-aware Sequential Recommendation", SIGIR 2022 short.

Session-aware BERT4Rec Official repository for "Exploiting Session Information in BERT-based Session-aware Sequential Recommendation", SIGIR 2022 shor

Jamie J. Seol 22 Dec 13, 2022
This is a work in progress reimplementation of Instant Neural Graphics Primitives

Neural Hash Encoding This is a work in progress reimplementation of Instant Neural Graphics Primitives Currently this can train an implicit representa

Penn 79 Sep 01, 2022
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
Picasso: a methods for embedding points in 2D in a way that respects distances while fitting a user-specified shape.

Picasso Code to generate Picasso embeddings of any input matrix. Picasso maps the points of an input matrix to user-defined, n-dimensional shape coord

Pachter Lab 45 Dec 23, 2022
To provide 100 JAX exercises over different sections structured as a course or tutorials to teach and learn for beginners, intermediates as well as experts

JaxTon 💯 JAX exercises Mission 🚀 To provide 100 JAX exercises over different sections structured as a course or tutorials to teach and learn for beg

Rohan Rao 512 Jan 01, 2023
Code for "LoRA: Low-Rank Adaptation of Large Language Models"

LoRA: Low-Rank Adaptation of Large Language Models This repo contains the implementation of LoRA in GPT-2 and steps to replicate the results in our re

Microsoft 394 Jan 08, 2023
Deep Learning for Morphological Profiling

Deep Learning for Morphological Profiling An end-to-end implementation of a ML System for morphological profiling using self-supervised learning to di

Danielh Carranza 0 Jan 20, 2022
Siamese TabNet

Raifhack-DS-2021 https://raifhack.ru/ - Команда Звёздочка Siamese TabNet Сиамская TabNet предсказывает стоимость объекта недвижимости с price_type=1,

Daniel Gafni 15 Apr 16, 2022
Reinforcement learning library(framework) designed for PyTorch, implements DQN, DDPG, A2C, PPO, SAC, MADDPG, A3C, APEX, IMPALA ...

Automatic, Readable, Reusable, Extendable Machin is a reinforcement library designed for pytorch. Build status Platform Status Linux Windows Supported

Iffi 348 Dec 24, 2022
This is the code of NeurIPS'21 paper "Towards Enabling Meta-Learning from Target Models".

ST This is the code of NeurIPS 2021 paper "Towards Enabling Meta-Learning from Target Models". If you use any content of this repo for your work, plea

Su Lu 7 Dec 06, 2022
The best solution of the Weather Prediction track in the Yandex Shifts challenge

yandex-shifts-weather The repository contains information about my solution for the Weather Prediction track in the Yandex Shifts challenge https://re

Ivan Yu. Bondarenko 15 Dec 18, 2022
Code for the paper Relation Prediction as an Auxiliary Training Objective for Improving Multi-Relational Graph Representations (AKBC 2021).

Relation Prediction as an Auxiliary Training Objective for Knowledge Base Completion This repo provides the code for the paper Relation Prediction as

Facebook Research 85 Jan 02, 2023
Ἀνατομή is a PyTorch library to analyze representation of neural networks

Ἀνατομή is a PyTorch library to analyze representation of neural networks

Ryuichiro Hataya 50 Dec 05, 2022
GAN-based Matrix Factorization for Recommender Systems

GAN-based Matrix Factorization for Recommender Systems This repository contains the datasets' splits, the source code of the experiments and their res

Ervin Dervishaj 9 Nov 06, 2022