mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b465e1fdc | ||
|
|
26fd26051b |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -115,7 +115,7 @@ jobs:
|
|||||||
path: ./nightly/*.pkg
|
path: ./nightly/*.pkg
|
||||||
ubuntu64:
|
ubuntu64:
|
||||||
name: 'Linux/Ubuntu 64-bit'
|
name: 'Linux/Ubuntu 64-bit'
|
||||||
runs-on: [ubuntu-18.04]
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
@@ -181,6 +181,8 @@ jobs:
|
|||||||
libqt5svg5-dev \
|
libqt5svg5-dev \
|
||||||
swig \
|
swig \
|
||||||
libxss-dev \
|
libxss-dev \
|
||||||
|
libx11-xcb-dev \
|
||||||
|
libxcb-xfixes0-dev \
|
||||||
libopencv-dev
|
libopencv-dev
|
||||||
- name: 'Configure'
|
- name: 'Configure'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -35,7 +35,12 @@ static std::map<VideoCondition, std::string> conditionTypes = {
|
|||||||
cv::CascadeClassifier initObjectCascade(std::string &path)
|
cv::CascadeClassifier initObjectCascade(std::string &path)
|
||||||
{
|
{
|
||||||
cv::CascadeClassifier cascade;
|
cv::CascadeClassifier cascade;
|
||||||
cascade.load(path);
|
try {
|
||||||
|
cascade.load(path);
|
||||||
|
} catch (...) {
|
||||||
|
blog(LOG_WARNING, "failed to load model data \"%s\"",
|
||||||
|
path.c_str());
|
||||||
|
}
|
||||||
return cascade;
|
return cascade;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,13 +189,7 @@ bool MacroConditionVideo::LoadImageFromFile()
|
|||||||
bool MacroConditionVideo::LoadModelData(std::string &path)
|
bool MacroConditionVideo::LoadModelData(std::string &path)
|
||||||
{
|
{
|
||||||
_modelDataPath = path;
|
_modelDataPath = path;
|
||||||
try {
|
_objectCascade = initObjectCascade(path);
|
||||||
_objectCascade = initObjectCascade(path);
|
|
||||||
} catch (...) {
|
|
||||||
blog(LOG_WARNING, "failed to load model data \"%s\"",
|
|
||||||
path.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !_objectCascade.empty();
|
return !_objectCascade.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -810,9 +809,13 @@ void MacroConditionVideoEdit::ModelPathChanged(const QString &text)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
bool dataLoaded = false;
|
||||||
std::string path = text.toStdString();
|
{
|
||||||
if (!_entryData->LoadModelData(path)) {
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
std::string path = text.toStdString();
|
||||||
|
dataLoaded = _entryData->LoadModelData(path);
|
||||||
|
}
|
||||||
|
if (!dataLoaded) {
|
||||||
DisplayMessage(obs_module_text(
|
DisplayMessage(obs_module_text(
|
||||||
"AdvSceneSwitcher.condition.video.modelLoadFail"));
|
"AdvSceneSwitcher.condition.video.modelLoadFail"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user