mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 06:50:58 +00:00
Compare commits
No commits in common. "a22e24f24b233c8dc702e55df8dfb386ea609c6f" and "93a3cf8fb99287dc2a7cd1e3d557daeaed43ed45" have entirely different histories.
a22e24f24b
...
93a3cf8fb9
@ -55,7 +55,7 @@ from frigate.util.process import FrigateProcess
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def stop_ffmpeg(ffmpeg_process: sp.Popen[Any], logger: logging.Logger):
|
||||
def stop_ffmpeg(ffmpeg_process, logger):
|
||||
logger.info("Terminating the existing ffmpeg process...")
|
||||
ffmpeg_process.terminate()
|
||||
try:
|
||||
@ -441,7 +441,7 @@ class CameraCapture(FrigateProcess):
|
||||
def __init__(
|
||||
self, config: CameraConfig, shm_frame_count: int, camera_metrics: CameraMetrics
|
||||
) -> None:
|
||||
super().__init__(name=f"frigate.capture:{config.name}", daemon=True)
|
||||
super().__init__(name=f"camera_capture:{config.name}", daemon=True)
|
||||
self.config = config
|
||||
self.shm_frame_count = shm_frame_count
|
||||
self.camera_metrics = camera_metrics
|
||||
@ -473,7 +473,7 @@ class CameraTracker(FrigateProcess):
|
||||
ptz_metrics: PTZMetrics,
|
||||
region_grid: list[list[dict[str, Any]]],
|
||||
) -> None:
|
||||
super().__init__(name=f"frigate.process:{config.name}", daemon=True)
|
||||
super().__init__(name=f"camera_processor:{config.name}", daemon=True)
|
||||
self.config = config
|
||||
self.model_config = model_config
|
||||
self.labelmap = labelmap
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import { baseUrl } from "@/api/baseUrl";
|
||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
@ -38,60 +37,27 @@ export default function ModelSelectionView({
|
||||
return (
|
||||
<div className="flex size-full gap-2 p-2">
|
||||
{classificationConfigs.map((config) => (
|
||||
<ModelCard config={config} onClick={() => onClick(config)} />
|
||||
<div
|
||||
key={config.name}
|
||||
className={cn(
|
||||
"flex h-52 cursor-pointer flex-col gap-2 rounded-lg bg-card p-2 outline outline-[3px]",
|
||||
"outline-transparent duration-500",
|
||||
isMobile && "w-full",
|
||||
)}
|
||||
onClick={() => onClick(config)}
|
||||
onContextMenu={() => {
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
// handleClickEvent(true);
|
||||
}}
|
||||
>
|
||||
<div className="size-48"></div>
|
||||
<div className="smart-capitalize">
|
||||
{config.name} ({config.state_config != null ? "State" : "Object"}{" "}
|
||||
Classification)
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
type ModelCardProps = {
|
||||
config: CustomClassificationModelConfig;
|
||||
onClick: () => void;
|
||||
};
|
||||
function ModelCard({ config, onClick }: ModelCardProps) {
|
||||
const { data: dataset } = useSWR<{
|
||||
[id: string]: string[];
|
||||
}>(`classification/${config.name}/dataset`, { revalidateOnFocus: false });
|
||||
|
||||
const coverImages = useMemo(() => {
|
||||
if (!dataset) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const imageMap: { [key: string]: string } = {};
|
||||
|
||||
for (const [key, imageList] of Object.entries(dataset)) {
|
||||
if (imageList.length > 0) {
|
||||
imageMap[key] = imageList[0];
|
||||
}
|
||||
}
|
||||
|
||||
return imageMap;
|
||||
}, [dataset]);
|
||||
|
||||
return (
|
||||
<div
|
||||
key={config.name}
|
||||
className={cn(
|
||||
"flex h-60 cursor-pointer flex-col items-center gap-2 rounded-lg bg-card p-2 outline outline-[3px]",
|
||||
"outline-transparent duration-500",
|
||||
isMobile && "w-full",
|
||||
)}
|
||||
onClick={() => onClick()}
|
||||
>
|
||||
<div className="grid size-48 grid-cols-2 gap-2">
|
||||
{Object.entries(coverImages).map(([key, image]) => (
|
||||
<img
|
||||
key={key}
|
||||
className=""
|
||||
src={`${baseUrl}clips/${config.name}/dataset/${key}/${image}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<div className="smart-capitalize">
|
||||
{config.name} ({config.state_config != null ? "State" : "Object"}{" "}
|
||||
Classification)
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user