Skip to content

ParallelProcessor usage #515

@keithchan9999

Description

@keithchan9999

Expected behaviour

Please describe how you expected madmom to behave.

Actual behaviour

I am trying to run both a beat processor and a tempo processor which wraps under a parallel processor. But I got an error like this:

File "mad.py", line 158, in main
madmom.processors.process_online(parallel_processor, **kwargs)
File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 885, in process_online
_process((processor, frame, outfile, process_args))
File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 289, in _process
return process_tuple[0](*process_tuple[1:-1], **process_tuple[-1])
File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 120, in call
return self.process(*args, **kwargs)
TypeError: process() takes 2 positional arguments but 3 were given

Tried to troubleshoot but unfortunately I ain't any expert on that.

Steps needed to reproduce the behaviour

kwargs = dict(
		fps = 100,
		correct = True,
		infile = None,
		outfile = None,
		max_bpm = 150,
		min_bpm = 60,
		num_frames = 1,
		online = True,
		stream_input_device = dev_index,
		#nn_files = [BEATS_LSTM[0], BEATS_LSTM[1], BEATS_LSTM[2], BEATS_LSTM[3], BEATS_LSTM[4]]
		#verbose = 1
	)

	in_processor = madmom.features.beats.RNNBeatProcessor(**kwargs)
	beat_processor = madmom.features.beats.DBNBeatTrackingProcessor(**kwargs)
	out_processor = [beat_processor, beat_callback]
	processor = madmom.processors.IOProcessor(in_processor, out_processor)

	tempo_processor = madmom.features.tempo.TempoEstimationProcessor(**kwargs)
	out2_processor = [tempo_processor, tempo_callback]
	processor2 = madmom.processors.IOProcessor(in_processor, out2_processor)

	parallel_processor = madmom.processors.ParallelProcessor([processor, processor2], num_threads=2)
	madmom.processors.process_online(parallel_processor, **kwargs)

Information about installed software

Please provide some information about installed software.

import madmom
import numpy as np
import scipy

madmom.__version__
np.__version__
scipy.__version__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions