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

[PR] Make some empty class and struct for interpretor #3

Merged
merged 4 commits into from Mar 14, 2020

Conversation

tucan9389
Copy link
Owner

@tucan9389 tucan9389 commented Mar 14, 2020

Related Issue

PR Point

  • Add TFLiteImageInterpretor for implementing pre-process of image input
  • Add PoseEstimator protocol for abstraction
  • Add PoseNetPoseEstimator for specifying input/output and model name of PoseNet tflite file

}

protocol PoseEstimator {
func predict(with pixelBuffer: CVPixelBuffer) -> PoseEstimationResult
Copy link
Collaborator

@syjdev syjdev Mar 14, 2020

Choose a reason for hiding this comment

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

In the imeplementation of protocol PoseEstimator,
behavior of predict is similar to estimate or inference.
So I think, 'estimate' or 'inference' are more suitable function name than 'predict'

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for your suggestion. I'll change to inference.

@@ -9,12 +9,11 @@
import UIKit

class ViewController: UIViewController {

let poseEstimator: PoseEstimator = PoseNetPoseEstimator()
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the mean of NetPose?

Copy link
Owner Author

@tucan9389 tucan9389 Mar 14, 2020

Choose a reason for hiding this comment

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

PoseNet is the paper for pose estimation distributed in 2015. PoseNetPoseEstimator stand for PoseNet + PoseEstimator which means that the pose estimator implementing PoseNet tflite model.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank, I undetstood.


import CoreVideo

enum PoseEstimationResult {
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you ever seen, https://developer.apple.com/documentation/swift/result ?
I think, you need to implement no fail case.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Cool. Thanks for your advice.

// <#TODO#>
}

var keypointsAndScore: [(position: CGPoint, score: CGFloat)] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keypoint have a score.
So, keypointsAndScore have duplicated meaning.

And I can implement, var keypoints: [Keypoint] { ... }.
This is more simple, isn't it?

Copy link
Owner Author

Choose a reason for hiding this comment

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

@syjdev
👍 Right, I replaced to keypoints: [Keypoints] property.

@tucan9389 tucan9389 self-assigned this Mar 14, 2020
@tucan9389
Copy link
Owner Author

@syjdev
Thanks for your reviews

@tucan9389 tucan9389 merged commit 3f36943 into master Mar 14, 2020
@tucan9389 tucan9389 linked an issue Mar 20, 2020 that may be closed by this pull request
3 tasks
@tucan9389 tucan9389 deleted the make-layers branch March 21, 2020 02:15
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.

Responsibility of each layer
2 participants