Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void Renderer::convert_prims_color(std::vector<render::Prim> &prims) {
render::Circle circle = std::get<render::Circle>(p);
circle.color = _color_converter->convert(circle.color);
p = circle;
} else if (std::holds_alternative<render::InstanceSegmantationMask>(p)) {
render::InstanceSegmantationMask mask = std::get<render::InstanceSegmantationMask>(p);
mask.color = _color_converter->convert(mask.color);
p = mask;
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions src/monolithic/gst/inference_elements/base/inference_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,18 +478,8 @@ void UpdateConfigWithLayerInfo(const std::vector<ModelInputProcessorInfo::Ptr> &
config[KEY_BASE][KEY_PIXEL_VALUE_MEAN] = three_doubles_to_str(mean);
}

int reverse_channels = 0; // TODO: verify that channel reversal works correctly with mean and std!
if (gst_structure_get_int(it->params, "reverse_input_channels", &reverse_channels)) {
config[KEY_BASE][KEY_MODEL_FORMAT] = reverse_channels ? "RGB" : "BGR";
}

const auto color_space = gst_structure_get_string(it->params, "color_space");
if (color_space) {
// Ensure that reverse_input_channels and color_space are not both defined
if (reverse_channels != 0 && color_space != nullptr) {
throw std::invalid_argument(
"ERROR: Cannot specify both 'reverse_input_channels' and 'color_space' parameters simultaneously");
}
config[KEY_BASE][KEY_MODEL_FORMAT] = color_space;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,19 +600,20 @@ std::map<std::string, GstStructure *> get_model_info_preproc(const std::shared_p
g_value_unset(&gvalue);
}
if (element.first == "reverse_input_channels") {
GValue gvalue = G_VALUE_INIT;
g_value_init(&gvalue, G_TYPE_INT);
g_value_set_int(&gvalue, gint(false));

std::transform(element.second.as<std::string>().begin(), element.second.as<std::string>().end(),
element.second.as<std::string>().begin(), ::tolower);

if (element.second.as<std::string>() == "yes" || element.second.as<std::string>() == "true")
g_value_set_int(&gvalue, gint(true));

gst_structure_set_value(s, "reverse_input_channels", &gvalue);
GST_INFO("[get_model_info_preproc] reverse_input_channels: %s", element.second.as<std::string>().c_str());
g_value_unset(&gvalue);
GValue color_value = G_VALUE_INIT;
g_value_init(&color_value, G_TYPE_STRING);
if (element.second.as<std::string>() == "yes" || element.second.as<std::string>() == "true") {
g_value_set_string(&color_value, "RGB");
} else {
g_value_set_string(&color_value, "BGR");
}
gst_structure_set_value(s, "color_space", &color_value);
Comment thread
marcin-wadolkowski marked this conversation as resolved.
GST_INFO("[get_model_info_preproc] (reverse_input_channels) color_space: %s",
g_value_get_string(&color_value));
g_value_unset(&color_value);
}
if (element.first == "reshape") {
std::vector<int> size_values = element.second.as<std::vector<int>>();
Expand Down Expand Up @@ -780,4 +781,4 @@ std::map<std::string, GstStructure *> get_model_info_postproc(const std::shared_
return res;
}

} // namespace ModelApiConverters
} // namespace ModelApiConverters
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2025 Intel Corporation
# Copyright (C) 2025-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -16,7 +16,7 @@
def make_pipeline_str(model_name):
PIPELINE_STR = """appsrc name=mysrc \
! decodebin ! videoconvert ! video/x-raw,format=BGRA \
! gvadetect pre-process-backend=ie model={} \
! gvadetect pre-process-backend=opencv model={} \
! gvawatermark \
! appsink name=mysink emit-signals=true sync=false """.format(get_model_path(model_name))
return PIPELINE_STR
Expand All @@ -25,10 +25,10 @@ def make_pipeline_str(model_name):
GOLD_TRUE = [
BBox(0.16600936461207816, 0.38890058405662487,
0.4078545726244531, 0.9406926827498019, [], class_id=16),
BBox(0.6055093107665357, 0.13401658383886872,
0.8919420810698284, 0.2956839696427691, [], class_id=7),
BBox(0.1501398097734139, 0.21889342922873212,
0.7452847887655665, 0.7433104570456628, [], class_id=1)
BBox(0.6063115210281538, 0.12930250608875107,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'BBox' (undefined-variable)

0.8995705738599682, 0.29633996381868855, [], class_id=2),
BBox(0.16694023857921714, 0.2259997108479297,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'BBox' (undefined-variable)

0.7387291779924805, 0.7268751913340168, [], class_id=1)
]

GOLD_TRUE_SEG = [
Expand Down
Loading