Skip to content

Instantly share code, notes, and snippets.

@jamesonthecrow
Created February 14, 2019 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesonthecrow/90edfb2c7d856b9ca589fb3ab2a0c679 to your computer and use it in GitHub Desktop.
Save jamesonthecrow/90edfb2c7d856b9ca589fb3ab2a0c679 to your computer and use it in GitHub Desktop.
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