|
26 | 26 |
|
27 | 27 | sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python'))
|
28 | 28 |
|
29 |
| -from openvino.model_zoo.model_api.models import MaskRCNNModel, OutputTransform, RESIZE_TYPES, YolactModel, BackgroundMattingWithBGR, VideoBackgroundMatting |
| 29 | +from openvino.model_zoo.model_api.models import MaskRCNNModel, OutputTransform, RESIZE_TYPES, YolactModel, BackgroundMattingWithBackground, VideoBackgroundMatting |
30 | 30 | from openvino.model_zoo.model_api.models.utils import load_labels
|
31 | 31 | from openvino.model_zoo.model_api.performance_metrics import PerformanceMetrics
|
32 | 32 | from openvino.model_zoo.model_api.pipelines import get_user_config, AsyncPipeline
|
@@ -62,7 +62,7 @@ def build_argparser():
|
62 | 62 | args.add_argument('--labels', help='Optional. Labels mapping file.', default=None, type=str)
|
63 | 63 | args.add_argument('--target_bgr', default=None, type=str,
|
64 | 64 | help='Optional. Background onto which to composite the output (by default to green field).')
|
65 |
| - args.add_argument('--bgr', default=None, type=str, |
| 65 | + args.add_argument('--background', default=None, type=str, |
66 | 66 | help='Optional. Background image for background-matting model.')
|
67 | 67 | args.add_argument('--blur_bgr', default=0, type=int,
|
68 | 68 | help='Optional. Background blur strength (by default with value 0 is not applied).')
|
@@ -113,15 +113,15 @@ def get_model(model_adapter, configuration, args):
|
113 | 113 | model = VideoBackgroundMatting(model_adapter, configuration)
|
114 | 114 | is_matting_model = True
|
115 | 115 | elif len(inputs) == 2 and len(outputs) in (2, 3) and 'bgr' in inputs.keys():
|
116 |
| - if args.bgr is None: |
117 |
| - raise ValueError('The BackgroundMattingWithBGR model expects the specified "--bgr" option.') |
118 |
| - model = BackgroundMattingWithBGR(model_adapter, configuration) |
| 116 | + if args.background is None: |
| 117 | + raise ValueError('The BackgroundMattingWithBackground model expects the specified "--background" option.') |
| 118 | + model = BackgroundMattingWithBackground(model_adapter, configuration) |
119 | 119 | need_bgr_input = True
|
120 | 120 | is_matting_model = True
|
121 | 121 | else:
|
122 | 122 | model = MaskRCNNModel(model_adapter, configuration)
|
123 |
| - if not need_bgr_input and args.bgr is not None: |
124 |
| - log.warning('The \"--bgr\" option works only for BackgroundMattingWithBGR model. Option will be omitted.') |
| 123 | + if not need_bgr_input and args.background is not None: |
| 124 | + log.warning('The \"--background\" option works only for BackgroundMattingWithBackground model. Option will be omitted.') |
125 | 125 |
|
126 | 126 | if args.raw_output_message and is_matting_model:
|
127 | 127 | log.warning('\'--raw_output_message\' argument is set but is used background-matting based model, nothing to show')
|
@@ -223,7 +223,7 @@ def main():
|
223 | 223 |
|
224 | 224 | model, need_bgr_input = get_model(model_adapter, configuration, args)
|
225 | 225 |
|
226 |
| - input_bgr = open_images_capture(args.bgr, False).read() if need_bgr_input else None |
| 226 | + input_bgr = open_images_capture(args.background, False).read() if need_bgr_input else None |
227 | 227 |
|
228 | 228 | person_id = -1
|
229 | 229 | for i, label in enumerate(labels):
|
|
0 commit comments