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

Apply color labels to regions of Audio component #2023

Closed
1 task done
Tracked by #5321
stevenhillis opened this issue Aug 16, 2022 · 6 comments
Closed
1 task done
Tracked by #5321

Apply color labels to regions of Audio component #2023

stevenhillis opened this issue Aug 16, 2022 · 6 comments
Labels
new component Involves creating a new component

Comments

@stevenhillis
Copy link

stevenhillis commented Aug 16, 2022

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
I am working with audio data. I don't have an intuitive way to label regions of that audio in a way that ties directly back to the audio playback.

Describe the solution you'd like
I would like to be able to specify a list of tuples like [(start_time_seconds, end_time_seconds, region_label)] for an Audio component. I would like to be able to specify this at instantiation, and I would also like to be able to interact with it in a block through callbacks to update my regions. I don't mind if colors are assigned automatically, but it would also be nice to specify a mapping between a region_label and a color. I think seaborn has this sort of behavior pretty well figured out. I would like a key displayed somewhere on the component, and I might like the region_label to appear on_hover over a region. When handling input, I'd like a text box to appear above the selected region for users to enter the region_label.

Additional context

  • Potential use cases:
    • Input:
      • Allow users to specify smaller regions of long audios to learn from or process
    • Output:
      • Speaker Diarization
      • Language Identification
      • VAD

Here's a dumb photoshop of what I'm wanting:
Colored_Audio

@abidlabs
Copy link
Member

Hi @stevenhillis thanks for the issue! This totally makes sense, although I'm not sure if we should adapt the existing Audio component or create a new component. Will leave as an open issue for now and update once we've discussed some more internally

@abidlabs abidlabs added enhancement New feature or request new component Involves creating a new component labels Aug 16, 2022
@stevenhillis
Copy link
Author

Hi @abidlabs, bumping this. Which way are the internal winds blowing?

@abidlabs
Copy link
Member

abidlabs commented Sep 18, 2022

Hi @stevenhillis recently we've had a lot of requests for new components or new variations of components like this one. We’re planning on making a framework to make it easy to create custom Gradio components — this is on our roadmap but is still 1-2 months out. So I think we’ll hold off on implementing this component ourselves but will work in making it easy for an interested user to create such a component themselves

cc @pngwn

@pngwn
Copy link
Member

pngwn commented Sep 27, 2022

The Audio component does need overhauling as I don't think it is really good enough right now but as @abidlabs said that won't be happening immediately. When we do overhaul we will need to consider what kinds of features it should support. Gradio components should be solving the 80% case, while the remaining 'niche' cases can be solved in userland with the upcoming customisation options/APIs.

I do not know where this features sits in the that context but happy to have that conversation. There is a tracking issue here with relatively little detail but I'd love to get your thoughts on what the Audio component should and shouldn't support and how we can improve the usability (both for developers and end users).

@abidlabs abidlabs removed the enhancement New feature or request label Dec 14, 2022
@abidlabs abidlabs added this to the Gradio 4.0 milestone Feb 21, 2023
@abidlabs abidlabs removed this from the 4.0 milestone May 25, 2023
@abidlabs
Copy link
Member

abidlabs commented Nov 7, 2023

Hi! We've now made it possible for Gradio users to create their own custom components -- meaning that you can write some Python and JavaScript (Svelte), and publish it as a Gradio component. You can use it in your own Gradio apps, or share it so that anyone can use it in their Gradio apps. Here are some examples of custom Gradio components:

You can see the source code for those components by clicking the "Files" icon and then clicking "src". The complete source code for the backend and frontend is visible. In particular, its very fast if you want to build off an existing component. We've put together a Guide: https://www.gradio.app/guides/five-minute-guide, and we're happy to help if you'd like to put together a custom component for this issue

@abidlabs
Copy link
Member

abidlabs commented Dec 5, 2023

I'll go ahead and close this issue since we are not planning to include this in the core Gradio library. But happy to help if you are interested in making this a custom Gradio component (feel free to ask questions in this issue).

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new component Involves creating a new component
Projects
None yet
Development

No branches or pull requests

3 participants