Skip to content

Commit 5b8164b

Browse files
authored
Update dataset.py
More closely follows pytorch/vision#2144 and https://github.com/pytorch/vision/releases/tag/v0.6.0 for negative samples.
1 parent 7309cea commit 5b8164b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deepforest/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def __getitem__(self, idx):
110110

111111
# If image has no annotations, don't augment
112112
if np.sum(targets["boxes"]) == 0:
113-
boxes = boxes = torch.zeros((0, 4), dtype=torch.float32)
114-
labels = torch.from_numpy(targets["labels"])
113+
boxes = torch.zeros((0, 4), dtype=torch.float32)
114+
labels = torch.zeros(0, dtype=torch.int64)
115115
# channels last
116116
image = np.rollaxis(image, 2, 0)
117117
image = torch.from_numpy(image).float()

0 commit comments

Comments
 (0)