Skip to content

Conversation

@gbeane
Copy link
Collaborator

@gbeane gbeane commented Dec 25, 2025

Recently I changed the ClassifierType from an IntEnum to a an Enum class with string values (inherits from both str and Enum)

This introduced a bug loading the training data in the jabs-classify train command.

@gbeane gbeane requested review from SkepticRaven, bergsalex, Copilot and keithshep and removed request for Copilot and keithshep December 25, 2025 00:35
@gbeane gbeane self-assigned this Dec 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug introduced when ClassifierType was changed from an IntEnum to a string-based Enum. The fix ensures backward compatibility by supporting both the old integer format (1 = Random Forest, 2 = XGBoost) and the new string format when loading training data.

Key Changes:

  • Modified load_training_data to handle both integer and string classifier type values
  • Updated export_training_data to save the enum's string value instead of converting to string

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/jabs/project/read_training.py Added backward-compatible loading logic for classifier_type attribute that handles both old integer and new string formats
src/jabs/project/export_training.py Changed to save classifier_type.value instead of str(classifier_type) for consistent string storage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self._video_reader = video_reader
self._pose_est = pose_est
self._identity = identity
self._label_closest = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change related to the rest of the PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, this shouldn't have been in this PR but it's a non-functional change (self._label_closest is assigned another value a few lines later)

Copy link
Contributor

@keithshep keithshep left a comment

Choose a reason for hiding this comment

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

looks good

@gbeane gbeane merged commit 475fe3e into main Dec 30, 2025
2 checks passed
@gbeane gbeane deleted the fix-training-data-file branch December 30, 2025 18:05
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.

4 participants