Skip to content

Commit 3a55f75

Browse files
made private member methods that were needed to be
1 parent b4d5bcb commit 3a55f75

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

include/sam_inference.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ class SAM
2424

2525
const char *RunSession(const cv::Mat &iImg, std::vector<SEG::DL_RESULT> &oResult, SEG::MODEL_TYPE modelType, SEG::DL_RESULT &result);
2626

27-
char *WarmUpSession(SEG::MODEL_TYPE modelType);
27+
private:
28+
29+
char *WarmUpSession_(SEG::MODEL_TYPE modelType);
2830

2931
template <typename N>
30-
const char *TensorProcess(clock_t &starttime_1, const cv::Mat &iImg, N &blob, std::vector<int64_t> &inputNodeDims,
32+
const char *TensorProcess_(clock_t &starttime_1, const cv::Mat &iImg, N &blob, std::vector<int64_t> &inputNodeDims,
3133
SEG::MODEL_TYPE modelType, std::vector<SEG::DL_RESULT> &oResult, Utils &utilities, SEG::DL_RESULT &result);
3234

33-
std::vector<std::string> classes{};
34-
35-
private:
3635
Ort::Env _env;
3736
std::unique_ptr<Ort::Session> _session;
3837
bool _cudaEnable;

src/sam_inference.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
#define benchmark
66
//#define ROI
77

8-
SAM::SAM() {}
8+
SAM::SAM()
9+
{
10+
}
911

10-
SAM::~SAM() {
12+
SAM::~SAM()
13+
{
1114
// Clean up input/output node names
1215
for (auto &name : _inputNodeNames) {
1316
delete[] name;
@@ -98,7 +101,7 @@ const char *SAM::CreateSession(SEG::DL_INIT_PARAM &iParams) {
98101
.GetTensorTypeAndShapeInfo()
99102
.GetElementType();
100103

101-
WarmUpSession(_modelType);
104+
WarmUpSession_(_modelType);
102105
return RET_OK;
103106
} catch (const std::exception &e) {
104107
const char *str1 = "[SAM]:";
@@ -320,7 +323,8 @@ const char *SAM::TensorProcess_(clock_t &starttime_1, const cv::Mat &iImg,
320323
return RET_OK;
321324
}
322325

323-
char *SAM::WarmUpSession(SEG::MODEL_TYPE _modelType) {
326+
char *SAM::WarmUpSession_(SEG::MODEL_TYPE _modelType)
327+
{
324328
clock_t starttime_1 = clock();
325329
Utils utilities;
326330
cv::Mat iImg = cv::Mat(cv::Size(_imgSize.at(0), _imgSize.at(1)), CV_8UC3);

0 commit comments

Comments
 (0)