Skip to content

Target logits bug fix#45

Merged
stefanistrate merged 3 commits intogoogle:mainfrom
ViktorDomazetoski:Target_logits_bugfix
Oct 15, 2025
Merged

Target logits bug fix#45
stefanistrate merged 3 commits intogoogle:mainfrom
ViktorDomazetoski:Target_logits_bugfix

Conversation

@ViktorDomazetoski
Copy link
Contributor

When using a batch size above 1, the returned target logits for the entire batch are equal to the first element of the batch. The fix enumerates through the predictions to get the logit for the corresponding element of the batch.

@google-cla
Copy link

google-cla bot commented Sep 23, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ViktorDomazetoski ViktorDomazetoski changed the title target logits bug fix Target logits bug fix Sep 23, 2025
@stefanistrate
Copy link
Collaborator

Thanks for the fix, @ViktorDomazetoski!

Once you sign the CLA mentioned above and address the formatting issues identified by our automatic checks (i.e. https://github.com/google/cameratrapai/actions/runs/17946293131/job/51082087160?pr=45), we're happy to approve your change.

If you're feeling even more adventurous, since you uncovered a bug for which we didn't test properly, feel free to add a test in classifier_test.py to verify that using target_idx works correctly with and without batches.

Copy link
Collaborator

@stefanistrate stefanistrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, @ViktorDomazetoski! Looking great.

@stefanistrate stefanistrate merged commit f8ea337 into google:main Oct 15, 2025
18 checks passed
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

Successfully merging this pull request may close these issues.

2 participants