Quick fixes (#16668)

* Write thumbnails to disk on shutdown

* Update text on face library page
This commit is contained in:
Nicolas Mowen 2025-02-18 09:13:28 -07:00 committed by GitHub
parent b6db97d313
commit 81b873dead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View File

@ -412,6 +412,11 @@ class CameraState:
self.previous_frame_id = frame_name
def shutdown(self) -> None:
for obj in self.tracked_objects.values():
if not obj.obj_data.get("end_time"):
obj.write_thumbnail_to_disk()
class TrackedObjectProcessor(threading.Thread):
def __init__(
@ -722,6 +727,10 @@ class TrackedObjectProcessor(threading.Thread):
event_id, camera, _ = update
self.camera_states[camera].finished(event_id)
# shut down camera states
for state in self.camera_states.values():
state.shutdown()
self.requestor.stop()
self.detection_publisher.stop()
self.event_sender.stop()

View File

@ -327,7 +327,7 @@ function FaceAttempt({
.post(`/faces/reprocess`, { training_file: image })
.then((resp) => {
if (resp.status == 200) {
toast.success(`Successfully trained face.`, {
toast.success(`Successfully updated face score.`, {
position: "top-center",
});
onRefresh();
@ -335,11 +335,14 @@ function FaceAttempt({
})
.catch((error) => {
if (error.response?.data?.message) {
toast.error(`Failed to train: ${error.response.data.message}`, {
position: "top-center",
});
toast.error(
`Failed to update score: ${error.response.data.message}`,
{
position: "top-center",
},
);
} else {
toast.error(`Failed to train: ${error.message}`, {
toast.error(`Failed to update score: ${error.message}`, {
position: "top-center",
});
}
@ -419,7 +422,7 @@ function FaceAttempt({
onClick={() => onReprocess()}
/>
</TooltipTrigger>
<TooltipContent>Delete Face Attempt</TooltipContent>
<TooltipContent>Reprocess Face</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger>