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

Object Detection Model Overview missing-class fix for Cohorts #2429

Merged
merged 12 commits into from
Dec 5, 2023

Conversation

Advitya17
Copy link
Collaborator

@Advitya17 Advitya17 commented Nov 27, 2023

The existing implementation of the endpoint involved getting a single list of missing class names for the first created cohort. However, there may be different missing class names for different cohorts. This PR fixes this issue by returning lists of different missing classes in the order of the computed cohorts.

image

image

Copilot-created summary:

The most important changes include modifying the compute_object_detection_metrics function in rai_vision_insights.py to handle cases where a class is not present in the cohort, and ensuring the correct class name is used for comparison in ModelOverview.tsx.

Main functionality changes:

  • rai_vision_insights.py: Modified the compute_object_detection_metrics function to include a new list all_cohort_classes to store the classes for each cohort, return both all_cohort_metrics and all_cohort_classes, and handle cases where a class is not present in the cohort. [1] [2] [3]

Correctness improvement:

  • ModelOverview.tsx: Ensured that the correct class name is used for comparison with this.state.className in the loop.

Description

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@Advitya17 Advitya17 changed the title Object Detection Model Overview missing-class fix for Cohort Object Detection Model Overview missing-class fix for Cohorts Nov 27, 2023
@Advitya17 Advitya17 marked this pull request as ready for review November 27, 2023 19:25
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (85d6373) 88.86% compared to head (26bda8f) 81.01%.

Files Patch % Lines
..._vision/rai_vision_insights/rai_vision_insights.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2429      +/-   ##
==========================================
- Coverage   88.86%   81.01%   -7.85%     
==========================================
  Files         134       26     -108     
  Lines        7708     2297    -5411     
==========================================
- Hits         6850     1861    -4989     
+ Misses        858      436     -422     
Flag Coverage Δ
unittests 81.01% <80.00%> (-7.85%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Advitya17 Advitya17 merged commit f5118e4 into main Dec 5, 2023
102 checks passed
@Advitya17 Advitya17 deleted the agemawat/cohort_class_fix branch December 5, 2023 20:27
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