mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:46:30 +00:00
add pxd headers for correct work
fixes definitions can run until API call
This commit is contained in:
+1
-23
@@ -1,9 +1,9 @@
|
||||
# cython: language_level=3
|
||||
from ultralytics import YOLO
|
||||
import mimetypes
|
||||
import cv2
|
||||
from ultralytics.engine.results import Boxes
|
||||
from processor_command import FileCommand
|
||||
from annotation cimport Detection, Annotation
|
||||
|
||||
cdef class Inference:
|
||||
"""Handles YOLO inference using the AI model."""
|
||||
@@ -66,25 +66,3 @@ cdef class Inference:
|
||||
_, encoded_image = cv2.imencode('.jpg', frame[0])
|
||||
image_bytes = encoded_image.tobytes()
|
||||
return Annotation(image_bytes, time, detections)
|
||||
|
||||
|
||||
cdef class Detection:
|
||||
cdef double x
|
||||
cdef double y
|
||||
cdef double w
|
||||
cdef double h
|
||||
cdef int cls
|
||||
|
||||
def __init__(self, double x, double y, double w, double h, int cls):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.w = w
|
||||
self.h = h
|
||||
self.cls = cls
|
||||
|
||||
cdef class Annotation:
|
||||
|
||||
def __init__(self, image_bytes: bytes, float time, detections: [Detection]):
|
||||
self.image = image_bytes
|
||||
self.time = time
|
||||
self.detections = detections
|
||||
|
||||
Reference in New Issue
Block a user