Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default GPU->CPU #67

Merged
merged 2 commits into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Add **Virtual Background Detector** to Audio/Video Filters. and also add **Virtu

![](doc/filter_2_en.png)

Since v1.2.0, default inference engine is changed. Now, default inference engine is CPU. But, it is low accuracy, heavy to compute. If you can use GPU, changing to GPU is better. But some case, GPU engine is crashed at initialize phase.

### Background settings

Place a background image, window capture, or game capture source below the filtered source. Set the size, crop, etc. to complete the settings.
Expand Down
6 changes: 4 additions & 2 deletions src/obs-virtualbg-detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void detector_defaults(obs_data_t *settings) {
obs_data_set_default_double(settings, THRESHOLD_VALUE, 0.5);
obs_data_set_default_bool(settings, USE_MASK_BLUR, true);
#if _WIN32
obs_data_set_default_bool(settings, USE_GPU, true);
obs_data_set_default_bool(settings, USE_GPU, false);
#endif
}

Expand Down Expand Up @@ -276,7 +276,9 @@ void detector_setup_preprocess_scaler(virtual_bg_filter_data *filter_data, struc
int ret = video_scaler_create(&filter_data->preprocess_scaler, &tensor_scaler_info, &frame_scaler_info,
VIDEO_SCALE_BICUBIC);
if (ret != 0) {
blog(LOG_ERROR, "[Virtual BG detector] Can't create video_scaler_create %d", ret);
blog(LOG_ERROR, "[Virtual BG detector] Can't create video_scaler_create %d %dx%d -> %dx%d", ret,
filter_data->frame_width, filter_data->frame_height, filter_data->tensor_width,
filter_data->tensor_height);
throw new std::runtime_error("Cant create video_scaler_create");
} else {
blog(LOG_INFO, "[Virtual BG detector] video_scaler_create success. %dx%d -> %dx%d",
Expand Down