Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

error occured when running tools/demo.py (video or webcam mode)

Open
#709 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

thanks for ur repo.
when running tools/demo.py in video or webcam mode without setting --save-result flag, an error is raised as following:

Traceback (most recent call last):
  File "tools/demo.py", line 319, in <module>
    main(exp, args)
  File "tools/demo.py", line 312, in main
    imageflow_demo(predictor, vis_folder, current_time, args)
  File "tools/demo.py", line 215, in imageflow_demo
    save_folder = os.path.join(
  File "/home/public/anaconda3/envs/torch/lib/python3.8/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

the reason for this is that save_result flag is not checked when run os.path.join

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tools/demo.py, especially imageflow_demo around line 215 and main around line 312. Reproduce the video or webcam mode without --save-result, then inspect how the save-result option is handled before the failing path. Done means both modes run without the reported TypeError when saving is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.