mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-16 10:06:42 +03:00
Cleanup classification
This commit is contained in:
parent
10e9080093
commit
7e738c6538
@ -632,36 +632,36 @@ function DatasetGrid({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={contentRef}
|
ref={contentRef}
|
||||||
className="scrollbar-container flex flex-wrap gap-2 overflow-y-auto p-2"
|
className="scrollbar-container grid grid-cols-2 gap-2 overflow-y-scroll p-1 md:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-10 3xl:grid-cols-12"
|
||||||
>
|
>
|
||||||
{classData.map((image) => (
|
{classData.map((image) => (
|
||||||
<ClassificationCard
|
<div key={image} className="aspect-square w-full">
|
||||||
key={image}
|
<ClassificationCard
|
||||||
imgClassName="size-auto"
|
data={{
|
||||||
data={{
|
filename: image,
|
||||||
filename: image,
|
filepath: `clips/${modelName}/dataset/${categoryName}/${image}`,
|
||||||
filepath: `clips/${modelName}/dataset/${categoryName}/${image}`,
|
name: "",
|
||||||
name: "",
|
}}
|
||||||
}}
|
selected={selectedImages.includes(image)}
|
||||||
selected={selectedImages.includes(image)}
|
i18nLibrary="views/classificationModel"
|
||||||
i18nLibrary="views/classificationModel"
|
onClick={(data, _) => onClickImages([data.filename], true)}
|
||||||
onClick={(data, _) => onClickImages([data.filename], true)}
|
>
|
||||||
>
|
<Tooltip>
|
||||||
<Tooltip>
|
<TooltipTrigger>
|
||||||
<TooltipTrigger>
|
<LuTrash2
|
||||||
<LuTrash2
|
className="size-5 cursor-pointer text-primary-variant hover:text-danger"
|
||||||
className="size-5 cursor-pointer text-primary-variant hover:text-danger"
|
onClick={(e) => {
|
||||||
onClick={(e) => {
|
e.stopPropagation();
|
||||||
e.stopPropagation();
|
onDelete([image]);
|
||||||
onDelete([image]);
|
}}
|
||||||
}}
|
/>
|
||||||
/>
|
</TooltipTrigger>
|
||||||
</TooltipTrigger>
|
<TooltipContent>
|
||||||
<TooltipContent>
|
{t("button.deleteClassificationAttempts")}
|
||||||
{t("button.deleteClassificationAttempts")}
|
</TooltipContent>
|
||||||
</TooltipContent>
|
</Tooltip>
|
||||||
</Tooltip>
|
</ClassificationCard>
|
||||||
</ClassificationCard>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -791,30 +791,29 @@ function StateTrainGrid({
|
|||||||
<div
|
<div
|
||||||
ref={contentRef}
|
ref={contentRef}
|
||||||
className={cn(
|
className={cn(
|
||||||
"scrollbar-container flex flex-wrap gap-3 overflow-y-auto p-2",
|
"scrollbar-container grid grid-cols-2 gap-3 overflow-y-scroll p-1 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10 3xl:grid-cols-12",
|
||||||
isMobile && "justify-center",
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{trainData?.map((data) => (
|
{trainData?.map((data) => (
|
||||||
<ClassificationCard
|
<div key={data.filename} className="aspect-square w-full">
|
||||||
key={data.filename}
|
<ClassificationCard
|
||||||
imgClassName="size-auto"
|
data={data}
|
||||||
data={data}
|
threshold={threshold}
|
||||||
threshold={threshold}
|
selected={selectedImages.includes(data.filename)}
|
||||||
selected={selectedImages.includes(data.filename)}
|
i18nLibrary="views/classificationModel"
|
||||||
i18nLibrary="views/classificationModel"
|
showArea={false}
|
||||||
showArea={false}
|
onClick={(data, meta) => onClickImages([data.filename], meta)}
|
||||||
onClick={(data, meta) => onClickImages([data.filename], meta)}
|
|
||||||
>
|
|
||||||
<ClassificationSelectionDialog
|
|
||||||
classes={classes}
|
|
||||||
modelName={model.name}
|
|
||||||
image={data.filename}
|
|
||||||
onRefresh={onRefresh}
|
|
||||||
>
|
>
|
||||||
<TbCategoryPlus className="size-7 cursor-pointer p-1 text-gray-200 hover:rounded-full hover:bg-primary-foreground" />
|
<ClassificationSelectionDialog
|
||||||
</ClassificationSelectionDialog>
|
classes={classes}
|
||||||
</ClassificationCard>
|
modelName={model.name}
|
||||||
|
image={data.filename}
|
||||||
|
onRefresh={onRefresh}
|
||||||
|
>
|
||||||
|
<TbCategoryPlus className="size-7 cursor-pointer p-1 text-gray-200 hover:rounded-full hover:bg-primary-foreground" />
|
||||||
|
</ClassificationSelectionDialog>
|
||||||
|
</ClassificationCard>
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -934,12 +933,8 @@ function ObjectTrainGrid({
|
|||||||
{Object.entries(groups).map(([key, group]) => {
|
{Object.entries(groups).map(([key, group]) => {
|
||||||
const event = events?.find((ev) => ev.id == key);
|
const event = events?.find((ev) => ev.id == key);
|
||||||
return (
|
return (
|
||||||
<div
|
<div key={key} className="aspect-square w-full">
|
||||||
key={key}
|
|
||||||
className={cn(isMobile && "aspect-square size-full")}
|
|
||||||
>
|
|
||||||
<GroupedClassificationCard
|
<GroupedClassificationCard
|
||||||
key={key}
|
|
||||||
group={group}
|
group={group}
|
||||||
event={event}
|
event={event}
|
||||||
threshold={threshold}
|
threshold={threshold}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user