Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class ClassificationFrameProcessor implements FrameProcessor {
private final ModelClassificator modelClassificator;
private final ClassificationListener classificationListener;
public ClassificationFrameProcessor(ModelClassificator modelClassificator,
ClassificationListener classificationListener) {
this.modelClassificator = modelClassificator;
this.classificationListener = classificationListener;
public void process(@NonNull Frame frame) {
Bitmap bitmap = frameToBitmap(frame);
List<ClassificationResult> results = modelClassificator.process(bitmap);
private Bitmap frameToBitmap(Frame frame) {
/* Conversion code specific for data from CameraView library. */
public interface ClassificationListener {
void onClassifiedFrame(List<ClassificationResult> classificationResults);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment