Skip to content
Snippets Groups Projects
Commit 254077be authored by 高志华's avatar 高志华 Committed by Kai Chen
Browse files

Update inference.py (#329)

* Update inference.py

fix inference bug, the default keep_ratio is True...But SSD should be false

* Update inference.py

format correct

* Update inference.py

A more stable way

* Update inference.py

* Update inference.py
parent 8d2f0942
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,9 @@ from mmdet.core import get_classes
def _prepare_data(img, img_transform, cfg, device):
ori_shape = img.shape
img, img_shape, pad_shape, scale_factor = img_transform(
img, scale=cfg.data.test.img_scale)
img,
scale=cfg.data.test.img_scale,
keep_ratio=cfg.data.test.get('resize_keep_ratio', True))
img = to_tensor(img).to(device).unsqueeze(0)
img_meta = [
dict(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment