各種コマンドラインオプションにcunet追加 resolved #132

This commit is contained in:
lltcggie 2018-11-23 23:29:30 +09:00
parent 0de94b6ff9
commit 8b53d0f086
3 changed files with 26 additions and 22 deletions

View File

@ -2242,15 +2242,13 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData)
false, 0, &cmdNoOverwriteConstraint, cmd);
std::vector<std::wstring> cmdModelTypeConstraintV;
cmdModelTypeConstraintV.push_back(L"upconv_7_anime_style_art_rgb");
cmdModelTypeConstraintV.push_back(L"upconv_7_photo");
cmdModelTypeConstraintV.push_back(L"anime_style_art_rgb");
cmdModelTypeConstraintV.push_back(L"photo");
cmdModelTypeConstraintV.push_back(L"anime_style_art_y");
cmdModelTypeConstraintV.push_back(L"upresnet10");
for (int i = 0; i < eModelTypeEnd; i++)
{
cmdModelTypeConstraintV.push_back(ModelTypeList[i]);
}
TCLAPW::ValuesConstraint<std::wstring> cmdModelTypeConstraint(cmdModelTypeConstraintV);
TCLAPW::ValueArg<std::wstring> cmdModelType(L"y", L"model_type", L"model type",
false, L"upconv_7_anime_style_art_rgb", &cmdModelTypeConstraint, cmd);
false, DefaultModelType, &cmdModelTypeConstraint, cmd);
// definition of command line argument : end
@ -2506,20 +2504,14 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData)
if (cmdModelType.isSet())
{
int index = 0;
if (cmdModelType.getValue() == L"upconv_7_anime_style_art_rgb")
index = 0;
else if (cmdModelType.getValue() == L"upconv_7_photo")
index = 1;
else if (cmdModelType.getValue() == L"anime_style_art_rgb")
index = 2;
else if (cmdModelType.getValue() == L"photo")
index = 3;
else if (cmdModelType.getValue() == L"anime_style_art_y")
index = 4;
else if (cmdModelType.getValue() == L"upresnet10")
index = 4;
else
index = 0;
for (int i = 0; i < eModelTypeEnd; i++)
{
if (cmdModelType.getValue() == ModelTypeList[i])
{
index = i;
break;
}
}
SendMessage(GetDlgItem(dh, IDC_COMBO_MODEL), CB_SETCURSEL, index, 0);

View File

@ -46,6 +46,18 @@ const tstring ModelPathList[eModelTypeEnd] = {
TEXT("models/cunet"),
};
const std::wstring ModelTypeList[eModelTypeEnd] = {
L"upconv_7_anime_style_art_rgb",
L"upconv_7_photo",
L"anime_style_art_rgb",
L"photo",
L"anime_style_art_y",
L"upresnet10",
L"cunet",
};
const std::wstring DefaultModelType = ModelTypeList[DefaultModel];
const std::wstring ModelTitleLangKeyList[eModelTypeEnd] = {
L"IDC_RADIO_MODEL_UPCONV_RGB",
L"IDC_RADIO_MODEL_UPCONV_PHOTO",

View File

@ -155,7 +155,7 @@ int main(int argc, char** argv)
ValueArg<tstring> cmdModelPath(TEXT(""), TEXT("model_dir"),
TEXT("path to custom model directory (don't append last / )"), false,
TEXT("models/upconv_7_anime_style_art_rgb"), TEXT("string"), cmd);
TEXT("models/cunet"), TEXT("string"), cmd);
std::vector<tstring> cmdProcessConstraintV;
cmdProcessConstraintV.push_back(TEXT("cpu"));