Generating image
#1
by
DebasishDhal99
- opened
app.py
CHANGED
@@ -2,7 +2,6 @@ import matplotlib.pyplot as plt
|
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
def generate_random_walk(iters):
|
7 |
directions = ['east', 'north', 'north', 'south']
|
8 |
start_point = [0, 0]
|
@@ -64,7 +63,8 @@ def generate_random_walk(iters):
|
|
64 |
buf.seek(0)
|
65 |
|
66 |
return buf.read()
|
|
|
67 |
|
68 |
# Create a Gradio interface
|
69 |
-
iface = gr.Interface(fn=generate_random_walk, inputs=
|
70 |
iface.launch()
|
|
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
|
|
|
5 |
def generate_random_walk(iters):
|
6 |
directions = ['east', 'north', 'north', 'south']
|
7 |
start_point = [0, 0]
|
|
|
63 |
buf.seek(0)
|
64 |
|
65 |
return buf.read()
|
66 |
+
iters = gr.inputs.Textbox(label="Number of random steps")
|
67 |
|
68 |
# Create a Gradio interface
|
69 |
+
iface = gr.Interface(fn=generate_random_walk, inputs=iters, outputs="image", title="Random Walk Plot")
|
70 |
iface.launch()
|