"With these components, you can quickly create and launch an interface."
]
},
{
"cell_type": "markdown",
"id": "46e5071f",
"metadata": {},
"source": [
"### Uses of Gradio"
]
},
{
"cell_type": "markdown",
"id": "94a5d6f2",
"metadata": {},
"source": [
"Gradio is compatible with machine l"
"Gradio can load in data, similar to pandas frames, by using the command `gradio.inputs.Dataframe(data_name)`. It can only take in strings, numbers, bools, and dates as data types. Gradio does not contain a library of datasets, so data must be input by the user. It can also work with time series, images, audio, video, and generic file uploads.\n",
"\n",
"Applications:\n",
"- Machine learning interface\n",
" - Image classification.\n",
" - Text generation interface (e.g. ChatBot).\n",
"\n",
"- Audio and video editing \n",
" - Reverse audio files.\n",
" - Flip video files.\n",
" - Using machine learning, gradio can detect the main note in an inputted audio file. \n",
" \n",
"- File Outputs:\n",
" - Zip files directly within Python.\n",
" - Output your data in various file formats including JSON, HTML, PNG, etc.\n",
" - Using a function called `.Carousel()`, Gradio can output a set of components that can be easily scrolled through. "
]
},
{
...
...
@@ -167,7 +190,7 @@
"source": [
"LEFT TO ANSWER:\n",
"\n",
"An overview of what data is are available in the data or tool\n",
"An overview of what data is are available in the tool\n",
" It can be used with image classification...\n",
"\n",
"An example question and visualization that that the data or tool can answer (this should be unique)\n",
...
...
%% Cell type:markdown id:7227f3fa tags:
## Gradio: How you can build a GUI within a Jupyter Notebook
#### By Team JACT
%% Cell type:markdown id:ba81c68d tags:
## Getting Started
First, the gradio library must be installed on your computer. It requires Python 3.7 or later. If you have not done so already, please check your version of Python and run the following line of code:
%% Cell type:code id:cdfdbb3e tags:
``` python
!python--version
```
%% Output
Python 3.9.7
%% Cell type:code id:8f5edb3b tags:
``` python
#!pip install gradio
```
%% Cell type:markdown id:f76c9232 tags:
Next, import the library as follows:
%% Cell type:code id:227461d8 tags:
``` python
importgradioasgr
```
%% Cell type:markdown id:c3d4eb50 tags:
Gradio can be used with a wide range of media-text, pictures, video, and sound. It is most useful for demonstrating machine learning algorithms.
To get a feel for how it works, run the cell below this one. An interface will automatically pop up within the Jupyter Notebook. You can type your input directing into the interface.
To create a public link, set `share=True` in `launch()`.
(<fastapi.applications.FastAPI at 0x7f8979fb7f40>,
'http://127.0.0.1:7861/',
None)
%% Cell type:markdown id:8469e7e7 tags:
### The Interface
The core interface has three parameters:
1. fn: The function.
2. inputs: The input component.
3. outputs: The output component.
With these components, you can quickly create and launch an interface.
%% Cell type:markdown id:46e5071f tags:
### Uses of Gradio
%% Cell type:markdown id:94a5d6f2 tags:
Gradio is compatible with machine l
Gradio can load in data, similar to pandas frames, by using the command `gradio.inputs.Dataframe(data_name)`. It can only take in strings, numbers, bools, and dates as data types. Gradio does not contain a library of datasets, so data must be input by the user. It can also work with time series, images, audio, video, and generic file uploads.
Applications:
- Machine learning interface
- Image classification.
- Text generation interface (e.g. ChatBot).
- Audio and video editing
- Reverse audio files.
- Flip video files.
- Using machine learning, gradio can detect the main note in an inputted audio file.
- File Outputs:
- Zip files directly within Python.
- Output your data in various file formats including JSON, HTML, PNG, etc.
- Using a function called `.Carousel()`, Gradio can output a set of components that can be easily scrolled through.
%% Cell type:markdown id:1196a4c1 tags:
LEFT TO ANSWER:
An overview of what data is are available in the data or tool
An overview of what data is are available in the tool
It can be used with image classification...
An example question and visualization that that the data or tool can answer (this should be unique)
How this data or tool could be used in some of the team projects (maybe not your own)
Proper references to any resources used to build the tutorial