Skip to content
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

获取实例分割结果时报错 #11695

Open
yeyujujishou opened this issue May 9, 2024 · 0 comments
Open

获取实例分割结果时报错 #11695

yeyujujishou opened this issue May 9, 2024 · 0 comments
Assignees

Comments

@yeyujujishou
Copy link

bboxes = np.vstack(bbox_result)

File "<array_function internals>", line 200, in vstack
TypeError: dispatcher for array_function did not return an iterable

result = inference_detector(seg_model, src_image)

返回labelmejson格式

def seg_return_labelmejson(result, srcImg, score_thr):
shapes=[]
if isinstance(result, tuple):
bbox_result, segm_result = result
else:
bbox_result, segm_result = result, None

print("bbox_result:",bbox_result)

# 分割
bboxes = np.vstack(bbox_result)
if segm_result is not None:
    segms = mmcv.concat_list(segm_result)
    inds = np.where(bboxes[:, -1] > score_thr)[0]
    task_list = []
    for i in inds: # 先统一创建,启动
        task = MyThread(contours2points, (i, srcImg, segms))
        task.start()
        task_list.append(task)

    for ia in inds: # 获取结果
        shape=task_list[ia].get_result()
        shapes.append(shape)

return shapes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants