GithubHelp home page GithubHelp logo

haofanwang / visbeat3 Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 8.0 10.81 MB

Python3 Implementation for 'Visual Rhythm and Beat' SIGGRAPH 2018

License: Other

Python 97.98% Jupyter Notebook 2.02%
visbeat python3 visbeat3 colab jupyter-notebook

visbeat3's Introduction

visbeat3

This is a migration of visbeat from Python2 to Python3. Head over to an example notebook on Colab!

This work presents a visual analogue for musical rhythm derived from an analysis of motion in video, and shows that alignment of visual rhythm with its musical counterpart results in the appearance of dance. You can visit the official project page and demos for more infos.

Install

$ pip3 install visbeat3

Usage

import os
import time

import matplotlib
import matplotlib.pyplot as plt

import numpy as np
import visbeat3 as vb

source_video = vb.PullVideo(name='video', source_location='./data/01.mp4')

# You can also directly specify an audio
# source_audio = vb.Audio('./data/all star.mp3')
source_audio = vb.PullVideo(name='audio', source_location='./data/02.mp4')

synch_video_beat = 0
synch_audio_beat = 0
nbeats = 32

output_path = './result.mp4'

# If source_audio is from an audio file, use target=source_audio 
warped = vb.Dancify(source_video=source_video, 
                    target=source_audio.getAudio(), 
                    synch_video_beat=synch_video_beat,
                    synch_audio_beat=synch_audio_beat, 
                    force_recompute=True, 
                    warp_type='quad',
                    nbeats=nbeats, 
                    output_path=output_path)

Used By

video-bgm-generation: video background music generation.

Reference

@inproceedings{davis2018visual,
  title={Visual rhythm and beat},
  author={Davis, Abe and Agrawala, Maneesh},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops},
  pages={2532--2535},
  year={2018}
}

visbeat3's People

Contributors

haofanwang avatar wangqixun avatar wzk1015 avatar

Stargazers

Yutong Wang avatar min-sun Kim avatar  avatar  avatar well well avatar  avatar  avatar Shuai Zhao avatar  avatar jokingww avatar melodyless avatar ExponentialML avatar  avatar Kidding avatar  avatar Will Boyd avatar Chiantine P. Manigos avatar

Watchers

 avatar ExponentialML avatar

visbeat3's Issues

not work

os.rename(self.getJSONPath(), self.getDir('backup') + os.sep + self.AOBJECT_TYPE() + ".json");
FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: './VisBeatAssets/VideoSources\video\VideoSource.json' -> './VisBeatAssets/VideoSources\video\Data\Backups\\VideoSource.json'

Fix imageio-ffmpeg bug with Dancify inference

I was getting this error after Dancify inference. A series of errors were as follows:

Fatal Python error: could not acquire lock for <_io.BufferedReader name=11> at interpreter shutdown, possibly due to daemon threads

This was due to a bug with imageio-ffmpeg not being the latest version, or not being installed.

pip install imageio-ffmpeg --upgrade # If already installed

Bugs find in visbeat3/Video_CV.py

line 160: nsamples should be explicitly set as an integer -- "nsamples = int(sampling_rate*duration);"
line 244: "librosa.beat.estimate_tempo" should be changed as "librosa.beat.tempo"
line 418: histsize should be explicitly set as an integer -- "histsize = int(128/int(np.power(2,HISTOGRAM_DOWNSAMPLE_LEVELS)))"

Fix Dancify Inference

Dancify wasn't working for me, but I found the issue in my case.
There's a bug with the new update that doesn't allow Dancify to run properly. This fixes it.

Change this:

USING_OPENCV=False;

To True:

USING_OPENCV=True;

It could also be removed because OpenCV seems to be a prerequisite, but doing so may also break the install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.