Commit e771701
authored
Fix empty instance handling (#364)
This PR improves empty-instance handling in instance cropping method and
the `CenteredInstanceDataset` class. Previously, if an instance
contained only NaN keypoints, `find_instance_crop_size` would trigger a
“NaN values encountered” warning when attempting to compute its bounding
box. We now fixthis by only computing crop sizes for non-empty instances
(`instance.is_empty` is False). We also remove redundant empty-instance
filtering in `__getitem__()` for centered-instance models, since this is
already enforced when creating `instance_idx_list`.1 parent d946ec3 commit e771701
2 files changed
+16
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
803 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
804 | 805 | | |
805 | 806 | | |
806 | 807 | | |
| |||
1046 | 1047 | | |
1047 | 1048 | | |
1048 | 1049 | | |
1049 | | - | |
1050 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1051 | 1053 | | |
1052 | 1054 | | |
1053 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
0 commit comments