Skip to content

Commit 08d1c54

Browse files
committed
Merge pull request opencv#17469 from l-bat:fix_virtual_try_on
2 parents dbbfa00 + 5ffc5bc commit 08d1c54

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/dnn/src/onnx/onnx_importer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,10 @@ void ONNXImporter::populateNet(Net dstNet)
806806
{
807807
layerParams.type = "ELU";
808808
}
809+
else if (layer_type == "Tanh")
810+
{
811+
layerParams.type = "TanH";
812+
}
809813
else if (layer_type == "PRelu")
810814
{
811815
layerParams.type = "PReLU";

samples/dnn/virtual_try_on.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def prepare_agnostic(self, segm_image, input_image, pose_map, height=256, width=
185185

186186
agnostic = np.concatenate((res_shape, img_head, pose_map), axis=0)
187187
agnostic = np.expand_dims(agnostic, axis=0)
188-
return agnostic
188+
return agnostic.astype(np.float32)
189189

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

0 commit comments

Comments
 (0)