diff --git a/servers/unraid/tail2-pose-server/app/tail2/main.py b/servers/unraid/tail2-pose-server/app/tail2/main.py index 5e6ff61..e537c75 100644 --- a/servers/unraid/tail2-pose-server/app/tail2/main.py +++ b/servers/unraid/tail2-pose-server/app/tail2/main.py @@ -115,7 +115,7 @@ def capabilities(): "checkpoint": models.det_checkpoint, "checkpoint_sha256": models.sha256(models.det_checkpoint), "person_class_id": 0, "score_threshold": float(os.getenv("DETECTION_THRESHOLD", ".35")), "nms_iou_threshold": float(os.getenv("NMS_IOU_THRESHOLD", ".60"))}, - "pose": {"name": "rtmw-l-256x192", "framework": "mmpose", "keypoint_schema": "coco_wholebody_133", + "pose": {"name": os.getenv("POSE_NAME", "rtmw-l-256x192"), "framework": "mmpose", "keypoint_schema": "coco_wholebody_133", "keypoint_order": "MMPose COCO WholeBody 133 official order", "body_schema": "coco17", "body17_names": BODY17, "config": models.pose_config, "checkpoint": models.pose_checkpoint, "checkpoint_sha256": models.sha256(models.pose_checkpoint)}, diff --git a/servers/unraid/tail2-pose-server/app/tail2/offline_benchmark.py b/servers/unraid/tail2-pose-server/app/tail2/offline_benchmark.py index 0684f5d..5d79743 100644 --- a/servers/unraid/tail2-pose-server/app/tail2/offline_benchmark.py +++ b/servers/unraid/tail2-pose-server/app/tail2/offline_benchmark.py @@ -18,7 +18,7 @@ def percentile(values: list[float], p: float) -> float: def run_offline_benchmark(models, threshold: float, max_people: int) -> None: - path = "/logs/offline-benchmark-" + os.getenv("DETECTOR_NAME", "unknown") + ".json" + path = "/logs/offline-benchmark-" + os.getenv("BENCHMARK_PROFILE", "unknown") + ".json" if os.path.exists(path): return try: diff --git a/servers/unraid/tail2-pose-server/app/tail2/soak.py b/servers/unraid/tail2-pose-server/app/tail2/soak.py index 6564954..8abc450 100644 --- a/servers/unraid/tail2-pose-server/app/tail2/soak.py +++ b/servers/unraid/tail2-pose-server/app/tail2/soak.py @@ -38,4 +38,4 @@ report = {"duration_seconds": round(time.time()-started, 3), "messages": len(fra "max_gpu_memory_used_mb": max((x["gpu"]["memory_used_mb"] for x in health_samples), default=None), "max_gpu_temperature_c": max((x["gpu"]["temperature_c"] for x in health_samples), default=None), "frames_or_crops_saved": False} -pathlib.Path(f"/validation/soak-{os.getenv('DETECTOR_NAME', 'unknown')}-10m.json").write_text(json.dumps(report, indent=2)) +pathlib.Path(f"/validation/soak-{os.getenv('BENCHMARK_PROFILE', 'unknown')}-10m.json").write_text(json.dumps(report, indent=2)) diff --git a/servers/unraid/tail2-pose-server/compose.yaml b/servers/unraid/tail2-pose-server/compose.yaml index 758e4e2..1adcdda 100644 --- a/servers/unraid/tail2-pose-server/compose.yaml +++ b/servers/unraid/tail2-pose-server/compose.yaml @@ -47,6 +47,7 @@ services: fetch https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_m_8xb32-300e_coco/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth /models/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth fetch https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_tiny_8xb32-300e_coco/rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth /models/rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth fetch https://download.openmmlab.com/mmpose/v1/projects/rtmw/rtmw-dw-x-l_simcc-cocktail14_270e-256x192-20231122.pth /models/rtmw-dw-x-l_simcc-cocktail14_270e-256x192-20231122.pth + fetch https://download.openmmlab.com/mmpose/v1/projects/rtmw/rtmw-dw-l-m_simcc-cocktail14_270e-256x192-20231122.pth /models/rtmw-dw-l-m_simcc-cocktail14_270e-256x192-20231122.pth sha256sum /models/*.pth > /models/SHA256SUMS chmod -R a-w /models @@ -83,6 +84,7 @@ services: NDI_SOURCE_NAME: TAIL 2_1621D2 (OBSBOT) NDI_SOURCE_IP: 192.168.50.207 MODEL_PROFILE: balanced + BENCHMARK_PROFILE: rtmdet-tiny_rtmw-m MAX_PEOPLE: "4" DETECTION_THRESHOLD: "0.35" NMS_IOU_THRESHOLD: "0.60" @@ -95,8 +97,9 @@ services: DETECTOR_NAME: rtmdet-tiny-person DET_CONFIG: /models/mmdetection/configs/rtmdet/rtmdet_tiny_8xb32-300e_coco.py DET_CHECKPOINT: /models/rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth - POSE_CONFIG: /models/mmpose/configs/wholebody_2d_keypoint/rtmpose/cocktail14/rtmw-l_8xb1024-270e_cocktail14-256x192.py - POSE_CHECKPOINT: /models/rtmw-dw-x-l_simcc-cocktail14_270e-256x192-20231122.pth + POSE_NAME: rtmw-m-256x192 + POSE_CONFIG: /models/mmpose/configs/wholebody_2d_keypoint/rtmpose/cocktail14/rtmw-m_8xb1024-270e_cocktail14-256x192.py + POSE_CHECKPOINT: /models/rtmw-dw-l-m_simcc-cocktail14_270e-256x192-20231122.pth healthcheck: test: ["CMD", "python", "-c", "import json,pathlib,urllib.request; t=pathlib.Path('/run/secrets/api-token').read_text().strip(); r=urllib.request.Request('http://127.0.0.1:18120/v1/health',headers={'Authorization':'Bearer '+t}); raise SystemExit(0 if json.load(urllib.request.urlopen(r,timeout=3))['ready'] else 1)"] interval: 15s @@ -112,6 +115,7 @@ services: restart: "no" environment: DETECTOR_NAME: rtmdet-tiny-person + BENCHMARK_PROFILE: rtmdet-tiny_rtmw-m entrypoint: ["/bin/bash", "-lc"] depends_on: tail2-pose-server: @@ -132,7 +136,7 @@ services: find / -xdev -type f -name 'libndi.so*' -print > /validation/ndi-runtime-files.txt 2>/dev/null || true nvidia-smi --query-gpu=name,driver_version,memory.total,memory.used,temperature.gpu --format=csv,noheader > /validation/gpu.csv sha256sum /models/*.pth > /validation/model-sha256.txt - cp /logs/offline-benchmark-$${DETECTOR_NAME:-unknown}.json /validation/offline-benchmark.json + cp /logs/offline-benchmark-$${BENCHMARK_PROFILE:-unknown}.json /validation/offline-benchmark.json chmod 0666 /validation/*.txt /validation/*.json /validation/*.csv soak: @@ -142,6 +146,7 @@ services: restart: "no" environment: DETECTOR_NAME: rtmdet-tiny-person + BENCHMARK_PROFILE: rtmdet-tiny_rtmw-m entrypoint: ["/bin/bash", "-lc"] depends_on: tail2-pose-server: @@ -154,5 +159,5 @@ services: - | set -euo pipefail chmod -R a+rwX /validation - test -s /validation/soak-$${DETECTOR_NAME}-10m.json || python /app/tail2/soak.py - chmod 0666 /validation/soak-$${DETECTOR_NAME}-10m.json + test -s /validation/soak-$${BENCHMARK_PROFILE}-10m.json || python /app/tail2/soak.py + chmod 0666 /validation/soak-$${BENCHMARK_PROFILE}-10m.json