#!/bin/bash # Lab: dump RAW sherpa diarization turns for a recording, at maximum temporal # granularity (min-duration-off=0 -> no adjacent-same-label merging, small # cluster threshold -> fine labels). We only reuse the TURN BOUNDARIES; the # labels get thrown away and re-clustered offline by cluster-lab.js. # Usage: lab-dump-segs.sh [cluster-threshold] DIR=/opt/sherpa/sherpa-onnx-v1.13.3-linux-aarch64-shared-cpu BIN=$DIR/bin/sherpa-onnx-offline-speaker-diarization SEG=/opt/sherpa/sherpa-onnx-pyannote-segmentation-3-0/model.onnx EMB=${EMB:-/opt/sherpa/nemo_titanet_small.onnx} WAV="$1"; OUT="$2"; THR="${3:-0.2}" /opt/callrec/aime-cpucap.sh 1608000 export LD_LIBRARY_PATH=$DIR/lib echo "start $(date -Is)" > "$OUT.log" taskset -c 4-7 "$BIN" \ --segmentation.pyannote-model=$SEG --segmentation.num-threads=4 \ --embedding.model=$EMB --embedding.num-threads=4 \ --clustering.cluster-threshold=$THR \ --min-duration-on=0.2 --min-duration-off=0.0 \ "$WAV" > "$OUT" 2>> "$OUT.log" echo "end $(date -Is) rc=$?" >> "$OUT.log" /opt/callrec/aime-cpucap.sh 2256000 grep -c 'speaker_' "$OUT" >> "$OUT.log"