在使用对象检测时,如何生成遮罩而不是长方体?

2024-05-23 21:13:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用TensorFlow模型Zoo对象检测,并希望将图像输出更改为具有遮罩而不是长方体

我尝试用masks\rcnn\u inception\u V2模型对网络进行重新训练,但没有效果

vis_util.visualize_boxes_and_labels_on_image_array(
        imageOutput,
        np.squeeze(boxes),
        np.squeeze(classes).astype(np.int32),
        np.squeeze(scores),
        category_index,
        use_normalized_coordinates=True,
        line_thickness=2,
        min_score_thresh=0.60,
        skip_scores=True,
        skip_labels=True)
cv2.imwrite('../project/test.png', imageOutput)
    # Clean up
    print("10 secs")

    time.sleep(10)

我需要包含什么参数来生成遮罩而不是存储图像上的框


Tags: 对象模型图像truelabelstensorflownpmasks