Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
added examples values
Browse files
app.py
CHANGED
|
@@ -11,11 +11,10 @@ from kornia.geometry.line import ParametrizedLine, fit_line
|
|
| 11 |
def inference(point1, point2, point3, point4):
|
| 12 |
std = 1.2 # standard deviation for the points
|
| 13 |
num_points = 50 # total number of points
|
| 14 |
-
|
| 15 |
# create a baseline
|
| 16 |
p0 = torch.tensor([point1, point2], dtype=torch.float32)
|
| 17 |
p1 = torch.tensor([point3, point4], dtype=torch.float32)
|
| 18 |
-
|
| 19 |
l1 = ParametrizedLine.through(p0, p1)
|
| 20 |
|
| 21 |
# sample some points and weights
|
|
@@ -52,8 +51,7 @@ inputs = [
|
|
| 52 |
outputs = gr.Plot()
|
| 53 |
|
| 54 |
examples = [
|
| 55 |
-
[
|
| 56 |
-
[[0.0, 0.0, 1.0, 2.0]],
|
| 57 |
]
|
| 58 |
|
| 59 |
title = 'Line Fitting'
|
|
@@ -66,6 +64,7 @@ demo = gr.Interface(
|
|
| 66 |
cache_examples=True,
|
| 67 |
theme='huggingface',
|
| 68 |
live=True,
|
|
|
|
| 69 |
|
| 70 |
)
|
| 71 |
demo.launch()
|
|
|
|
| 11 |
def inference(point1, point2, point3, point4):
|
| 12 |
std = 1.2 # standard deviation for the points
|
| 13 |
num_points = 50 # total number of points
|
| 14 |
+
|
| 15 |
# create a baseline
|
| 16 |
p0 = torch.tensor([point1, point2], dtype=torch.float32)
|
| 17 |
p1 = torch.tensor([point3, point4], dtype=torch.float32)
|
|
|
|
| 18 |
l1 = ParametrizedLine.through(p0, p1)
|
| 19 |
|
| 20 |
# sample some points and weights
|
|
|
|
| 51 |
outputs = gr.Plot()
|
| 52 |
|
| 53 |
examples = [
|
| 54 |
+
[0.0, 0.0, 1.0, 1.0],
|
|
|
|
| 55 |
]
|
| 56 |
|
| 57 |
title = 'Line Fitting'
|
|
|
|
| 64 |
cache_examples=True,
|
| 65 |
theme='huggingface',
|
| 66 |
live=True,
|
| 67 |
+
examples=examples,
|
| 68 |
|
| 69 |
)
|
| 70 |
demo.launch()
|