CoCosNet-v2
CoCosNet-v2 copied to clipboard
training on custome dataset
hello, you used OpenPose to create pose *.txt files how i can create thous files for another data set ? i follow the link for OpenPose but i i can't see where the pose *.txt files are made , i can see only the pose images results thank you
Same here. I'd like to try it on a totally unrelated set of images (photos and sketches). Any guidance on how to go about would be appreciated.
import cv2
import numpy as np
import os
from src.body import Body
class PoseKeyPoint():
def __init__(self):
#change the two path
self.path = '../dataset/yourdataset/img'
self.out = '../dataset/yourdataset/pose'
def pose(self):
# body_pose_model.pth you can download from OpenPose and put it under the models folder
body_estimation = Body('../models/body_pose_model.pth')
filelist = os.listdir(self.path)
for item in filelist:
oriImg = cv2.imread(os.path.join(self.path,item)) # B,G,R order
candidate, subset = body_estimation(oriImg)
file_candidate = os.path.join(self.out,os.path.splitext(item)[0]+'_candidate.txt')
file_subset = os.path.join(self.out,os.path.splitext(item)[0]+'_subset.txt')
np.savetxt(file_candidate,candidate)
np.savetxt(file_subset,subset)
print(item)
if __name__ == '__main__':
pose = PoseKeyPoint()
pose.pose()