Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbitrary-2912 committed Apr 6, 2023
1 parent 4258edc commit fff868a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_distance(id, b):
x_dist = cone_diagonal_width * focal_length / dpw
else: # cube (labels.txt)
x_dist = cube_diagonal_width * focal_length / dpw
y_dist = x_dist*math.atan(get_angles(b)[0])*180/math.pi
y_dist = x_dist * math.atan(get_angles(b)[0]) * 180 / math.pi
return Point(x_dist, y_dist) # meters

def make(i):
Expand All @@ -146,6 +146,7 @@ def make(i):

return [make(i) for i in range(top_k) if scores[i] >= score_threshold]


# --------------------------------------------------------------------------

import collections
Expand All @@ -161,19 +162,23 @@ class BBox(collections.namedtuple('BBox', ['xmin', 'ymin', 'xmax', 'ymax'])):
"""
__slots__ = ()


class Angles(collections.namedtuple('Angles', ['tx', 'ty'])):
"""
Angles
Represents an ordered pair that points to the absolute angle of the target
"""
__slots__ = ()


class Point(collections.namedtuple('Angles', ['x', 'y'])):
"""
Point
Represents an ordered pair
"""
__slots__ = ()


# --------------------------------------------------------------------------

# Labeling
Expand Down

0 comments on commit fff868a

Please sign in to comment.