|
| 1 | +# modnet-photographic-portrait-matting |
| 2 | + |
| 3 | +## Use Case and High-Level Description |
| 4 | + |
| 5 | +The `modnet-photographic-portrait-matting` model is a lightweight matting objective decomposition network (MODNet) for photographic portrait matting in real-time with a single input image with MobileNetV2 backbone. The model is pre-trained in PyTorch\* framework and converted to ONNX\* format. |
| 6 | + |
| 7 | +More details provided in the [paper](https://arxiv.org/abs/2011.11961) and [repository](https://github.com/ZHKKKe/MODNet). |
| 8 | + |
| 9 | +## Specification |
| 10 | + |
| 11 | +| Metric | Value | |
| 12 | +|---------------------------------|--------------------| |
| 13 | +| Type | Background Matting | |
| 14 | +| GFlops | 31.1564 | |
| 15 | +| MParams | 6.4597 | |
| 16 | +| Source framework | PyTorch\* | |
| 17 | + |
| 18 | +## Accuracy |
| 19 | + |
| 20 | +Accuracy measured on the HumanMatting dataset |
| 21 | + |
| 22 | +| Metric | Mean value | Std value | |
| 23 | +| -------- | ------------|-----------| |
| 24 | +| MAD | 5.21 | 5.13 | |
| 25 | +| MSE | 727.95 | 1196.28 | |
| 26 | + |
| 27 | +* MAD - mean of absolute difference |
| 28 | +* MSE - mean squared error. |
| 29 | + |
| 30 | +## Input |
| 31 | + |
| 32 | +### Original Model |
| 33 | + |
| 34 | +Image, name: `input`, shape: `1, 3, 512, 512`, format: `B, C, H, W`, where: |
| 35 | + |
| 36 | +- `B` - batch size |
| 37 | +- `C` - number of channels |
| 38 | +- `H` - image height |
| 39 | +- `W` - image width |
| 40 | + |
| 41 | +Expected color order: `RGB`. |
| 42 | +Mean values - [127.5, 127.5, 127.5], scale value - 127.5. |
| 43 | + |
| 44 | +### Converted Model |
| 45 | + |
| 46 | +Image, name: `input`, shape: `1, 3, 512, 512`, format: `B, C, H, W`, where: |
| 47 | + |
| 48 | +- `B` - batch size |
| 49 | +- `C` - number of channels |
| 50 | +- `H` - image height |
| 51 | +- `W` - image width |
| 52 | + |
| 53 | +Expected color order: `BGR`. |
| 54 | + |
| 55 | +## Output |
| 56 | + |
| 57 | +### Original model |
| 58 | + |
| 59 | +Alpha matte with values in [0, 1] range. Name: `output` Shape: `1, 1, 512, 512`, format: `B, C, H, W`, where: |
| 60 | + |
| 61 | +- `B` - batch size |
| 62 | +- `C` - number of channels |
| 63 | +- `H` - image height |
| 64 | +- `W` - image width |
| 65 | + |
| 66 | +### Converted model |
| 67 | + |
| 68 | +Alpha matte with values in [0, 1] range. Name: `output` Shape: `1, 1, 512, 512`, format: `B, C, H, W`, where: |
| 69 | + |
| 70 | +- `B` - batch size |
| 71 | +- `C` - number of channels |
| 72 | +- `H` - image height |
| 73 | +- `W` - image width |
| 74 | + |
| 75 | +## Download a Model and Convert it into OpenVINO™ IR Format |
| 76 | + |
| 77 | +You can download models and if necessary convert them into OpenVINO™ IR format using the [Model Downloader and other automation tools](../../../tools/model_tools/README.md) as shown in the examples below. |
| 78 | + |
| 79 | +An example of using the Model Downloader: |
| 80 | +``` |
| 81 | +omz_downloader --name <model_name> |
| 82 | +``` |
| 83 | + |
| 84 | +An example of using the Model Converter: |
| 85 | +``` |
| 86 | +omz_converter --name <model_name> |
| 87 | +``` |
| 88 | + |
| 89 | +## Demo usage |
| 90 | + |
| 91 | +The model can be used in the following demos provided by the Open Model Zoo to show its capabilities: |
| 92 | + |
| 93 | +* [Background subtraction Python\* Demo](../../../demos/background_subtraction_demo/python/README.md) |
| 94 | + |
| 95 | +## Legal Information |
| 96 | + |
| 97 | +The original model is distributed under the |
| 98 | +[Apache License, Version 2.0](https://raw.githubusercontent.com/ZHKKKe/MODNet/master/LICENSE). |
| 99 | +A copy of the license is provided in `<omz_dir>/models/public/licenses/APACHE-2.0.txt`. |
0 commit comments