Skip to content

Commit 2e6e1d7

Browse files
Cleanup code so that it compiles without any AI support
1 parent 0c34b85 commit 2e6e1d7

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/zm_ai_server.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,18 @@ void AIThread::Inference() {
346346

347347
Image *ai_image = monitor_->GetAnalysisImage(packet->image_index);
348348

349+
nlohmann::json detections;
349350
#ifdef HAVE_UNTETHER_H
350351
speedai->send_image(job, packet->image);
351-
nlohmann::json detections = speedai->receive_detections(job, monitor_->ObjectDetection_Object_Threshold());
352+
detections = speedai->receive_detections(job, monitor_->ObjectDetection_Object_Threshold());
352353
#endif
353354
#ifdef HAVE_MEMX_H
354355
memx->send_image(memx_job, packet->image);
355-
nlohmann::json detections = memx->receive_detections(memx_job, monitor_->ObjectDetection_Object_Threshold());
356+
detections = memx->receive_detections(memx_job, monitor_->ObjectDetection_Object_Threshold());
356357
#endif
357358
#ifdef HAVE_MX_ACCL_H
358359
mx_accl->send_image(mx_accl_job, packet->image);
359-
nlohmann::json detections = mx_accl->receive_detections(mx_accl_job, monitor_->ObjectDetection_Object_Threshold());
360+
detections = mx_accl->receive_detections(mx_accl_job, monitor_->ObjectDetection_Object_Threshold());
360361
#endif
361362
Debug(1, "detections %s", detections.dump().c_str());
362363

src/zm_ai_server.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Monitor;
3232

3333
class AIThread {
3434
public:
35+
explicit AIThread(const std::shared_ptr<Monitor> monitor);
3536
#if HAVE_UNTETHER_H
3637
explicit AIThread(const std::shared_ptr<Monitor> monitor, SpeedAI *speedai);
3738
#endif

0 commit comments

Comments
 (0)