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

Toggle Spectrogram Preview for Audio #384

Open
Path-A opened this issue Aug 3, 2020 · 22 comments
Open

Toggle Spectrogram Preview for Audio #384

Path-A opened this issue Aug 3, 2020 · 22 comments
Assignees
Labels
audio community:feature-request Feature Request from the community reviewed by the community team. community:reviewed Issue has been reviewed by the Label Studio Community Team. editor Label Studio Frontend feature Feature request often asked
Milestone

Comments

@Path-A
Copy link

Path-A commented Aug 3, 2020

Is your feature request related to a problem? Please describe.
Classifying or segmenting audio with only a waveform preview can be time-consuming or difficult, especially with noisy audio data. Some data is more easily segmented by looking at frequency content over time.

Describe the solution you'd like
Include a toggle to preview a spectrogram representation of an audio clip. Some common python libraries to generate these are Librosa or Scipy.signal.

Describe alternatives you've considered
I've manually generated the spectrograms and saved them as images to be used within the image classification labeling tool. The downsides of this are threefold.

  1. Labeling audio this way does not allow for temporal segmentation. The user must classify the entire spectrogram, not simply a vertical fraction of it. A user could, in theory, use the image annotation tool, but it would be tedious and the user would need to convert bounding boxes to its corresponding time in the audio clip.
  2. The user can no longer listen to the audio clip while viewing the spectrogram image.
  3. The user generated spectograms require temporary additional storage requirements.

Additional context
Each user's spectrogram needs may differ, such as their sound of interest being within the low or high frequency areas of the spectrogram. To keep implementation simple, use default spectrogram parameters that generalize well and potentially allow users to zoom in on this general spectrogram. A more robust solution would allow the user to specify a few parameters to generate the spectrogram that they would want. Lastly, I include an example of a log-scaled spectrogram with its accompanying waveform.
Example

@makseq
Copy link
Member

makseq commented Aug 3, 2020

@Path-A Thank you for your issue. Are you familiar with React?

@Path-A
Copy link
Author

Path-A commented Aug 4, 2020

@makseq Unfortunately not, although I've been wanting to learn.

@niklub niklub added the feature Feature request label Mar 29, 2021
@feddybear
Copy link

feddybear commented Apr 26, 2021

For future reference, I think the challenge here is more of understanding the multicanvas code of wavesurfer.
I was able to successfully use the spectrogram functions but could only implement it on the older single canvas implementation. Unfortunately, for long audio files, this is impractical because of the need to recalculate and redraw spectra when zooming, etc. If pre-segmentation is done, it becomes more practical. But segmentation of audio (especially for speech technology applications) isn't perfect.
Here's a sample demonstration as reference: LINK
It takes about 12-14 seconds per zoom value on a 3-minute file (using N=512 fft samples).

@makseq
Copy link
Member

makseq commented Apr 26, 2021

@feddybear Wow! It's very impressive! Do you have an account on our slack? https://label-studio.slack.com/

@feddybear
Copy link

@feddybear Wow! It's very impressive! Do you have an account on our slack? https://label-studio.slack.com/

Hi @makseq yeah I also mentioned this on one of the spectrogram inquiries there. But I'm leaving it to someone more capable, especially in reading the wavesurfer multicanvas codes. Hopefully it's also someone who knows signal processing, as the older implementation of drawing spectrogram on wavesurfer had some really weird canvas settings that didn't make sense (e.g. height of the spectrogram).

@makseq
Copy link
Member

makseq commented Apr 26, 2021

@feddybear Let's move to slack. I know DSP, also we'll include our frontend team there.

@makseq
Copy link
Member

makseq commented Apr 26, 2021

@feddybear please, tag me again (@makseq). I can't find my mention there.

@Tom-Lu
Copy link

Tom-Lu commented May 21, 2021

I'm also seeking for similar feature, any progress so far?

@makseq
Copy link
Member

makseq commented May 22, 2021

@Tom-Lu
We have some news from our contributor:
https://github.com/feddybear/label-studio-frontend

I hope we will make this work to the end.

@tpeet
Copy link

tpeet commented Jul 8, 2021

Would be also very interested in this feature, as it is currently hard to select regions for audio with low SNR

@makseq makseq added this to the Label Studio 1.3 milestone Jul 9, 2021
@niklub niklub removed this from the Label Studio 1.3 milestone Aug 30, 2021
@Path-A
Copy link
Author

Path-A commented Sep 30, 2021

Has there been any progress regarding development of this feature?

@makseq
Copy link
Member

makseq commented Sep 30, 2021

Only if @feddybear has any news.
We are currently focusing on the image / html tagging. Audio updates are planned for next year.

@feddybear
Copy link

feddybear commented Oct 1, 2021

Sorry, I have yet to integrate the spectrogram-related edits from the previous version to the latest one. Also, kinda occupied with other stuff outside of annotation.

@makseq makseq added this to the Future milestone Oct 4, 2021
@makseq makseq added often asked audio editor Label Studio Frontend labels Oct 5, 2021
@Selimonder
Copy link

Hello,

Has there been any progress regarding the development of this feature?

@mikolajpabiszczak
Copy link

I know it's irritating with people asking again & again, but it would be really useful to have this, any news about this?

@makseq
Copy link
Member

makseq commented May 19, 2022

Thank you for asking. By your activity we prioritize features, so it isn't irritating :-)
@nicholasrq had some progress in Audio Plus Engine, but I heard that we haven't still implemented spectrograms :-( I will draw the attention of our team to this feature request.

@faroit
Copy link

faroit commented May 24, 2022

@makseq @feddybear also 👍 for spectrograms!

@mcgee0916
Copy link

Hello,
Has there been any progress about this feature?

@cspindler
Copy link

👍 Yes, spectrogram annotation would be fantastic. But it would be just the start - with the spectrogram view available, the following features would be super useful:

  • RectangleLabels in the spectrogram (time and frequency range)
  • Audio playback speed control (with and without time-stretching), especially slowing down to 0.1 of original speed.
  • Choices of frequency scaling (lin, log, mel, bark)
  • Zoom (time and frequency)

I'm not familiar with React at all, but that could change.

We're building a pipeline to annotate bats in high-frequency audio recordings, based on batdetect2. They also have a labelling UI that checks many of the boxes UI-wise, except the handling of large amount of tasks, users, storage backends etc. - all the golden labelstud.io features.

@paulpeyret-biophonia
Copy link

Hello,

I would love to see this feature for spectrogram annotation with sound playback. There is a huge demand from all the bioacoustics and eco-acoustics community (who are still working on desktop app like audacity and raven for annotations).
@cspindler I think you well described the need.

I understand that spectrogram calculation speed is a bottleneck here for the zooming feature inside the spectrogram.
Maybe these libs can help get descent speeds.
libAudioFlux/audioFlux#22

Hopping this feature will come soon.
Cheers

@samvelkoch
Copy link

Up for specs in audio labeling

@sajarin sajarin added community:reviewed Issue has been reviewed by the Label Studio Community Team. community:feature-request Feature Request from the community reviewed by the community team. labels May 1, 2024
@sajarin
Copy link
Contributor

sajarin commented May 1, 2024

/jira create

Workflow run
Jira issue TRIAG-527 is created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio community:feature-request Feature Request from the community reviewed by the community team. community:reviewed Issue has been reviewed by the Label Studio Community Team. editor Label Studio Frontend feature Feature request often asked
Projects
None yet
Development

No branches or pull requests