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

Convert numpy arrays to lists before saving the evaluation metrics as json #23268

Merged
merged 4 commits into from
May 11, 2023
Merged

Convert numpy arrays to lists before saving the evaluation metrics as json #23268

merged 4 commits into from
May 11, 2023

Conversation

harisankar95
Copy link
Contributor

eval_metrics contains:
- mean_iou: float
- mean_accuracy: float
- overall_accuracy: float
- per_category_iou: ndarray of shape (num_labels,)
- per_category_accuracy: ndarray of shape (num_labels,)
ndarrays are to be converted to lists for json serialization.

per_category_iou and per_category_accuracy  are ndarray in the eval_metrics
convert numpy array to list before writing to json
@harisankar95
Copy link
Contributor Author

@sgugger Can you please review this small update.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

LGTM! Can you just run make style on your branch to fix the styling issue?

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 10, 2023

The documentation is not available anymore as the PR was closed or merged.

@harisankar95
Copy link
Contributor Author

LGTM! Can you just run make style on your branch to fix the styling issue?

yes, the styling issue is now fixed.

@sgugger sgugger merged commit 5d02e6b into huggingface:main May 11, 2023
sheonhan pushed a commit to sheonhan/transformers that referenced this pull request May 15, 2023
… json (huggingface#23268)

* convert numpy array to list before writing to json

per_category_iou and per_category_accuracy  are ndarray in the eval_metrics

* code reformatted with make style
gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
… json (huggingface#23268)

* convert numpy array to list before writing to json

per_category_iou and per_category_accuracy  are ndarray in the eval_metrics

* code reformatted with make style
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
… json (huggingface#23268)

* convert numpy array to list before writing to json

per_category_iou and per_category_accuracy  are ndarray in the eval_metrics

* code reformatted with make style
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.

3 participants