Skip to content

Commit

Permalink
Merge pull request opencv#17469 from l-bat:fix_virtual_try_on
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jun 4, 2020
2 parents dbbfa00 + 5ffc5bc commit 08d1c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/dnn/src/onnx/onnx_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ void ONNXImporter::populateNet(Net dstNet)
{
layerParams.type = "ELU";
}
else if (layer_type == "Tanh")
{
layerParams.type = "TanH";
}
else if (layer_type == "PRelu")
{
layerParams.type = "PReLU";
Expand Down
2 changes: 1 addition & 1 deletion samples/dnn/virtual_try_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def prepare_agnostic(self, segm_image, input_image, pose_map, height=256, width=

agnostic = np.concatenate((res_shape, img_head, pose_map), axis=0)
agnostic = np.expand_dims(agnostic, axis=0)
return agnostic
return agnostic.astype(np.float32)

def get_warped_cloth(self, cloth_img, agnostic, height=256, width=192):
cloth = cv.dnn.blobFromImage(cloth_img, 1.0 / 127.5, (width, height), mean=(127.5, 127.5, 127.5), swapRB=True)
Expand Down

0 comments on commit 08d1c54

Please sign in to comment.