未验证 提交 5d5d00f5 编写于 作者: S shangliang Xu 提交者: GitHub

[dev] fix serving python no object bug in deploy (#7205)

上级 36f34116
......@@ -191,14 +191,18 @@ class DetectorOp(Op):
idx = 0
results = {}
for img_name, num in zip(input_dict.keys(), bboxes_num):
result = []
bbox = bboxes[idx:idx + num]
for line in bbox:
if line[0] > -1 and line[1] > GLOBAL_VAR[
'model_config'].draw_threshold:
result.append(f"{int(line[0])} {line[1]} "
f"{line[2]} {line[3]} {line[4]} {line[5]}")
results[img_name] = result
if num == 0:
results[img_name] = 'No object detected!'
else:
result = []
bbox = bboxes[idx:idx + num]
for line in bbox:
if line[0] > -1 and line[1] > GLOBAL_VAR[
'model_config'].draw_threshold:
result.append(
f"{int(line[0])} {line[1]} "
f"{line[2]} {line[3]} {line[4]} {line[5]}")
results[img_name] = result
idx += num
return results
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册