Skip to content

Conversation

@JStehouwer
Copy link
Contributor

No description provided.

@JStehouwer
Copy link
Contributor Author

This adds docs(...) functionality to OpenBR transforms which are exposed via two endpoints.

Print out docs for a specific algorithm string:

$ br -algorithm "Read+Fork([Blur,Resize,Discard+Read])" -docs
Set algorithm to Read+Fork([Blur,Resize,Discard+Read])
Pipe(Transform transform): Project the output of each Transform into the next
    Read(Mode mode): Read the image from disk
    Fork(Transform[] transforms): Project the input template(s) through each transform and concatenate the results
        .BlurTransform->docs() not implemented
        .ResizeTransform->docs() not implemented
        Pipe(Transform transform): Project the output of each Transform into the next
            Discard(): Removes all matrices from a template.
            Read(Mode mode): Read the image from disk

Print out docs for all transforms (optional regex name matching):

$ br-docs --regex "Cvt"   
...
    .CvtTransform->docs() not implemented
    CvtFloat(): Convert the matrix to float32
    CvtUChar(): Convert the matrix to uint8

@JStehouwer JStehouwer requested a review from jklontz December 15, 2025 19:50
… transform init() function requires non-default arguments.
@JStehouwer
Copy link
Contributor Author

TODO - Resolve issues when generating docs for transforms when the init() function fails when using default arguments.

file.setFileName(Globals->sdkPath + "/share/openbr/models/EyeLocatorASEF128x128.fel");
if (!file.open(QFile::ReadOnly)) qFatal("Failed to open %s for reading.", qPrintable(file.fileName()));
if (!file.open(QFile::ReadOnly))
throw QString("Failed to open %1 for reading.").arg(file.fileName()).toStdString();
Copy link
Member

@jklontz jklontz Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got br -docs working again. How about this approach for handling initialization errors? I think you can remove _init()?

@@ -0,0 +1,9 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(br-docs br-docs.cpp ${BR_RESOURCES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a separate CLI app here. I think br -docs should do this when -algorithm isn't set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants