-
Notifications
You must be signed in to change notification settings - Fork 649
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
[Bug] mask color can‘t be changed #2304
Comments
I don't understand what you are trying to do
This line create a Palette with 32 random color.
This line will use the 250 % 32 = 26 th color in Palette |
I try a lot of color ,but the mask shown in image is alway black. Is that normal? |
I want to change color of mask to blue,however I don't know how to set the parameter? |
what the output image looks like? |
@irexyc Do you have any advice? |
Are you using a official model? If so, can you provide your convertion command? After convertion, there should be two visualize images, are they look same? |
You can paste the two visualize images. For the use of SDK, if you don't change the code, what is the output looks like? Could you also paste the image? |
@irexyc For the use of SDK, if I don't change the code, the output is as below. |
@fellen88 Is it convenient for you to share the model config、model pth and convertion command? |
@irexyc **model config: 新配置继承了基本配置,并做了必要的修改base = '../../configs/mask_rcnn/mask-rcnn_r50-caffe_fpn_ms-poly-1x_coco.py' 我们还需要更改 head 中的 num_classes 以匹配数据集中的类别数model = dict( 修改数据集相关配置data_root = 'data/data_set/test/' 修改评价指标相关配置val_evaluator = dict(ann_file=data_root + 'val/annotations.json') 使用预训练的 Mask R-CNN 模型权重来做初始化,可以提高模型性能可视化log_config = dict( work_dir = 'data/model/test' |
现在有点乱。 你的数据集转模型,看起来output_pytorch.jpg和output_tensorrt.jpg是一样的,但是你使用sdk,输出貌似只有一个框? 再上面,椅子那张图,sdk的输入没结果? 我觉得先把sdk的输出对齐再说颜色的问题。 |
@irexyc 椅子那幅图输出结果是正确的,因为根据score做了筛选,输出mask只有一辆车(黑色mask)。 |
@irexyc 我测试过,不根据score筛选的话,输出结果跟转换完成的模型输出的结果是相同的,所以sdk输出没有问题,只是颜色不能修改 |
@irexyc 修改后颜色显示正确了,谢谢! |
Checklist
Describe the bug
##Code:
mmdeploy::Detector::Result dets = detector->Apply(image_scene);
output_mask_count = 0;
for (const mmdeploy_detection_t& det : dets)
{
if (det.score > score_threshold)
{
//fprintf(stdout, "mask %d, height=%d, width=%d\n", index, mask->height, mask->width);
auto x0 = (int)std::max(std::floor(det.bbox.left) - 1, 0.f);
auto y0 = (int)std::max(std::floor(det.bbox.top) - 1, 0.f);
utils::Visualize v;
auto output = v.get_session(image_scene);
output.add_instance_mask({ x0, y0 }, 250, det.mask->data, det.mask->height, det.mask->width, 1.0);
dets_mask.push_back(output.get());
dets_label.push_back(det.label_id);
Reproduction
##Issue:
I try to change color of mask (show as below 250),but it doesn't work.
output.add_instance_mask({ x0, y0 }, 250, det.mask->data, det.mask->height, det.mask->width, 1.0);
Environment
##Version: windows prebuild package “mmdeploy-1.1.0-windows-amd64-cuda11.3”
Error traceback
No response
The text was updated successfully, but these errors were encountered: