Comments (2)
Option 1:
Follow Get Started -> Data Preparation -> Optionally, you can also generate these files by yourself.
in PATN Repository to get the key points label.
Option 2:
For a test image xxx.jpg
, run openpose to get the keypoints file xxx_keypoints.json
(Body_25 label), and then you can load the key points as pytorch Tensor for the single test image by function
def load_pose_from_json(pose_json, target_size=(256,256), orig_size=(256,256)):
'''
This function converts the OpenPose detected key points (in .json file) to the desired heatmap.
input:
- pose_json (str): the file_path of the OpenPose detection in .json.
- target_size (tuple): the size of output heatmap
- orig_size (tuple): the size of original image that is used for OpenPose to detect the key points.
Output:
- heatmap (torch.Tensor) : the heatmap in size 18xHxW as specified by target_size
'''
with open(pose_json, 'r') as f:
anno = json.load(f)
if len(anno['people']) < 1:
a,b = target_size
return torch.zeros((18,a,b))
anno = list(anno['people'][0]['pose_keypoints_2d'])
x = np.array(anno[1::3])
y = np.array(anno[::3])
x[8:-1] = x[9:]
y = np.array(anno[::3])
y[8:-1] = y[9:]
x[x==0] = -1
y[y==0] = -1
coord = np.concatenate([x[:,None], y[:,None]], -1)
pose = pose_utils.cords_to_map(coord, target_size, orig_size)
pose = np.transpose(pose,(2, 0, 1))
pose = torch.Tensor(pose)
return pose[:18]
from dressing-in-order.
Hi @cuiaiyu , Thanks a lot for this great work.
I'm working on Cloth Virtual Try-On as my Final Year Project.
The demo worked fine for me but currently I'm facing some issues in performing virtual try-on on my own image.
Steps I followed:
-
Resized by full size image .jpg to 750x1101 pixels (as all the images in test folder are of this dimension) and added it to test folder.
-
Ran openpose on the image and obtained the keypoints in .json file, manually separated x and y keypoints as (x0, y0, c0, x1, y1, c1, ....) and added the file name along with 2D_pose_keypoint y and x keypoints respectively in fasion-annotation-test.csv .
-
Using SCHP found the human parsing and added it to testM_lip.
-
Added image name in test.lip and standard_test_anns.txt under print just for testing.
-
After that I just ran the demo.ipynb and got the following error in data loading step.
I tried a lot to resolve this error but I'm unable to get it also I'm approaching the deadline. Kindly help me to test the model on custom image.
Also I'm unable to understand the use of fasion-pairs-test.csv while running demo.
Hopeful for your kind reply.
Thanks a lot Cuiaiyu !!!
from dressing-in-order.
Related Issues (20)
- Colab model download link is not working
- Colab test images are cherry picked
- Test On Real Data
- What is $DATA_DIR in run_eval.sh file if I rerun all the training processing with DFashion dataset ? HOT 1
- Official Colab Released! HOT 4
- Results on custom images HOT 1
- High Resolution
- Typo in repo download file. HOT 1
- Help with inference. HOT 2
- Is there a specific order for the three stages of training? HOT 1
- dataset HOT 1
- NameError: name 'circle' is not defined HOT 4
- Not showing the output images while code is running HOT 1
- While trying custom images my output skeleton tilted -90 degrees HOT 3
- Google colab downloading data problem HOT 2
- multi gpu
- Step by Step to use my own clothes images HOT 3
- testM_lip not found. HOT 3
- colab Load Pretrained Model Error HOT 2
- Training time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dressing-in-order.