-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
931fee1
commit 06723cd
Showing
6 changed files
with
164 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ackages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/EvaluationIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import _, { capitalize } from "lodash"; | ||
|
||
import { IconButton } from "@mui/material"; | ||
import React from "react"; | ||
|
||
import CallSplitOutlinedIcon from "@mui/icons-material/CallSplitOutlined"; | ||
import CrisisAlertOutlinedIcon from "@mui/icons-material/CrisisAlertOutlined"; | ||
import Layers from "@mui/icons-material/Layers"; | ||
import PieChartOutlinedIcon from "@mui/icons-material/PieChartOutlined"; | ||
import ShowChartOutlinedIcon from "@mui/icons-material/ShowChartOutlined"; | ||
|
||
import TooltipProvider from "../TooltipProvider"; | ||
import { ConcreteEvaluationType } from "./Types"; | ||
|
||
interface Props { | ||
type: ConcreteEvaluationType; | ||
method?: string; | ||
} | ||
|
||
export default function EvaluationIcon(props: Props) { | ||
const { type, method } = props; | ||
|
||
let evalIcon = <Layers />; | ||
if (type === "classification" && method === "binary") { | ||
evalIcon = <CallSplitOutlinedIcon />; | ||
} else if (type === "classification" && method !== "binary") { | ||
evalIcon = <Layers />; | ||
} else if (type === "detection") { | ||
evalIcon = <CrisisAlertOutlinedIcon />; | ||
} else if (type === "segmentation") { | ||
evalIcon = <PieChartOutlinedIcon />; | ||
} else if (type === "regression") { | ||
evalIcon = <ShowChartOutlinedIcon />; | ||
} | ||
|
||
return ( | ||
<TooltipProvider | ||
title={ | ||
<span style={{ fontSize: "1rem", fontWeight: "normal" }}> | ||
Evaluation type: {capitalize(type)} | ||
</span> | ||
} | ||
arrow | ||
placement="bottom" | ||
> | ||
<IconButton | ||
size="small" | ||
sx={{ | ||
color: "#FFC48B", | ||
"&:hover": { | ||
backgroundColor: "transparent", | ||
}, | ||
}} | ||
> | ||
{evalIcon} | ||
</IconButton> | ||
</TooltipProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Types.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export type OverviewProps = { | ||
evaluations: EvaluationType[]; | ||
onSelect: (key: string, id: string) => void; | ||
onEvaluate: () => void; | ||
statuses?: Record<string, string>; | ||
notes?: Record<string, string>; | ||
permissions?: Record<string, boolean>; | ||
pending_evaluations: PendingEvaluationType[]; | ||
}; | ||
|
||
export type EvaluationType = { | ||
key: string; | ||
id: string; | ||
type: string; | ||
description: string; | ||
status: string; | ||
method?: string; | ||
}; | ||
|
||
export type PendingEvaluationType = { | ||
eval_key: string; | ||
type: string; | ||
doc_id?: string; | ||
method?: string; | ||
}; | ||
|
||
export type EvaluationCardProps = { | ||
eval_key: string; | ||
type: string; | ||
method?: string; | ||
id?: string; | ||
note?: string; | ||
onSelect: OverviewProps["onSelect"]; | ||
pending?: boolean; | ||
status?: string; | ||
}; | ||
|
||
export type ConcreteEvaluationType = | ||
| "classification" | ||
| "detection" | ||
| "segmentation" | ||
| "regression"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters