未验证 提交 57980a30 编写于 作者: Z zhoujun 提交者: GitHub

Merge pull request #6273 from Bourne-M/patch-6

the file has no function [self.vector_slope]
...@@ -22,6 +22,9 @@ from numpy.fft import fft ...@@ -22,6 +22,9 @@ from numpy.fft import fft
from numpy.linalg import norm from numpy.linalg import norm
import sys import sys
def vector_slope(vec):
assert len(vec) == 2
return abs(vec[1] / (vec[0] + 1e-8))
class FCENetTargets: class FCENetTargets:
"""Generate the ground truth targets of FCENet: Fourier Contour Embedding """Generate the ground truth targets of FCENet: Fourier Contour Embedding
...@@ -233,9 +236,9 @@ class FCENetTargets: ...@@ -233,9 +236,9 @@ class FCENetTargets:
head_inds = [head_start, head_end] head_inds = [head_start, head_end]
tail_inds = [tail_start, tail_end] tail_inds = [tail_start, tail_end]
else: else:
if self.vector_slope(points[1] - points[0]) + self.vector_slope( if vector_slope(points[1] - points[0]) + vector_slope(
points[3] - points[2]) < self.vector_slope(points[ points[3] - points[2]) < vector_slope(points[
2] - points[1]) + self.vector_slope(points[0] - points[ 2] - points[1]) + vector_slope(points[0] - points[
3]): 3]):
horizontal_edge_inds = [[0, 1], [2, 3]] horizontal_edge_inds = [[0, 1], [2, 3]]
vertical_edge_inds = [[3, 0], [1, 2]] vertical_edge_inds = [[3, 0], [1, 2]]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册