Description
In the MOT17 (multiedge_inference_bench/pedestrian_tracking) example, there is a bug in the error-handling logic of generate_reports.py. When a required configuration file is missing, the script attempts to print a helpful error message and cleanly exit. However, it references an undefined variable config_file, which causes an opaque NameError crash instead.
Root Cause
In examples/MOT17/multiedge_inference_bench/pedestrian_tracking/generate_reports.py (lines 77 and 86), the code references config_file in an f-string, but the correct local variables are tracking_config_file and reid_config_file.
Affected locations:
generate_reports.py:77 → f"...({config_file})..." should be f"...({tracking_config_file})..."
generate_reports.py:86 → f"...({config_file})..." should be f"...({reid_config_file})..."
Impact
It replaces an intended graceful system exit with a Python stack trace (NameError: name 'config_file' is not defined), making debugging difficult for developers when dealing with broken paths or missing files.
Expected Behavior
The script should cleanly print Could not find tracking config at (...) or Could not find reid config at (...) and exit.
Proposed Fix
Replace config_file with the appropriately scoped variables:
- On line 77: swap
config_file for tracking_config_file
- On line 86: swap
config_file for reid_config_file
Reproduction Steps
- Remove or point to a non-existent tracking/reid config file in the MOT17 example
- Run
generate_reports.py
- Observe
NameError instead of clean error message
Description
In the MOT17 (
multiedge_inference_bench/pedestrian_tracking) example, there is a bug in the error-handling logic ofgenerate_reports.py. When a required configuration file is missing, the script attempts to print a helpful error message and cleanly exit. However, it references an undefined variableconfig_file, which causes an opaqueNameErrorcrash instead.Root Cause
In
examples/MOT17/multiedge_inference_bench/pedestrian_tracking/generate_reports.py(lines 77 and 86), the code referencesconfig_filein anf-string, but the correct local variables aretracking_config_fileandreid_config_file.Affected locations:
generate_reports.py:77→f"...({config_file})..."should bef"...({tracking_config_file})..."generate_reports.py:86→f"...({config_file})..."should bef"...({reid_config_file})..."Impact
It replaces an intended graceful system exit with a Python stack trace (
NameError: name 'config_file' is not defined), making debugging difficult for developers when dealing with broken paths or missing files.Expected Behavior
The script should cleanly print
Could not find tracking config at (...)orCould not find reid config at (...)and exit.Proposed Fix
Replace
config_filewith the appropriately scoped variables:config_filefortracking_config_fileconfig_fileforreid_config_fileReproduction Steps
generate_reports.pyNameErrorinstead of clean error message