TroglodyteDerivations
commited on
Commit
•
55f6edc
1
Parent(s):
789f285
Updating lines 45 & 46 with Number instead of Textbox
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
|
|
4 |
from PIL import Image
|
5 |
from io import BytesIO
|
6 |
|
7 |
-
class
|
8 |
def __init__(self, v1, v2):
|
9 |
self.v1 = np.array(v1)
|
10 |
self.v2 = np.array(v2)
|
@@ -36,14 +36,14 @@ class Vector_Addition_Subtraction:
|
|
36 |
return image
|
37 |
|
38 |
def vector_addition(v1, v2):
|
39 |
-
vector_addition =
|
40 |
v3 = vector_addition.vector_add()
|
41 |
plot = vector_addition.plot_vector_add()
|
42 |
return v3, plot
|
43 |
|
44 |
iface = gr.Interface(vector_addition,
|
45 |
-
[gr.components.
|
46 |
-
gr.components.
|
47 |
[gr.components.Textbox(label="Vector 3"),
|
48 |
gr.components.Image(label="Vector Addition Plot")])
|
49 |
|
|
|
4 |
from PIL import Image
|
5 |
from io import BytesIO
|
6 |
|
7 |
+
class Vector_Addition:
|
8 |
def __init__(self, v1, v2):
|
9 |
self.v1 = np.array(v1)
|
10 |
self.v2 = np.array(v2)
|
|
|
36 |
return image
|
37 |
|
38 |
def vector_addition(v1, v2):
|
39 |
+
vector_addition = Vector_Addition(v1, v2)
|
40 |
v3 = vector_addition.vector_add()
|
41 |
plot = vector_addition.plot_vector_add()
|
42 |
return v3, plot
|
43 |
|
44 |
iface = gr.Interface(vector_addition,
|
45 |
+
[gr.components.Number(lines=2, label="Vector 1"),
|
46 |
+
gr.components.Number(lines=2, label="Vector 2")],
|
47 |
[gr.components.Textbox(label="Vector 3"),
|
48 |
gr.components.Image(label="Vector Addition Plot")])
|
49 |
|