Skip to content

Commit

Permalink
Implement boosted robogrades
Browse files Browse the repository at this point in the history
  • Loading branch information
sarikaya committed Nov 8, 2023
1 parent e906e98 commit c83f40f
Show file tree
Hide file tree
Showing 5 changed files with 272 additions and 43 deletions.
92 changes: 74 additions & 18 deletions cvat-ui/src/actions/grades-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,55 @@ export const loadingGradesAsync =
front_distance: mapGradeValue(result?.laser_front_scan?.angles?.distance),
front_top_bot_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.top_bot_angle_diff),
front_left_right_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.left_right_angle_diff),
front_top_outer_top_inner_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.top_outer_top_inner_angle_diff),
front_bot_outer_bot_inner_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.bot_outer_bot_inner_angle_diff),
front_left_outer_left_inner_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.left_outer_left_inner_angle_diff),
front_right_outer_right_inner_angle_diff: mapGradeValue(result?.laser_front_scan?.angles?.right_outer_right_inner_angle_diff),
front_vertical_distance_diff: mapGradeValue(result?.laser_front_scan?.angles?.vertical_distance_diff),
front_horizontal_distance_diff: mapGradeValue(result?.laser_front_scan?.angles?.horizontal_distance_diff),
front_top_outer_top_inner_angle_diff: mapGradeValue(
result?.laser_front_scan?.angles?.top_outer_top_inner_angle_diff,
),
front_bot_outer_bot_inner_angle_diff: mapGradeValue(
result?.laser_front_scan?.angles?.bot_outer_bot_inner_angle_diff,
),
front_left_outer_left_inner_angle_diff: mapGradeValue(
result?.laser_front_scan?.angles?.left_outer_left_inner_angle_diff,
),
front_right_outer_right_inner_angle_diff: mapGradeValue(
result?.laser_front_scan?.angles?.right_outer_right_inner_angle_diff,
),
front_vertical_distance_diff: mapGradeValue(
result?.laser_front_scan?.angles?.vertical_distance_diff,
),
front_horizontal_distance_diff: mapGradeValue(
result?.laser_front_scan?.angles?.horizontal_distance_diff,
),
back_opposite_angle: mapGradeValue(result?.laser_back_scan?.angles?.opposite_angle),
back_inner_outer_angle: mapGradeValue(result?.laser_back_scan?.angles?.inner_outer_angle),
back_distance: mapGradeValue(result?.laser_back_scan?.angles?.distance),
back_top_bot_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.top_bot_angle_diff),
back_left_right_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.left_right_angle_diff),
back_top_outer_top_inner_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.top_outer_top_inner_angle_diff),
back_bot_outer_bot_inner_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.bot_outer_bot_inner_angle_diff),
back_left_outer_left_inner_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.left_outer_left_inner_angle_diff),
back_right_outer_right_inner_angle_diff: mapGradeValue(result?.laser_back_scan?.angles?.right_outer_right_inner_angle_diff),
back_top_outer_top_inner_angle_diff: mapGradeValue(
result?.laser_back_scan?.angles?.top_outer_top_inner_angle_diff,
),
back_bot_outer_bot_inner_angle_diff: mapGradeValue(
result?.laser_back_scan?.angles?.bot_outer_bot_inner_angle_diff,
),
back_left_outer_left_inner_angle_diff: mapGradeValue(
result?.laser_back_scan?.angles?.left_outer_left_inner_angle_diff,
),
back_right_outer_right_inner_angle_diff: mapGradeValue(
result?.laser_back_scan?.angles?.right_outer_right_inner_angle_diff,
),
back_vertical_distance_diff: mapGradeValue(result?.laser_back_scan?.angles?.vertical_distance_diff),
back_horizontal_distance_diff: mapGradeValue(result?.laser_back_scan?.angles?.horizontal_distance_diff),
back_horizontal_distance_diff: mapGradeValue(
result?.laser_back_scan?.angles?.horizontal_distance_diff,
),
front_boosted_centering_laser_grade: mapGradeValue(
result?.laser_front_scan?.boosted_grades?.center,
),
front_boosted_corners_laser_grade: mapGradeValue(result?.laser_front_scan?.boosted_grades?.corner),
front_boosted_edges_laser_grade: mapGradeValue(result?.laser_front_scan?.boosted_grades?.edge),
front_boosted_surface_laser_grade: mapGradeValue(result?.laser_front_scan?.boosted_grades?.surface),
back_boosted_centering_laser_grade: mapGradeValue(result?.laser_back_scan?.boosted_grades?.center),
back_boosted_corners_laser_grade: mapGradeValue(result?.laser_back_scan?.boosted_grades?.corner),
back_boosted_edges_laser_grade: mapGradeValue(result?.laser_back_scan?.boosted_grades?.edge),
back_boosted_surface_laser_grade: mapGradeValue(result?.laser_back_scan?.boosted_grades?.surface),
}),
);
} catch (error) {
Expand Down Expand Up @@ -284,13 +316,37 @@ export const submitAnnotationFrameToGradeAsync =
[`${input.orientation}_inner_outer_angle`]: mapGradeValue(data?.angles?.inner_outer_angle),
[`${input.orientation}_distance`]: mapGradeValue(data?.angles?.distance),
[`${input.orientation}_top_bot_angle_diff`]: mapGradeValue(data?.angles?.top_bot_angle_diff),
[`${input.orientation}_left_right_angle_diff`]: mapGradeValue(data?.angles?.left_right_angle_diff),
[`${input.orientation}_top_outer_top_inner_angle_diff`]: mapGradeValue(data?.angles?.top_outer_top_inner_angle_diff),
[`${input.orientation}_bot_outer_bot_inner_angle_diff`]: mapGradeValue(data?.angles?.bot_outer_bot_inner_angle_diff),
[`${input.orientation}_left_outer_left_inner_angle_diff`]: mapGradeValue(data?.angles?.left_outer_left_inner_angle_diff),
[`${input.orientation}_right_outer_right_inner_angle_diff`]: mapGradeValue(data?.angles?.right_outer_right_inner_angle_diff),
[`${input.orientation}_vertical_distance_diff`]: mapGradeValue(data?.angles?.vertical_distance_diff),
[`${input.orientation}_horizontal_distance_diff`]: mapGradeValue(data?.angles?.horizontal_distance_diff),
[`${input.orientation}_left_right_angle_diff`]: mapGradeValue(
data?.angles?.left_right_angle_diff,
),
[`${input.orientation}_top_outer_top_inner_angle_diff`]: mapGradeValue(
data?.angles?.top_outer_top_inner_angle_diff,
),
[`${input.orientation}_bot_outer_bot_inner_angle_diff`]: mapGradeValue(
data?.angles?.bot_outer_bot_inner_angle_diff,
),
[`${input.orientation}_left_outer_left_inner_angle_diff`]: mapGradeValue(
data?.angles?.left_outer_left_inner_angle_diff,
),
[`${input.orientation}_right_outer_right_inner_angle_diff`]: mapGradeValue(
data?.angles?.right_outer_right_inner_angle_diff,
),
[`${input.orientation}_vertical_distance_diff`]: mapGradeValue(
data?.angles?.vertical_distance_diff,
),
[`${input.orientation}_horizontal_distance_diff`]: mapGradeValue(
data?.angles?.horizontal_distance_diff,
),
[`${input.orientation}_boosted_centering_laser_grade`]: mapGradeValue(
data?.boosted_grades?.center,
),
[`${input.orientation}_boosted_corners_laser_grade`]: mapGradeValue(
data?.boosted_grades?.corner,
),
[`${input.orientation}_boosted_edges_laser_grade`]: mapGradeValue(data?.boosted_grades?.edge),
[`${input.orientation}_boosted_surface_laser_grade`]: mapGradeValue(
data?.boosted_grades?.surface,
),
}),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,29 @@ interface Props {
onGenerateRawRobogrades(): void;
enhancedRobogradesVisibility: boolean;
robogradesVisibility: boolean;
boostedRobogradesVisibility: boolean;
rawRobogradesVisibility: boolean;
centeringAnglesVisibility: boolean;
handleEnhancedRobogradesVisibility(): void;
handleRobogradesVisibility(): void;
handleRawRobogradesVisibility(): void;
handleCenteringAnglesVisibility(): void;
handleBoostedRobogradesVisibility(): void;
}

function GradesFormAdvancedControls({
onGenerateRobogradesAndMasks,
onGenerateRawRobogrades,
enhancedRobogradesVisibility,
robogradesVisibility,
boostedRobogradesVisibility,
rawRobogradesVisibility,
centeringAnglesVisibility,
handleEnhancedRobogradesVisibility,
handleRobogradesVisibility,
handleRawRobogradesVisibility,
handleCenteringAnglesVisibility,
handleBoostedRobogradesVisibility,
}: Props): JSX.Element {
const [isExpanded, setIsExpanded] = useState(false);

Expand Down Expand Up @@ -70,6 +74,10 @@ function GradesFormAdvancedControls({
<Switch checked={centeringAnglesVisibility} onChange={handleCenteringAnglesVisibility} />
<Typography.Text>&nbsp;Centering Angles</Typography.Text>
</div>
<div className='grades-form-info-typography'>
<Switch checked={boostedRobogradesVisibility} onChange={handleBoostedRobogradesVisibility} />
<Typography.Text>&nbsp;Boosted Robogrades</Typography.Text>
</div>
</Space>
)}
</>
Expand Down
Loading

0 comments on commit c83f40f

Please sign in to comment.