CrowdHuman 测试
【摘要】
CrowdHuman测试
hbox:head box
vbox:可见身体box
fbox:联想扩展身体box
坐标: x y w h
cv2.rectangle:x1 y1 x2 y2
如果 x1 y1 x2 y2超出边界,不报错,但是画不出来
height,width=img.shape[:2]
import cv2import ...
CrowdHuman测试
hbox:head box
vbox:可见身体box
fbox:联想扩展身体box
坐标: x y w h
cv2.rectangle:x1 y1 x2 y2
如果 x1 y1 x2 y2超出边界,不报错,但是画不出来
height,width=img.shape[:2]
-
import cv2
-
import json
-
-
obj_str='{"ID": "284193,faa9000f2678b5e", "gtboxes": [{"tag": "person", "hbox": [123, 129, 63, 64], "head_attr": {"ignore": 0, "occ": 1, "unsure": 0}, "fbox": [61, 123, 191, 453], "vbox": [62, 126, 154, 446], "extra": {"box_id": 0, "occ": 1}}, {"tag": "person", "hbox": [214, 97, 58, 74], "head_attr": {"ignore": 0, "occ": 1, "unsure": 0}, "fbox": [165, 95, 187, 494], "vbox": [175, 95, 140, 487], "extra": {"box_id": 1, "occ": 1}}, {"tag": "person", "hbox": [318, 109, 58, 68], "head_attr": {"ignore": 0, "occ": 1, "unsure": 0}, "fbox": [236, 104, 195, 493], "vbox": [260, 106, 170, 487], "extra": {"box_id": 2, "occ": 1}}, {"tag": "person", "hbox": [486, 119, 61, 74], "head_attr": {"ignore": 0, "occ": 0, "unsure": 0}, "fbox": [452, 110, 169, 508], "vbox": [455, 113, 141, 501], "extra": {"box_id": 3, "occ": 1}}, {"tag": "person", "hbox": [559, 105, 53, 57], "head_attr": {"ignore": 0, "occ": 0, "unsure": 0}, "fbox": [520, 95, 163, 381], "vbox": [553, 98, 70, 118], "extra": {"box_id": 4, "occ": 1}}, {"tag": "person", "hbox": [596, 40, 72, 83], "head_attr": {"ignore": 0, "occ": 0, "unsure": 0}, "fbox": [546, 39, 202, 594], "vbox": [556, 39, 171, 588], "extra": {"box_id": 5, "occ": 1}}, {"tag": "person", "hbox": [731, 139, 69, 83], "head_attr": {"ignore": 0, "occ": 0, "unsure": 0}, "fbox": [661, 132, 183, 510], "vbox": [661, 132, 183, 510], "extra": {"box_id": 6, "occ": 0}}]}'
-
data = json.loads(obj_str)
-
-
-
-
img=cv2.imread("284193,faa9000f2678b5e.jpg")
-
-
print(data["ID"])
-
for obj in data["gtboxes"]:
-
# print('tag',obj['tag'])
-
print('hbox',obj['hbox'])
-
-
# draw_0 = cv2.rectangle(img, (obj['hbox'][0], obj['hbox'][1]), (obj['hbox'][0]+obj['hbox'][2], obj['hbox'][1]+obj['hbox'][3]), (255, 0, 0), 1)
-
# print('head_attr',obj['head_attr'])
-
print('fbox',obj['fbox'])
-
# draw_0 = cv2.rectangle(img, (obj['fbox'][0], obj['fbox'][1]),(obj['fbox'][0] + obj['fbox'][2], obj['fbox'][1] + obj['fbox'][3]), (0, 255, 0), 1)
-
print('vbox',obj['vbox'])
-
draw_0 = cv2.rectangle(img, (obj['vbox'][0], obj['vbox'][1]),(obj['vbox'][0] + obj['vbox'][2], obj['vbox'][1] + obj['vbox'][3]), (0, 0,255), 1)
-
# print('extra',obj['extra'])
-
-
cv2.imshow("'sdf",img)
-
cv2.waitKey()
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/88583798
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)