Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tf stage #71

Merged
merged 4 commits into from
Sep 2, 2021
Merged

Tf stage #71

merged 4 commits into from
Sep 2, 2021

Conversation

davidplowman
Copy link
Collaborator

@naushir
This set of patches adds the new TfStage base class which makes the addition of new TFLite-based post-processing stages easier. The first of the commits adds the new TfStage class implementation.

Subsequently there's one patch that refactors the Object Classifier to use the new base class, and another that further refactors the Pose Estimator in the same way. (There's a final small file renaming patch that just fixes up an incorrect JSON file name.,)

Copy link
Collaborator

@naushir naushir left a comment

Choose a reason for hiding this comment

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

Looks good, only one minor thing about the models file.

model_ = tflite::FlatBufferModel::BuildFromFile(config_->model_file.c_str());
std::cout << "TfStage: Loaded model " << config_->model_file << std::endl;
model_->error_reporter();

Copy link
Collaborator

Choose a reason for hiding this comment

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

If there is an error (e.g. model file missing), do we need some kind of exception here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I'll fix that.

… stages

The TfStage class provides a certain amount of TFLite boilerplate, and
handles various tasks like fetching the streams, cropping the image to
the right size, and so on. It also calls the interpreter
asynchronously and provides an API for derived classes to implement to
interpret and use the results.

Signed-off-by: David Plowman <[email protected]>
…lass

Mostly the effect is just to remove code which is now provided in the
TfStage base class.

Signed-off-by: David Plowman <[email protected]>
…lass

Mostly this just involves the removal of code that is now in the base class.

Signed-off-by: David Plowman <[email protected]>
…ion_tf.json

This is the name it should have to match everything else.

Signed-off-by: David Plowman <[email protected]>
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.

2 participants