mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 19:56:31 +00:00
print detection results
This commit is contained in:
@@ -32,6 +32,16 @@ cdef class Annotation:
|
||||
d.annotation_name = self.name
|
||||
self.image = b''
|
||||
|
||||
cdef to_str(self, class_names):
|
||||
if not self.detections:
|
||||
return f"{self.name}: No detections"
|
||||
|
||||
detections_str = ", ".join(
|
||||
f"{class_names[d.cls]} {d.confidence * 100:.1f}% ({d.x:.2f}, {d.y:.2f})"
|
||||
for d in self.detections
|
||||
)
|
||||
return f"{self.name}: {detections_str}"
|
||||
|
||||
cdef format_time(self, ms):
|
||||
# Calculate hours, minutes, seconds, and hundreds of milliseconds.
|
||||
h = ms // 3600000 # Total full hours.
|
||||
|
||||
Reference in New Issue
Block a user