# 手术室耗材主流程 — 统一配置(相对本包根目录 pack/5.11/) # 修改路径与阈值后运行: python main.py io: # 输入输出(支持绝对路径或相对 pack 根目录) video: input/sample.mp4 excel: input/视频中的商品信息表.xlsx out: output/result.txt # null:不从 JSON 读白名单,改为从 excel 第 1 张表 C 列(商品名称)构建 whitelist_json: null weights: actionformer: weights/actionformer_epoch_045.pth.tar hand: weights/hand_detect.pt goodbad: weights/goodbad_frame.pt haocai: weights/haocai_classify.pt tear: weights/tear_classify.pt runtime: # 中间结果目录;null 表示使用系统临时目录(运行结束删除) work_dir: null keep_work_dir: false # null 表示子进程使用当前 Python 解释器(sys.executable) python: null device: type: cuda half: false phase1: af_min_score: 0.1 af_min_seg_seconds: 2 feat_batch_size: 1 phase2: seek_margin_sec: 3.0 frame_stride: 1 det_conf: 0.6 pad_ratio: 0.20 imgsz_det: 640 merge_iou_gt: 0.0 merge_center_dist_max_px: null merge_center_dist_max_frac_diag: null classification: imgsz_cls: 224 good_top1_conf_threshold: 0.9 good_top1_retry_threshold: 0.5 haocai_min_conf: 0.8 # <=0 关闭第二次耗材阈值重试 haocai_min_conf_retry: 0.5 empty_cache_every: 0 tear_merge: merge_adjacent_tear: true tear_merge_weights: null tear_merge_class: tearing tear_merge_head_sec: 3.0 tear_merge_prob: 0.9 tear_merge_min_frames: 6 tear_merge_verbose: false tear_merge_full_frame: false output: # true:不输出 tear_top1_name / tear_top2_name(仅 12 列,默认) legacy_12_col_only: true doctor_identity: enabled: true checkpoint: doctor_identity_package/doctor_info.pth labels_csv: doctor_identity_package/labels.csv # MediaPipe Pose 相关阈值(人体检测置信度) pose_min_detection_confidence: 0.30 # 医生身份结果最低置信度;低于该值时在文本中标注“低置信度” min_identity_confidence: 0.00 # 中间窗口与采样参数 middle_seconds: 10.0 sample_fps: 3.0 pad_frac: 0.15