Skip to content

Commit 1d83c0b

Browse files
ENable last_detections on MxAccl
1 parent acb92bf commit 1d83c0b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/zm_monitor.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,12 +2582,17 @@ std::pair<int, std::string> Monitor::Analyse_MxAccl(std::shared_ptr<ZMPacket> pa
25822582
packet->ai_frame = av_frame_ptr(av_frame_alloc());
25832583
ai_image->PopulateFrame(packet->ai_frame.get());
25842584
packet->detections = detections;
2585+
last_detections = detections;
25852586
}
25862587
} else { // skipping
2587-
if (last_detection_count>0) {
2588+
if (last_detection_count >0 and last_detections.size()) {
2589+
Image *ai_image = new Image(packet->in_frame.get(), packet->in_frame->width, packet->in_frame->height); //copies
2590+
ai_image->draw_boxes(last_detections, LabelSize(), LabelSize());
2591+
packet->ai_image = ai_image;
2592+
// Populate ai_frame as well
2593+
packet->ai_frame = av_frame_ptr(av_frame_alloc());
2594+
ai_image->PopulateFrame(packet->ai_frame.get());
25882595
last_detection_count --;
2589-
//TODO last_detection shouldn't be AI specific
2590-
//quadra_yolo->draw_last_roi(packet);
25912596
}
25922597
} // end if skip_frame
25932598
} // end if has input_frame/hw_frame

0 commit comments

Comments
 (0)