corrected UV coordinates flip for torso
Summary:
Fixes flip transform for body parts that do not change labels under flip:
old behavior: UV coordinates unchanged
new behavior: UV coordinates flipped
@@ -152,13 +152,14 @@ class DensePoseDataRelative(object):
self.x = self.segm.size(1) - self.x
self._flip_iuv_semantics(dp_transform_data)
- def _flip_iuv_semantics(self, dp_transform_data):
+ def _flip_iuv_semantics(self, dp_transform_data: DensePoseTransformData) -> None:
i_old = self.i.clone()
uv_symmetries = dp_transform_data.uv_symmetries
pt_label_symmetries = dp_transform_data.point_label_symmetries
for i in range(self.N_PART_LABELS):
+ if i + 1 in i_old:
+ annot_indices_i = (i_old == i + 1)
if pt_label_symmetries[i + 1] != i + 1:
- annot_indices_i = i_old == i + 1
self.i[annot_indices_i] = pt_label_symmetries[i + 1]
u_loc = (self.u[annot_indices_i] * 255).long()
v_loc = (self.v[annot_indices_i] * 255).long()
