Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apriltag_pywrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ static PyObject* apriltag_detect(apriltag_py_t* self,
.stride = strides[0],
.buf = PyArray_DATA(image)};

zarray_t* detections = apriltag_detector_detect(self->td, &im);
zarray_t *detections; // Declare detections variable outside of the GIL block
Py_BEGIN_ALLOW_THREADS // Acquire the GIL before running detection
detections = apriltag_detector_detect(self->td, &im);
Py_END_ALLOW_THREADS // Release the GIL after detection completes

int N = zarray_size(detections);

if (N == 0 && errno == EAGAIN){
Expand Down
Loading