-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvis_images.py
34 lines (33 loc) · 1.1 KB
/
vis_images.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#----------------description----------------#
# Author : Yanhong Wang
# E-mail : yhwang18@fudan.edu.cn
# Company : IBICAS, Fudan University
# Date : 2022-07-07 12:07:07
# LastEditors : Yanhong Wang
# LastEditTime : 2022-07-07 18:06:06
# FilePath : \SAIL-TUG\vis_images.py
# Description : Visualizing images and their keypoints
#-------------------------------------------#
import json
import cv2
import os
from fn import vis_frame
with open("dataset/annotations/keyPoints.json","r") as f:
data_json = json.load(f)
imgnames = data_json["imgname"]
bndboxes = data_json["bndbox"]
parts = data_json["part"]
# print(len(imgnames))
# print(len(bndboxes))
# print(len(parts))
for i in range(35646):
im_res = {}
im_res['imgname'] = imgnames[i]
human = {}
human['keypoints'] = parts[i]
human['kp_score'] = [1 for i in range(17)]
im_res['result'] = [human]
ori_img = cv2.imread("dataset/images/"+im_res['imgname'])
img = vis_frame(ori_img, im_res)
cv2.imshow("骨骼图", img)
cv2.waitKey(0)