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)
Owner
null
A neuroanatomy-based augmented reality experience powered by computer vision. Features 3D visuals of the Atlas Brain Map slices.

Brain Augmented Reality (AR) A neuroanatomy-based augmented reality experience powered by computer vision that features 3D visuals of the Atlas Brain

Yasmeen Brain 10 Oct 6, 2022
Lucid library adapted for PyTorch

Lucent PyTorch + Lucid = Lucent The wonderful Lucid library adapted for the wonderful PyTorch! Lucent is not affiliated with Lucid or OpenAI's Clarity

Lim Swee Kiat 520 Dec 26, 2022
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

MagInkCal This repo contains the code needed to drive an E-Ink Magic Calendar that uses a battery powered (PiSugar2) Raspberry Pi Zero WH to retrieve

null 2.8k Dec 28, 2022
GAN-generated image detection based on CNNs

GAN-image-detection This repository contains a GAN-generated image detector developed to distinguish real images from synthetic ones. The detector is

Image and Sound Processing Lab 17 Dec 15, 2022
FuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space OptimizationFuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space Optimization

FuseDream This repo contains code for our paper (paper link): FuseDream: Training-Free Text-to-Image Generation with Improved CLIP+GAN Space Optimizat

XCL 191 Dec 31, 2022
DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time

DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time Introduction This is official implementation for DR-GAN (IEEE TCS

Kang Liao 18 Dec 23, 2022
PyTorch implementation of ECCV 2020 paper "Foley Music: Learning to Generate Music from Videos "

Foley Music: Learning to Generate Music from Videos This repo holds the code for the framework presented on ECCV 2020. Foley Music: Learning to Genera

Chuang Gan 30 Nov 3, 2022
E2e music remastering system - End-to-end Music Remastering System Using Self-supervised and Adversarial Training

End-to-end Music Remastering System This repository includes source code and pre

Junghyun (Tony) Koo 37 Dec 15, 2022
[ICLR 2021] Rank the Episodes: A Simple Approach for Exploration in Procedurally-Generated Environments.

[ICLR 2021] RAPID: A Simple Approach for Exploration in Reinforcement Learning This is the Tensorflow implementation of ICLR 2021 paper Rank the Episo

Daochen Zha 48 Nov 21, 2022
Official Pytorch implementation of paper "Reverse Engineering of Generative Models: Inferring Model Hyperparameters from Generated Images"

Reverse_Engineering_GMs Official Pytorch implementation of paper "Reverse Engineering of Generative Models: Inferring Model Hyperparameters from Gener

null 100 Dec 18, 2022
BARTScore: Evaluating Generated Text as Text Generation

This is the Repo for the paper: BARTScore: Evaluating Generated Text as Text Generation Updates 2021.06.28 Release online evaluation Demo 2021.06.25 R

NeuLab 196 Dec 17, 2022
Tracing Versus Freehand for Evaluating Computer-Generated Drawings (SIGGRAPH 2021)

Tracing Versus Freehand for Evaluating Computer-Generated Drawings (SIGGRAPH 2021) Zeyu Wang, Sherry Qiu, Nicole Feng, Holly Rushmeier, Leonard McMill

Zach Zeyu Wang 23 Dec 9, 2022
A Nim frontend for pytorch, aiming to be mostly auto-generated and internally using ATen.

Master Release Pytorch - Py + Nim A Nim frontend for pytorch, aiming to be mostly auto-generated and internally using ATen. Because Nim compiles to C+

Giovanni Petrantoni 425 Dec 22, 2022
Rename Images with Auto Generated Neural Image Captions

Recaption Images with Generated Neural Image Caption Example Usage: Commandline: Recaption all images from folder /home/feng/Downloads/images to folde

feng wang 3 May 1, 2022
Fast and robust clustering of point clouds generated with a Velodyne sensor.

Depth Clustering This is a fast and robust algorithm to segment point clouds taken with Velodyne sensor into objects. It works with all available Velo

Photogrammetry & Robotics Bonn 957 Dec 21, 2022
Convolutional neural network that analyzes self-generated images in a variety of languages to find etymological similarities

This project is a convolutional neural network (CNN) that analyzes self-generated images in a variety of languages to find etymological similarities. Specifically, the goal is to prove that computer vision can be used to identify cognates known to exist, and perhaps lead linguists to evidence of unknown cognates.

null 1 Feb 3, 2022
Utilities to bridge Canvas-generated course rosters with GitLab's API.

gitlab-canvas-utils A collection of scripts originally written for CSE 13S. Oversees everything from GitLab course group creation, student repository

Eugene Chou 5 Jun 8, 2022
A Fast and Stable GAN for Small and High Resolution Imagesets - pytorch

A Fast and Stable GAN for Small and High Resolution Imagesets - pytorch The official pytorch implementation of the paper "Towards Faster and Stabilize

Bingchen Liu 455 Jan 8, 2023