Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to inference? #10

Closed
guofeng1996 opened this issue Dec 13, 2021 · 3 comments
Closed

How to inference? #10

guofeng1996 opened this issue Dec 13, 2021 · 3 comments

Comments

@guofeng1996
Copy link

My inference command is :python demo/image_demo.py 2.jpg configs/sspnet/faster_rcnn_r50_sspnet_1x_coco_new.py checkpoints/epoch_10.pth --device cuda:3

Traceback (most recent call last):
File "demo/image_demo.py", line 50, in
main(args)
File "demo/image_demo.py", line 30, in main
result = inference_detector(model, args.img)
File "/home/SSPNet-master/mmdet/apis/inference.py", line 129, in inference_detector
data = test_pipeline(data)
File "/home/SSPNet-master/mmdet/datasets/pipelines/compose.py", line 41, in call
data = t(data)
File "/home/SSPNet-master/mmdet/datasets/pipelines/loading.py", line 61, in call
corner = results['img_info']['corner']
KeyError: 'corner

How can I fix it? or How to inference a image?

@MingboHong
Copy link
Owner

You need to modify the “test_pipeline” in “coco_detection.py”

test_pipeline = [
dict(type='LoadSubImageFromFile') ===> dict(type='LoadImageFromFile')
xxxxx
xxxxx
xx
]

where "dict(type='LoadImageFromFile')" avoids the use of patch images for inference.

@guofeng1996
Copy link
Author

Thank you very much. I did it!

@guyuehuqaq
Copy link

You need to modify the “test_pipeline” in “coco_detection.py”

test_pipeline = [ dict(type='LoadSubImageFromFile') ===> dict(type='LoadImageFromFile') xxxxx xxxxx xx ]

where "dict(type='LoadImageFromFile')" avoids the use of patch images for inference.

Is your reasoning page like this? I use your open source code, the accuracy is always a few points lower, can you tell me what's going on?please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants