shaoshengsong / DeepSORT

support deepsort and bytetrack MOT(Multi-object tracking) using yolov5 with C++
777 stars 182 forks source link

Error when building in Windows #45

Open anhthoai opened 1 year ago

anhthoai commented 1 year ago

image Hello @shaoshengsong, I have tried to build in Windows, but there is error as screenshot, I don't know why. I can't see any error at that line. Could you please help me on that?

anhthoai commented 1 year ago

This is information: image

yuanry16 commented 8 months ago

May I ask how it was resolved?

Yuan262 commented 5 months ago

解决了吗?老哥

YangSangWan commented 4 months ago

May I ask how it was resolved? plz...

ok... i solved it!!

in windows. Ort::Session 's second parameter is "const wchar_t*"

we need to make function stringToWString

edit FeatureTensor.h

Ort::Session session_{env, k_feature_model_path.c_str(), Ort::SessionOptions{nullptr}};

to

#include <windows.h>

std::wstring stringToWString(const std::string& str) {
    if (str.empty()) return std::wstring();

    int sizeNeeded = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
    std::wstring wstrTo(sizeNeeded, 0);
    MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], sizeNeeded);
    return wstrTo;
}
Ort::Session session_{env, stringToWString(k_feature_model_path).c_str(), Ort::SessionOptions{nullptr}};