minor tweaks
This commit is contained in:
6
main.py
6
main.py
@@ -6,6 +6,7 @@ import cv2
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
WINSIZE = (500, 500)
|
||||
WIN = "window"
|
||||
SPACING = 50
|
||||
GREEN = (0, 255, 0)
|
||||
@@ -153,12 +154,9 @@ def fit_to_line(line, *, canvas):
|
||||
|
||||
loss = (
|
||||
0
|
||||
#
|
||||
+ point_to_point_error()
|
||||
+ point_to_line_error() * 2
|
||||
+ line_to_line_error()
|
||||
#
|
||||
# + spacing_error(fit)
|
||||
)
|
||||
|
||||
loss.backward()
|
||||
@@ -199,7 +197,7 @@ def main():
|
||||
line.append((x, y))
|
||||
optimization()
|
||||
|
||||
canvas = np.zeros((500, 500, 3), dtype=np.uint8)
|
||||
canvas = np.zeros((*WINSIZE, 3), dtype=np.uint8)
|
||||
cv2.namedWindow(WIN)
|
||||
cv2.imshow(WIN, canvas)
|
||||
cv2.waitKey(1)
|
||||
|
||||
Reference in New Issue
Block a user