Skip to content

Commit

Permalink
fix: missing halio status, compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr authored Nov 22, 2024
1 parent 12984b3 commit 268027a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
13 changes: 10 additions & 3 deletions sscma/core/engine/ma_engine_halio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ ma_err_t EngineHalio::run() {
return MA_FAILED;
}

auto job = _configured_model->run_async(*_bindings, [](const AsyncInferCompletionInfo& info) {});
auto job = _configured_model->run_async(*_bindings, [&](const AsyncInferCompletionInfo& info) { sta = info.status; });

do {
this_thread::yield();
} while (job->wait(1000ms) != HAILO_SUCCESS);
} while (job->wait(50ms) != HAILO_SUCCESS);

return MA_OK;
switch (sta) {
case HAILO_SUCCESS:
return MA_OK;
case HAILO_TIMEOUT:
return MA_ETIMEOUT;
default:
return MA_FAILED;
}
}

#if MA_USE_FILESYSTEM
Expand Down
2 changes: 1 addition & 1 deletion sscma/core/model/ma_model_classifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool Classifier::isValid(Engine* engine) {
return false;
}

if (output_shape.size == 4 && (output_shape.dims[2] != 1 || output_shape.dims[3] != 1)) {
if (output_shape.size >= 3) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion sscma/core/model/ma_model_segmenter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ma_model_segmenter.h"

#include "core/cv/ma_cv.h"
#include "../cv/ma_cv.h"

namespace ma::model {

Expand Down
6 changes: 3 additions & 3 deletions sscma/core/model/ma_model_yolo11_pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <utility>
#include <vector>

#include "core/math/ma_math.h"
#include "core/utils/ma_anchors.h"
#include "core/utils/ma_nms.h"
#include "../math/ma_math.h"
#include "../utils/ma_anchors.h"
#include "../utils/ma_nms.h"

namespace ma::model {

Expand Down
4 changes: 2 additions & 2 deletions sscma/core/model/ma_model_yolo11_seg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <utility>
#include <vector>

#include "core/math/ma_math.h"
#include "core/utils/ma_nms.h"
#include "../math/ma_math.h"
#include "../utils/ma_nms.h"

constexpr char TAG[] = "ma::model::yolo11_seg";

Expand Down
2 changes: 2 additions & 0 deletions sscma/core/model/ma_model_yolov5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ ma_err_t YoloV5::postprocess() {
switch (output_.type) {
case MA_TENSOR_TYPE_NMS_BBOX_U16:
case MA_TENSOR_TYPE_NMS_BBOX_F32: {
#if MA_USE_ENGINE_HALIO
// TODO: can be optimized by whihout calling this handler for each frame
if (output.external_handler) {
auto ph = reinterpret_cast<ma::engine::EngineHalio::ExternalHandler*>(output.external_handler);
Expand All @@ -346,6 +347,7 @@ ma_err_t YoloV5::postprocess() {
threshold_nms_ = thr;
}
}
#endif
return nmsPostProcess();
}

Expand Down
2 changes: 1 addition & 1 deletion sscma/core/pipeline/ma_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>
#include <utility>

#include "core/ma_common.h"
#include "../ma_common.h"
#include "porting/ma_osal.h"

namespace ma {
Expand Down

0 comments on commit 268027a

Please sign in to comment.