diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-10-21 17:47:57 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-10-21 17:47:57 +0200 |
| commit | 8b8acffcf5f1e9e9ddb552b8ac125e50f68987ac (patch) | |
| tree | 9b618133a468585087ff4b014b22029d40b24bc5 /convert.py | |
| parent | 2ce585cc96a3fffba65f1bafbfbc796c6370308f (diff) | |
| download | facedet-master.tar.gz facedet-master.zip | |
Diffstat (limited to '')
| -rw-r--r-- | convert.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -153,7 +153,7 @@ def main(): onnx.checker.check_model(model) heads = head_map(nodes) plan, weights, shapes, offsets, arena = compile_plan(nodes, init, heads) - lines = ["#ifndef YUNET_MODEL_DATA_H", "#define YUNET_MODEL_DATA_H", "", + lines = ["#ifndef FACEDET_MODEL_DATA_H", "#define FACEDET_MODEL_DATA_H", "", "static const float model_weight_data[] = {"] weight_offsets = [] pos = 0 @@ -166,14 +166,14 @@ def main(): pos += len(flat) lines += ["};", "", "static const float *const model_weights[] = {"] lines += [f" model_weight_data + {off}," for off in weight_offsets] - lines += ["};", "", "static const yunet_op model_ops[] = {"] + lines += ["};", "", "static const facedet_op model_ops[] = {"] for p in plan: fields = [p["op"], p.get("group", 0), p.get("k", 0), p.get("s", 0), p.get("pad", 0), p.get("relu", 0), p.get("widx", 0), *p["in_shape"], *p["out_shape"], p["in_off"][0], p["in_off"][1] if len(p["in_off"]) > 1 else 0, p["out_off"]] lines.append(" {" + ", ".join(map(str, fields)) + "},") - lines += ["};", "", "static const yunet_map_info model_maps[] = {"] + lines += ["};", "", "static const facedet_map_info model_maps[] = {"] for name, (tensor, sigmoid) in heads.items(): c, h, w = shapes[tensor] lines.append(f' {{"{name}", {offsets[tensor]}, {c}, {h}, {w}, {int(sigmoid)}}},') |
