perf(unraid): fall back to official RTMDet-tiny
This commit is contained in:
@@ -111,7 +111,7 @@ def capabilities():
|
||||
"source_ip": os.environ["NDI_SOURCE_IP"], "nominal_width": config["nominal_width"],
|
||||
"nominal_height": config["nominal_height"], "coordinate_space": config["coordinate_space"],
|
||||
"horizontal_flip_applied": False, "rotation_deg": 0},
|
||||
"detector": {"name": "rtmdet-m-person", "framework": "mmdetection", "config": models.det_config,
|
||||
"detector": {"name": os.getenv("DETECTOR_NAME", "rtmdet-m-person"), "framework": "mmdetection", "config": models.det_config,
|
||||
"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"))},
|
||||
|
||||
@@ -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.json"
|
||||
path = "/logs/offline-benchmark-" + os.getenv("DETECTOR_NAME", "unknown") + ".json"
|
||||
if os.path.exists(path):
|
||||
return
|
||||
try:
|
||||
@@ -48,4 +48,3 @@ def run_offline_benchmark(models, threshold: float, max_people: int) -> None:
|
||||
with open(path, "w", encoding="utf-8") as fh:
|
||||
json.dump({"error": f"{type(exc).__name__}: {str(exc)[:240]}", "source_url": DEMO_URL,
|
||||
"image_retained": False}, fh, indent=2)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
import pathlib
|
||||
import os
|
||||
import statistics
|
||||
import time
|
||||
import urllib.request
|
||||
@@ -37,5 +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("/validation/soak-10m.json").write_text(json.dumps(report, indent=2))
|
||||
|
||||
pathlib.Path(f"/validation/soak-{os.getenv('DETECTOR_NAME', 'unknown')}-10m.json").write_text(json.dumps(report, indent=2))
|
||||
|
||||
@@ -45,6 +45,7 @@ services:
|
||||
test -d /models/mmdetection/configs || { mkdir -p /models/mmdetection && tar -xzf /models/mmdetection-v3.2.0.tar.gz --strip-components=1 -C /models/mmdetection; }
|
||||
test -d /models/mmpose/configs || { mkdir -p /models/mmpose && tar -xzf /models/mmpose-v1.3.2.tar.gz --strip-components=1 -C /models/mmpose; }
|
||||
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
|
||||
sha256sum /models/*.pth > /models/SHA256SUMS
|
||||
chmod -R a-w /models
|
||||
@@ -91,8 +92,9 @@ services:
|
||||
SAVE_CROPS: "false"
|
||||
LOG_COORDINATES: "false"
|
||||
CUDA_VISIBLE_DEVICES: "0"
|
||||
DET_CONFIG: /models/mmdetection/configs/rtmdet/rtmdet_m_8xb32-300e_coco.py
|
||||
DET_CHECKPOINT: /models/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth
|
||||
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
|
||||
healthcheck:
|
||||
@@ -108,6 +110,8 @@ services:
|
||||
network_mode: host
|
||||
gpus: all
|
||||
restart: "no"
|
||||
environment:
|
||||
DETECTOR_NAME: rtmdet-tiny-person
|
||||
entrypoint: ["/bin/bash", "-lc"]
|
||||
depends_on:
|
||||
tail2-pose-server:
|
||||
@@ -128,7 +132,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.json /validation/offline-benchmark.json
|
||||
cp /logs/offline-benchmark-$${DETECTOR_NAME:-unknown}.json /validation/offline-benchmark.json
|
||||
chmod 0666 /validation/*.txt /validation/*.json /validation/*.csv
|
||||
|
||||
soak:
|
||||
@@ -136,6 +140,8 @@ services:
|
||||
container_name: tail2-pose-soak
|
||||
network_mode: host
|
||||
restart: "no"
|
||||
environment:
|
||||
DETECTOR_NAME: rtmdet-tiny-person
|
||||
entrypoint: ["/bin/bash", "-lc"]
|
||||
depends_on:
|
||||
tail2-pose-server:
|
||||
@@ -148,5 +154,5 @@ services:
|
||||
- |
|
||||
set -euo pipefail
|
||||
chmod -R a+rwX /validation
|
||||
test -s /validation/soak-10m.json || python /app/tail2/soak.py
|
||||
chmod 0666 /validation/soak-10m.json
|
||||
test -s /validation/soak-$${DETECTOR_NAME}-10m.json || python /app/tail2/soak.py
|
||||
chmod 0666 /validation/soak-$${DETECTOR_NAME}-10m.json
|
||||
|
||||
Reference in New Issue
Block a user