Open allo- opened 4 years ago
Use this bug for discussion and add your parameters here: https://github.com/allo-/virtual_webcam_background/wiki/model-parameters
Sorry, but I can't edit your wiki. I think you have set the permission wrong. There are wiki pages which I can edit, e.g. https://github.com/libfuse/libfuse/wiki/Filesystems
Anyways, the parameters for https://github.com/fangfufu/Linux-Fake-Background-Webcam are:
segmentation_threshold: 0.75
blur: 30
erode: 0
dilate: 20
virtual_video_device: "/dev/video2"
real_video_device: "/dev/video0"
average_masks: 3
layers:
- "empty": [["image", "background.jpg"]]
- "foreground": []
multiplier: 0.75
I am wonder if it is better to have a separate config file for segmentation parameters only, so people can copy and paste things without worrying about other hardware / image related parameters.
I think you should be able to edit now.
I am wonder if it is better to have a separate config file for segmentation parameters only, so people can copy and paste things without worrying about other hardware / image related parameters.
My config already has a few parameter on top and a few on bottom and a lot of commented out layer sections in the middle and is quite chaotic as well. For frequent editing some kind of frontend would be useful.
For including config snippets with image packs and similar addons (e.g. the fog image may have a config snippet defining the parameters for the roll
filter) some more modular structure would be useful, but on the other hand it adds complexity and can make it harder to tell which configs will be loaded in which order.
I wonder how frequent most people will change the config. In the first version, everything was in the code and autoreloading was a feature for replacing background.jpg
without restarting the program with a new filename parameter, so it did not even need a config for the default use-case.
Now it can become quite complex, even when most options should have sensible defaults when they are not present in the config.
I don't like the abrupt transition between the edge of the foreground and background, hence the dilation to make the mask bigger, follow by blur to smooth things out.
My current parameters are:
blur: 5
erode: 12
dilate: 10
With a difference between dilate and erode you get rid of a few artifacts from under-/oversegmentation. I think these are parameters that you probably need to tune for every different webcam/background by looking at the result.
Current default:
Table for the internal resolution:
(source)
To get other models use the simple_bodypix_python get-model.sh script.
Parameters:
bodypix/mobilenet/float/{025,050,075,100}/model-stride{8,16}
bodypix/resnet50/float/model-stride{16, 32}
For resnet you need to change the preprocessing in the source. The quant2 and quant1 models do not work with this script (I am not sure why).
What parameters are working best for you?