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)
Training, generation, and analysis code for Learning Particle Physics by Example: Location-Aware Generative Adversarial Networks for Physics

Location-Aware Generative Adversarial Networks (LAGAN) for Physics Synthesis This repository contains all the code used in L. de Oliveira (@lukedeo),

Deep Learning for HEP 57 Oct 22, 2022
Hub is a dataset format with a simple API for creating, storing, and collaborating on AI datasets of any size.

Hub is a dataset format with a simple API for creating, storing, and collaborating on AI datasets of any size. The hub data layout enables rapid transformations and streaming of data while training m

Activeloop 5.1k Jan 08, 2023
Enabling Lightweight Fine-tuning for Pre-trained Language Model Compression based on Matrix Product Operators

Enabling Lightweight Fine-tuning for Pre-trained Language Model Compression based on Matrix Product Operators This is our Pytorch implementation for t

RUCAIBox 12 Jul 22, 2022
This MVP data web app uses the Streamlit framework and Facebook's Prophet forecasting package to generate a dynamic forecast from your own data.

📈 Automated Time Series Forecasting Background: This MVP data web app uses the Streamlit framework and Facebook's Prophet forecasting package to gene

Zach Renwick 42 Jan 04, 2023
The Deep Learning with Julia book, using Flux.jl.

Deep Learning with Julia DL with Julia is a book about how to do various deep learning tasks using the Julia programming language and specifically the

Logan Kilpatrick 67 Dec 25, 2022
Official Implementation of LARGE: Latent-Based Regression through GAN Semantics

LARGE: Latent-Based Regression through GAN Semantics [Project Website] [Google Colab] [Paper] LARGE: Latent-Based Regression through GAN Semantics Yot

83 Dec 06, 2022
This Jupyter notebook shows one way to implement a simple first-order low-pass filter on sampled data in discrete time.

How to Implement a First-Order Low-Pass Filter in Discrete Time We often teach or learn about filters in continuous time, but then need to implement t

Joshua Marshall 4 Aug 24, 2022
Controlling Hill Climb Racing with Hand Tacking

Controlling Hill Climb Racing with Hand Tacking Opened Palm for Gas Closed Palm for Brake

Rohit Ingole 3 Jan 18, 2022
🕺Full body detection and tracking

Pose-Detection 🤔 Overview Human pose estimation from video plays a critical role in various applications such as quantifying physical exercises, sign

Abbas Ataei 20 Nov 21, 2022
This is a TensorFlow implementation for C2-Rec

This is a TensorFlow implementation for C2-Rec We refer to the repo SASRec. Requirements requirement.txt Datasets This repo includes Amazon Beauty dat

7 Nov 14, 2022
Official MegEngine implementation of CREStereo(CVPR 2022 Oral).

[CVPR 2022] Practical Stereo Matching via Cascaded Recurrent Network with Adaptive Correlation This repository contains MegEngine implementation of ou

MEGVII Research 309 Dec 30, 2022
Hyperparameters tuning and features selection are two common steps in every machine learning pipeline.

shap-hypetune A python package for simultaneous Hyperparameters Tuning and Features Selection for Gradient Boosting Models. Overview Hyperparameters t

Marco Cerliani 422 Jan 08, 2023
OpenMMLab Pose Estimation Toolbox and Benchmark.

Introduction English | 简体中文 MMPose is an open-source toolbox for pose estimation based on PyTorch. It is a part of the OpenMMLab project. The master b

OpenMMLab 2.8k Dec 31, 2022
Pytorch Lightning Implementation of SC-Depth Methods.

SC_Depth_pl: This is a pytorch lightning implementation of SC-Depth (V1, V2) for self-supervised learning of monocular depth from video. In the V1 (IJ

JiaWang Bian 216 Dec 30, 2022
OpenGAN: Open-Set Recognition via Open Data Generation

OpenGAN: Open-Set Recognition via Open Data Generation ICCV 2021 (oral) Real-world machine learning systems need to analyze novel testing data that di

Shu Kong 90 Jan 06, 2023
PyTorch implementation of Algorithm 1 of "On the Anatomy of MCMC-Based Maximum Likelihood Learning of Energy-Based Models"

Code for On the Anatomy of MCMC-Based Maximum Likelihood Learning of Energy-Based Models This repository will reproduce the main results from our pape

Mitch Hill 32 Nov 25, 2022
code for Multi-scale Matching Networks for Semantic Correspondence, ICCV

MMNet This repo is the official implementation of ICCV 2021 paper "Multi-scale Matching Networks for Semantic Correspondence.". Pre-requisite conda cr

joey zhao 25 Dec 12, 2022
Cross-Modal Contrastive Learning for Text-to-Image Generation

Cross-Modal Contrastive Learning for Text-to-Image Generation This repository hosts the open source JAX implementation of XMC-GAN. Setup instructions

Google Research 94 Nov 12, 2022
Implementation of momentum^2 teacher

Momentum^2 Teacher: Momentum Teacher with Momentum Statistics for Self-Supervised Learning Requirements All experiments are done with python3.6, torch

jemmy li 121 Sep 26, 2022
Code for the paper 'A High Performance CRF Model for Clothes Parsing'.

Clothes Parsing Overview This code provides an implementation of the research paper: A High Performance CRF Model for Clothes Parsing Edgar Simo-S

Edgar Simo-Serra 119 Nov 21, 2022