@@ -75,14 +75,23 @@ class FasterRCNN {
75
75
m_shmem = ::CreateFileMappingA (INVALID_HANDLE_VALUE, nullptr ,PAGE_READWRITE, 0 , m_size, m_key_shmem.c_str ());
76
76
m_buffer = (char *)::MapViewOfFile (m_shmem, FILE_MAP_ALL_ACCESS, 0 , 0 , m_size);
77
77
m_buffer[0 ] = 0 ;
78
- // std::string exec = "python35 \"C:/Users/sprin/Downloads/FasterRCNN_SpringEdition_final/FasterRCNN_SE_Train/src/FasterRCNN_Detect_SE.py\"";
78
+ #ifdef FasterRCNN_SE_Test
79
+ char * pyfile_r = " ../../../FasterRCNN_SE_Train/src/FasterRCNN_Detect_SE.py" ;
80
+ char _pyfile_a[MAX_PATH] = { 0 };
81
+ GetFullPathNameA (pyfile_r, MAX_PATH, _pyfile_a, NULL );
82
+ std::string pyfile_a = _pyfile_a;
83
+ std::replace (pyfile_a.begin (), pyfile_a.end (), ' \\ ' , ' /' );
84
+ std::string exec = " python35 \" " + pyfile_a + " \" " ;
85
+ #else
79
86
std::string exec = " FasterRCNN_Detect_SE.exe" ;
87
+ #endif
88
+
80
89
HWND hwnd = GetForegroundWindow ();
81
90
std::vector<std::string> models = { " AlexNet" ," VGG16" ," VGG19" };
82
91
std::ostringstream oss;
83
- // oss << exec << " " << m_key_shmem << " " << m_key_mutex << " " << m_size << " " << "\"" << model_path << "\"" << "\t " << filter_threshold << " " << hwnd << " " << models[m_base_model];
92
+ // oss << exec << " " << m_key_shmem << " " << m_key_mutex << " " << m_size << " " << "\"" << model_path << "\"" << " " << filter_threshold << " " << hwnd << " " << models[m_base_model];
84
93
// UINT ret=WinExec(oss.str().c_str(), SW_HIDE);
85
- oss << m_key_shmem << " " << m_key_mutex << " " << m_size << " " << " \" " << model_path << " \" " << " \t " << filter_threshold << " " << hwnd << " " << models[m_base_model];
94
+ oss << m_key_shmem << " " << m_key_mutex << " " << m_size << " " << " \" " << model_path << " \" " << " " << filter_threshold << " " << hwnd << " " << models[m_base_model];
86
95
HINSTANCE ret=ShellExecuteA (NULL , " open" , exec.c_str (), oss.str ().c_str (), NULL , SW_HIDE);
87
96
if ((size_t )ret < 31 ) {
88
97
::MessageBoxA (nullptr , " FasterRCNN Detector execute failed\n It needs \" FasterRCNN_Detect_SE.exe\" ." , " Error" , MB_OK);
0 commit comments