Skip to content
Snippets Groups Projects
Commit 357521af authored by krupczak's avatar krupczak Committed by Colbry, Dirk
Browse files

GUI Tutorial

parent c37cd3b5
No related branches found
No related tags found
No related merge requests found
.DS_Store 0 → 100644
File added
%% 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
import gradio as gr
```
%% 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.
%% Cell type:code id:92c83d6b tags:
``` python
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()
```
%% Output
Running on local URL: http://127.0.0.1:7861/
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:94a5d6f2 tags:
Gradio is compatible with machine l
%% Cell type:markdown id:1196a4c1 tags:
LEFT TO ANSWER:
An overview of what data is are available in the data or 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
%% Cell type:markdown id:500e9ab6 tags:
Sources:
https://www.analyticsvidhya.com/blog/2021/04/create-interface-for-your-machine-learning-models-using-gradio-python-library/
https://gradio.app/getting_started/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment