@@ -75,14 +75,23 @@ class FasterRCNN {
7575 m_shmem = ::CreateFileMappingA (INVALID_HANDLE_VALUE, nullptr ,PAGE_READWRITE, 0 , m_size, m_key_shmem.c_str ());
7676 m_buffer = (char *)::MapViewOfFile (m_shmem, FILE_MAP_ALL_ACCESS, 0 , 0 , m_size);
7777 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
7986 std::string exec = " FasterRCNN_Detect_SE.exe" ;
87+ #endif
88+
8089 HWND hwnd = GetForegroundWindow ();
8190 std::vector<std::string> models = { " AlexNet" ," VGG16" ," VGG19" };
8291 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];
8493 // 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];
8695 HINSTANCE ret=ShellExecuteA (NULL , " open" , exec.c_str (), oss.str ().c_str (), NULL , SW_HIDE);
8796 if ((size_t )ret < 31 ) {
8897 ::MessageBoxA (nullptr , " FasterRCNN Detector execute failed\n It needs \" FasterRCNN_Detect_SE.exe\" ." , " Error" , MB_OK);
0 commit comments