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

AttributeError: 'Namespace' object has no attribute 'norm_dets'. When using format_dets with value txt. #45

Closed
mziai opened this issue Apr 13, 2024 · 4 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@mziai
Copy link

mziai commented Apr 13, 2024

Describe the bug
Thank you for this awesome tool. There seems to be a bug in cli when specifying --format_dets txt. A simple fix may be renaming norm_in_dets found here to norm_dets (or vise versa) if I understood the code correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Specify --format_dets txt --norm_dets rel detection options when using globox cli tool.

Expected behavior
No error happens and I can use both --format_dets txt and --norm_dets rel.

Environment (please complete the following information):

  • Ubuntu 22.04 (WSL).
  • Globox version 2.4.3.
  • Python 3.10.12.

Additional context
Error traceback:

Traceback (most recent call last):
  File "/home/user/.local/bin/globox", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.10/site-packages/globox/cli.py", line 384, in main
    predictions = parse_dets_annotations(args, coco_gts=coco_gts)
  File "/home/user/.local/lib/python3.10/site-packages/globox/cli.py", line 268, in parse_dets_annotations
    relative: bool = args.norm_dets == "rel"
AttributeError: 'Namespace' object has no attribute 'norm_dets'. Did you mean: 'format_dets'?
@laclouis5
Copy link
Owner

Thanks for reporting this bug and for the details.

I fixed this issue in the last version 2.4.4.

@mziai
Copy link
Author

mziai commented Apr 16, 2024

Sorry to bump this closed issue, but as far as I can tell, the problem still persists. What did the trick for me, was changing line 268 from relative: bool = args.norm_dets == "rel" to relative: bool = args.norm_in_dets == "rel".

Please correct me if I am wrong, but it is parse_dets_annotations function that had to to be modified in this situation, not the parse_annotations, as was done in your fix. That is because we are dealing with detection format arguments.

@laclouis5

@laclouis5 laclouis5 linked a pull request Apr 18, 2024 that will close this issue
@laclouis5
Copy link
Owner

@mziai Whoops, I did it too fast and updated the wrong line without testing. Could you check if PR #46 solves the issue please ? This reverts the last fix and updates line 268 instead.

@laclouis5 laclouis5 reopened this Apr 18, 2024
@laclouis5 laclouis5 added the bug Something isn't working label Apr 18, 2024
@mziai
Copy link
Author

mziai commented Apr 18, 2024

@laclouis5 I think PR solves the problem. I have these fixes applied locally and everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants