Skip to content

Commit cd395c9

Browse files
Add custom decoders dict
1 parent 4449c43 commit cd395c9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/tesseract_sinter_compat.pybind.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,4 +316,17 @@ void pybind_sinter_compat(py::module& root) {
316316
config.create_visualization = t[10].cast<bool>();
317317
return TesseractSinterDecoder(config);
318318
}));
319+
320+
// Add a function to create a dictionary of custom decoders
321+
m.def(
322+
"make_tesseract_sinter_decoders_dict",
323+
[]() -> py::object {
324+
auto result = py::dict();
325+
result["tesseract"] = TesseractSinterDecoder{};
326+
return result;
327+
},
328+
R"pbdoc(
329+
Returns a dictionary mapping decoder names to sinter.Decoder-style objects.
330+
This allows Sinter to easily discover and use Tesseract as a custom decoder.
331+
)pbdoc");
319332
}

0 commit comments

Comments
 (0)