@@ -479,7 +479,7 @@ def create_pose_and_frame_dropout_uniform(example: tf.Tensor) -> tf.Tensor:
479
479
480
480
def test_pose_tf_posebody_copy_creates_deepcopy (self ):
481
481
pose = _get_random_pose_object_with_tf_posebody (num_keypoints = 5 )
482
- self .assertIsInstance (pose .body , TensorflowPoseBody )
482
+ self .assertIsInstance (pose .body , TensorflowPoseBody )
483
483
self .assertIsInstance (pose .body .data , TensorflowMaskedTensor )
484
484
485
485
pose_copy = pose .copy ()
@@ -488,7 +488,9 @@ def test_pose_tf_posebody_copy_creates_deepcopy(self):
488
488
489
489
# Check that pose and pose_copy are not the same object
490
490
self .assertNotEqual (pose , pose_copy , "Copy of pose should not be 'equal' to original" )
491
-
491
+ self .assertNotEqual (pose .header , pose_copy .header , "headers should be new objects as well" )
492
+ self .assertNotEqual (pose .header .components , pose_copy .header .components , "components should be new objects as well" )
493
+
492
494
# Ensure the data tensors are equal but independent
493
495
self .assertTrue (tf .reduce_all (pose .body .data == pose_copy .body .data ), "Copy's data should match original" )
494
496
@@ -499,6 +501,9 @@ def test_pose_tf_posebody_copy_creates_deepcopy(self):
499
501
500
502
# Create another copy and ensure it matches the first copy
501
503
pose = pose_copy .copy ()
504
+ self .assertNotEqual (pose , pose_copy , "Copy of pose should not be 'equal' to original" )
505
+ self .assertNotEqual (pose .header , pose_copy .header , "headers should be new objects as well" )
506
+ self .assertNotEqual (pose .header .components , pose_copy .header .components , "Components should be new objects as well" )
502
507
503
508
self .assertTrue (tf .reduce_all (pose .body .data == pose_copy .body .data ), "Copy's data should match original again" )
504
509
@@ -560,8 +565,9 @@ def test_pose_numpy_posebody_copy_creates_deepcopy(self):
560
565
pose = _get_random_pose_object_with_numpy_posebody (num_keypoints = 5 , frames_min = 3 )
561
566
562
567
pose_copy = pose .copy ()
563
-
564
568
self .assertNotEqual (pose , pose_copy , "Copy of pose should not be 'equal' to original" )
569
+ self .assertNotEqual (pose .header , pose_copy .header , "headers should be new objects as well" )
570
+ self .assertNotEqual (pose .header .components , pose_copy .header .components , "components should be new objects as well" )
565
571
566
572
self .assertTrue (np .array_equal (pose .body .data , pose_copy .body .data ), "Copy's data should match original" )
567
573
@@ -599,7 +605,9 @@ def test_pose_torch_posebody_copy_creates_deepcopy(self):
599
605
self .assertIsInstance (pose_copy .body , TorchPoseBody )
600
606
self .assertIsInstance (pose_copy .body .data , TorchMaskedTensor )
601
607
602
- self .assertNotEqual (pose , pose_copy , "Copy of pose should not be 'equal' to original" )
608
+ self .assertNotEqual (pose , pose_copy , "Copy of pose should not be 'equal' to original" )
609
+ self .assertNotEqual (pose .header , pose_copy .header , "headers should be new objects as well" )
610
+ self .assertNotEqual (pose .header .components , pose_copy .header .components , "components should be new objects as well" )
603
611
self .assertTrue (pose .body .data .tensor .equal (pose_copy .body .data .tensor ), "Copy's data should match original" )
604
612
self .assertTrue (pose .body .data .mask .equal (pose_copy .body .data .mask ), "Copy's mask should match original" )
605
613
0 commit comments