Skip to content

Commit 7771dcf

Browse files
committed
change archive
1 parent 97e4173 commit 7771dcf

15 files changed

+33
-19
lines changed
Binary file not shown.

FasterRCNN_SE_Detection/FasterRCNN_SE.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -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\nIt needs \"FasterRCNN_Detect_SE.exe\".", "Error", MB_OK);
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/s3xel6z1e09s9cp/3rdparty.zip?dl=1','%TEMP%\3rdparty.zip')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/bin/3rdparty.zip','%TEMP%\3rdparty.zip')"
22
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%TEMP%\3rdparty.zip', '.'); }"
33
IF EXIST "%TEMP%\3rdparty.zip" (
44
DEL "%TEMP%\3rdparty.zip"
55
)
6+
pause
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/7h6qifihp4hn4q1/faster_rcnn_eval_VGG16_e2e_epoch%28100%29.model?dl=1','faster_rcnn_eval_VGG16_e2e_epoch(100).model')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/bin/faster_rcnn_eval_VGG16_e2e_epoch.100.model','faster_rcnn_eval_VGG16_e2e_epoch(100).model')"

FasterRCNN_SE_Detection/download_voc2007train.bat

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/image/voc2007valid.zip','%TEMP%\voc2007valid.zip')"
2+
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%TEMP%\voc2007valid.zip', '.'); }"
3+
IF EXIST "%TEMP%\voc2007valid.zip" (
4+
DEL "%TEMP%\voc2007valid.zip"
5+
)

FasterRCNN_SE_Detection/main.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,18 @@ int main() {
6060
std::cout << "\tPrecision : " << RP.find(i)->second.second / cnt[i] << std::endl;
6161
}
6262
}
63-
/*cv::Mat img = cv::imread(file);
63+
//continue;
64+
cv::Mat img = cv::imread(file);
6465
for (auto&box : boxes) {
6566
ispring::CVEval::DrawBoxSE(img, box,cv::Scalar(0,0,255));
6667
}
6768
for (auto&box : ground_truth) {
6869
ispring::CVEval::DrawBoxSE(img, box,cv::Scalar(0,255,0));
6970
}
7071
cv::imshow("result", img);
71-
cv::waitKey(0);*/
72+
if (cv::waitKey(0) == 27) {
73+
break;
74+
}
7275
}
7376
cv::destroyAllWindows();
7477
detector.Release(); //Release
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/txfkcvba15dw3c8/AlexNet_ImageNet_Caffe.model?dl=1','AlexNet_ImageNet_Caffe.model')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/cntk/AlexNet_ImageNet_Caffe.model','AlexNet_ImageNet_Caffe.model')"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/qedtionn73kx70s/VGG16_ImageNet_Caffe.model?dl=1','VGG16_ImageNet_Caffe.model')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/cntk/VGG16_ImageNet_Caffe.model','VGG16_ImageNet_Caffe.model')"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/a1aa7ngbvrp82bi/VGG19_ImageNet_Caffe.model?dl=1','VGG19_ImageNet_Caffe.model')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/cntk/VGG19_ImageNet_Caffe.model','VGG19_ImageNet_Caffe.model')"

FasterRCNN_SE_Train/download_bin.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/9gox6h7a846ydpq/bin.zip?dl=1','%TEMP%\bin.zip')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/cntk/bin.zip','%TEMP%\bin.zip')"
22
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%TEMP%\bin.zip', '.'); }"
33
IF EXIST "%TEMP%\bin.zip" (
44
DEL "%TEMP%\bin.zip"

FasterRCNN_SE_Train/download_voc2007train.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/lbdzx7q9vvaktpv/voc2007train.zip?dl=1','%TEMP%\voc2007train.zip')"
1+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/image/voc2007train.zip','%TEMP%\voc2007train.zip')"
22
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%TEMP%\voc2007train.zip', '.'); }"
33
IF EXIST "%TEMP%\voc2007train.zip" (
44
DEL "%TEMP%\voc2007train.zip"

FasterRCNN_SE_Train/src/download_python35_local.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
::python3.5.3 local packace.
22
::See also https://github.com/springkim/FasterRCNN_SpringEdition
3-
powershell "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/o7p3byhb7j8nvsf/Python35.zip?dl=1','Python35.zip')"
3+
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;(New-Object System.Net.WebClient).DownloadFile('https://github.com/springkim/FasterRCNN_SpringEdition/releases/download/cntk/Python35.zip','Python35.zip')"
44
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('Python35.zip', '.'); }"
55
IF EXIST "Python35.zip" (
66
DEL "Python35.zip"

FasterRCNN_SE_Train/train.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
cd "bin"
2-
"FasterRCNN_Train_SE.exe" 100 VGG19
2+
"FasterRCNN_Train_SE.exe" 100 VGG16
33
pause

upload.bat

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ set /p msg=Input commit message :
22
git add -A
33
git commit -m "%msg%"
44
git push origin master
5+
pause
56

0 commit comments

Comments
 (0)