Skip to content

Commit 5b51b74

Browse files
committed
#Bug Fixed: Predict mask does not match with original image size
1 parent ff9d4d0 commit 5b51b74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Modified based on https://github.com/XuJiacong/PIDNet
44
# ------------------------------------------------------------------------------
55
# ------------------------------------------------------------------------------
6-
# example command: python3 tools\custom.py --model-type 'pidnet-l' --model output\elanroad\best.pt --input samples\Cam5.mp4 --n-class 2 --visualize --show
6+
# example command: python tools\custom.py --model-type 'pidnet-l' --model output\elanroad\pidnet_large_elan_HSV_MBA\best.pt --input samples\road.jpg --n-class 2 --visualize --show
77
# ------------------------------------------------------------------------------
88

99
import glob
@@ -93,7 +93,7 @@ def main(args):
9393
t1 = time_synchronized()
9494
pred = model(img)
9595
t2 = time_synchronized()
96-
pred = F.interpolate(pred, size=img.size()[-2:],
96+
pred = F.interpolate(pred, size=imgOrigin.shape[:-1],
9797
mode='bilinear', align_corners=True)
9898
pred = torch.argmax(pred, dim=1).squeeze(0).cpu().numpy()
9999

0 commit comments

Comments
 (0)