Created
February 14, 2019 21:30
-
-
Save jamesonthecrow/90edfb2c7d856b9ca589fb3ab2a0c679 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CameraActivity extends Activity implements ImageReader.OnImageAvailableListener { | |
// The rest of your activity | |
@Override | |
public void onImageAvailable(final ImageReader reader) { | |
// The FritzVisionImage class makes it easy to manipulate images used as model inputs. | |
Image image = reader.acquireLatestImage(); | |
final FritzVisionImage fritzVisionImage = FritzVisionImage.fromMediaImage(image, imageRotation); | |
image.close(); | |
// Run the model to find poses in the image. | |
poseResult = posePredictor.predict(fritzVisionImage); | |
// Draw the result. | |
poseResult.drawPoses(canvas, cameraSize); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment