Skip to content
Advertisement

Using Yolox on an asset image doesn’t draw any detection

So I’m trying to learn how to use Yolox for my bachelor thesis, and after hours of installing and updating components, finally managed to run Yolox on a test image in the assets folder. However, when I go to the output folder, it’s the same image there, with no boxes on detected objects and I can’t understand why.. Here is the console output:

G:TPD_v2YOLOX>python tools/demo.py image -n yolox-s -c models/yolox_s.pth --path assets/dog.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result --device [cpu/gpu]
2022-01-24 11:59:07.079 | INFO     | __main__:main:240 - Args: Namespace(camid=0, ckpt='models/yolox_s.pth', conf=0.25, demo='image', device='[cpu/gpu]', exp_file=None, experiment_name='yolox_s', fp16=False, fuse=False, name='yolox-s', nms=0.45, path='assets/dog.jpg', save_result=True, trt=False, tsize=640)
2022-01-24 11:59:07.202 | INFO     | __main__:main:250 - Model Summary: Params: 8.97M, Gflops: 26.81
2022-01-24 11:59:07.204 | INFO     | __main__:main:261 - loading checkpoint
2022-01-24 11:59:07.280 | INFO     | __main__:main:265 - loaded checkpoint done.
2022-01-24 11:59:07.886 | INFO     | __main__:inference:151 - Infer time: 0.5256s
2022-01-24 11:59:07.887 | INFO     | __main__:image_demo:188 - Saving detection result in ./YOLOX_outputsyolox_svis_res2022_01_24_11_59_07dog.jpg

Also I’m trying to understand how to use cocodataset to train a model and use it in Yolox, if you know any guides/tutorials that can help me, I’ll appreciate it, thank you!

Advertisement

Answer

MODEL_PATH = "/best_ckpt.pth.tar"
TEST_IMAGE_PATH = "assets/dog.jpg"

!python /content/YOLOX/tools/demo.py image -f /content/YOLOX/exps/example/yolox_voc/yolox_voc_s.py -c {MODEL_PATH} --path {TEST_IMAGE_PATH} --conf 0.25 --nms 0.45 --tsize 640 --save_result --device cpu

You pointed to the downloaded weights instead of the trained weights

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement