diff --git a/coco-80.txt b/coco-80.txt new file mode 100644 index 0000000..79fff17 --- /dev/null +++ b/coco-80.txt @@ -0,0 +1,91 @@ +0 person +1 bicycle +2 car +3 motorcycle +4 airplane +5 bus +6 train +7 car +8 boat +9 traffic light +10 fire hydrant +11 street sign +12 stop sign +13 parking meter +14 bench +15 bird +16 cat +17 dog +18 horse +19 sheep +20 cow +21 elephant +22 bear +23 zebra +24 giraffe +25 hat +26 backpack +27 umbrella +28 shoe +29 eye glasses +30 handbag +31 tie +32 suitcase +33 frisbee +34 skis +35 snowboard +36 sports ball +37 kite +38 baseball bat +39 baseball glove +40 skateboard +41 surfboard +42 tennis racket +43 bottle +44 plate +45 wine glass +46 cup +47 fork +48 knife +49 spoon +50 bowl +51 banana +52 apple +53 sandwich +54 orange +55 broccoli +56 carrot +57 hot dog +58 pizza +59 donut +60 cake +61 chair +62 couch +63 potted plant +64 bed +65 mirror +66 dining table +67 window +68 desk +69 toilet +70 door +71 tv +72 laptop +73 mouse +74 remote +75 keyboard +76 cell phone +77 microwave +78 oven +79 toaster +80 sink +81 refrigerator +82 blender +83 book +84 clock +85 vase +86 scissors +87 teddy bear +88 hair drier +89 toothbrush +90 hair brush \ No newline at end of file diff --git a/hosts/home/configuration.nix b/hosts/home/configuration.nix index 61ca7cd..a33fa18 100644 --- a/hosts/home/configuration.nix +++ b/hosts/home/configuration.nix @@ -5,7 +5,9 @@ nixpkgs, ... }: - +let + lib = pkgs.lib; +in { imports = [ ./hardware-configuration.nix @@ -63,6 +65,10 @@ networking.hostName = "arcueid"; # Define your hostname. networking.networkmanager.enable = true; + networking.firewall.allowedTCPPorts = [ + 80 + 5000 + ]; nix = { settings = { auto-optimise-store = true; @@ -142,6 +148,9 @@ systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; + + systemd.services.frigate.path = lib.mkBefore [ pkgs.ffmpeg-full ]; + services = { udev.packages = with pkgs; [ vial @@ -159,7 +168,9 @@ layout = "us"; variant = "altgr-intl"; }; - xserver.videoDrivers = [ "amdgpu" ]; + xserver.videoDrivers = [ + "amdgpu" + ]; blueman.enable = true; printing.enable = true; avahi = { @@ -174,21 +185,64 @@ pulse.enable = true; }; + ollama = { + enable = true; + host = "0.0.0.0"; + openFirewall = true; + package = pkgs.ollama-rocm; + syncModels = true; + loadModels = [ + "gemma3:4b" + "mistral" + ]; + }; + frigate = { enable = true; hostname = "arcueid.int.m0rel.eu"; + vaapiDriver = "radeonsi"; settings = { + genai = { + provider = "ollama"; + base_url = "http://localhost:11434"; + model = "gemma3:4b"; + }; mqtt = { enabled = true; host = "mqtt.int.m0rel.eu"; user = "frigate"; password = "pouet"; }; - ffmpeg.hwaccel_args = "preset-vaapi"; + ffmpeg = { + hwaccel_args = "preset-vaapi"; + input_args = "preset-rtsp-restream-low-latency"; + path = pkgs.ffmpeg-full; + }; + # ui.live_mode = "webrtc"; auth.enabled = false; proxy.default_role = "admin"; + # detectors = { + # ov_0 = { + # type = "openvino"; + # device = "GPU"; + # }; + # ov_1 = { + # type = "openvino"; + # device = "NPU"; + # }; + # # onnx.type = "onnx"; + # }; + # model = { + # model_type = "yolo-generic"; + # width = 640; + # height = 640; + # input_tensor = "nchw"; + # input_dtype = "float"; + # path = ../../yolox_m.onnx; + # labelmap_path = ../../coco-80.txt; + # }; detect.enabled = true; - detect.fps = 5; + detect.fps = 2; objects.track = [ "person" "car" @@ -197,7 +251,7 @@ "dog" ]; audio = { - enabled = true; + enabled = false; max_not_heard = 10; min_volume = 500; listen = [ @@ -207,36 +261,26 @@ "speech" "yell" ]; - # filters.speech.threshold = 0.8; + filters.speech.threshold = 0.8; }; motion = { enabled = true; - # mask = [ - # "0.316" - # "0.037" - # "0.317" - # "0.012" - # "0.035" - # "0.01" - # "0.033" - # "0.035" - # ]; }; semantic_search.enabled = true; semantic_search.model_size = "small"; review.detections.enabled = true; record.enabled = true; - record.retain.days = 2; + # record.retain.days = 2; record.preview.quality = "medium"; face_recognition.enabled = true; face_recognition.model_size = "small"; lpr.enabled = true; - # audio_transcription = { - # enabled = true; - # device = "CPU"; - # model_size = "small"; - # language = "fr"; - # }; + audio_transcription = { + enabled = false; + device = "CPU"; + model_size = "small"; + language = "fr"; + }; classification = { bird.enabled = true; custom = { @@ -286,36 +330,17 @@ user = "admin"; password = "admin"; }; - # zones = { - # cour = { - # coordinates = [ - # "0.001" - # "0.492" - # "0.001" - # "0.043" - # "0.893" - # "0.054" - # "0.888" - # "0.5" - # ]; - # loitering_time = 0; - # friendly_name = "Cour"; - # }; - # entree = { - # coordinates = [ - # "0.001" - # "0.5" - # "0.001" - # "0.997" - # "0.996" - # "0.991" - # "0.997" - # "0.513" - # ]; - # loitering_time = 0; - # friendly_name = "Entrée"; - # }; - # }; + motion.mask = [ + "0.316,0.037,0.317,0.012,0.035,0.01,0.033,0.035" + ]; + zones = { + cour = { + coordinates = "0.001,0.492,0.001,0.043,0.893,0.054,0.888,0.5"; + }; + entree = { + coordinates = "0.001,0.5,0.001,0.997,0.996,0.991,0.997,0.513"; + }; + }; }; }; }; diff --git a/yolox_m.onnx b/yolox_m.onnx new file mode 100644 index 0000000..f9e1c5f Binary files /dev/null and b/yolox_m.onnx differ