Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index out of bounds #37

Open
shoegazerstella opened this issue Nov 30, 2021 · 0 comments
Open

index out of bounds #37

shoegazerstella opened this issue Nov 30, 2021 · 0 comments

Comments

@shoegazerstella
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant