mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 05:27:44 +03:00
Sort by event id
This commit is contained in:
parent
b6a51485de
commit
c3adca6bfd
@ -410,23 +410,25 @@ function TrainingGrid({
|
|||||||
const faceGroups = useMemo(() => {
|
const faceGroups = useMemo(() => {
|
||||||
const groups: { [eventId: string]: RecognizedFaceData[] } = {};
|
const groups: { [eventId: string]: RecognizedFaceData[] } = {};
|
||||||
|
|
||||||
Array.from(new Set(attemptImages))
|
const faces = attemptImages.map((image) => {
|
||||||
.sort()
|
|
||||||
.reverse()
|
|
||||||
.forEach((image) => {
|
|
||||||
const parts = image.split("-");
|
const parts = image.split("-");
|
||||||
const data = {
|
return {
|
||||||
filename: image,
|
filename: image,
|
||||||
timestamp: Number.parseFloat(parts[0]),
|
timestamp: Number.parseFloat(parts[0]),
|
||||||
eventId: `${parts[0]}-${parts[1]}`,
|
eventId: `${parts[0]}-${parts[1]}`,
|
||||||
name: parts[2],
|
name: parts[2],
|
||||||
score: Number.parseFloat(parts[3]),
|
score: Number.parseFloat(parts[3]),
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
if (groups[data.eventId]) {
|
faces
|
||||||
groups[data.eventId].push(data);
|
.sort((a, b) => a.eventId.localeCompare(b.eventId))
|
||||||
|
.reverse()
|
||||||
|
.forEach((face) => {
|
||||||
|
if (groups[face.eventId]) {
|
||||||
|
groups[face.eventId].push(face);
|
||||||
} else {
|
} else {
|
||||||
groups[data.eventId] = [data];
|
groups[face.eventId] = [face];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user